使用示例

为了方便用户理解部署过程,假设当前数据库节点信息如下:

  1. IP: 10.90.110.130
  2. PORT: 8000
  3. type: single

detector服务器信息:

  1. IP: 10.90.110.131
  2. listen_host = 0.0.0.0
  3. listen_port = 8080

部署的启动流程如下:

配置文件修改

首先需要更改配置文件 a-detection.conf,主要涉及其中的两个session:

  1. [database]
  2. storage_duration = 12H # 数据存储时间长度,默认12小时
  3. database_dir = ./data # 数据存储目录
  4. [security]
  5. tls = False
  6. ca = ./certificate/ca/ca.crt
  7. server_cert = ./certificate/server/server.crt
  8. server_key = ./certificate/server/server.key
  9. agent_cert = ./certificate/agent/agent.crt
  10. agent_key = ./certificate/agent/agent.key
  11. [server]
  12. host = 10.90.110.131
  13. listen_host = 0.0.0.0
  14. listen_port = 8080
  15. white_host = 10.90.110.130
  16. white_port = 8000
  17. [agent]
  18. source_timer_interval = 10S
  19. sink_timer_interval = 10S
  20. channel_capacity = 1000
  21. db_host = 10.90.110.130
  22. db_port = 8080
  23. db_type = single
  24. [forecast]
  25. forecast_alg = auto_arima
  26. [log]
  27. log_dir = ./log

服务启动与停止

启动本地agent服务:

  1. python main.py start --role agent

停止本地agent服务:

  1. python main.py stop --role agent

启动本地collector服务:

  1. python main.py start --role collector

停止本地collector服务:

  1. python main.py stop --role collector

启动本地monitor服务:

  1. python main.py start --role monitor

停止本地monitor服务:

  1. python main.py stop --role monitor