This document describes how to set up Anomaly Detection for OpenSDS project.
Run command which pip
to check if your environment has pip tool, if not you can refer to the following steps to install it.
$ wget https://bootstrap.pypa.io/get-pip.py
$ python get-pip.py # Maybe python3 get-pip.py in your environment.
Install anomaly detection using pip.
pip install git+https://github.com/opensds/anomaly-detection.git
if you want to install a specified branch, run command like blow:
$ pip install git+https://github.com/opensds/[email protected]
Anomaly detection will get metrics from Telemetry, before modifying the configuration file, please make sure the telemetry is started up (Note: add telemetry installation guide later).
If your python version is greater than 3.0, run follow command to copy the template configuration file to /etc/
,otherwise please skip this step, because the template configuration file has already been copied to the /etc/anomaly-detection
by pip tool automatically.
# please note the python version
$ cp /usr/local/lib/python3.5/dist-packages/etc/anomaly_detection /etc
There are three services in anomaly-detection project: api-server, data-generator, data-parser.
- Initialize the database.
$ anomaly-detection-manage db sync --config-file /etc/anomaly_detection/anomaly_detection.conf
- Startup
$ anomaly-detection-api --config-file /etc/anomaly_detection/anomaly_detection.conf
- Check if server is started successfully
$ curl http://127.0.0.1:8085
- Open the configuration file(
/etc/anomaly_detection/anomaly_detection.conf
) and modify the data_parser relative options in data_parser section. One possible configuration would be like below:[data_parser] receiver_name=kafka kafka_topic=metrics kafka_bootstrap_servers=127.0.0.1:9092
- Startup
anomaly-detection-data-parser --config-file /etc/anomaly_detection/anomaly_detection.conf
- Data-generator service will send an API request to the telemetry service periodically, so the credentials are required by data-generator. Open the configuration file(
/etc/anomaly_detection/anomaly_detection.conf
) and modify the keystone relative options in keystone_authtoken section. One possible configuration would be like blow:[keystone_authtoken] project_domain_name = Default project_name = admin user_domain_name = Default password = opensds@123 username = admin auth_url = http://127.0.0.1/identity auth_type = password
- Open the configuration file(
/etc/anomaly_detection/anomaly_detection.conf
) and modify the data-generator relative options in data_generator section. One possible configuration would be like blow:[data_generator] opensds_endpoint = http://127.0.0.1:50040 api_version = v1beta auth_strategy = keystone http_log_debug = true opensds_backend_driver_type = lvm
- Startup
anomaly-detection-data-generator --config-file /etc/anomaly_detection/anomaly_detection.conf