From 5f49ab037e8ae45063936173aee3e1e1d32bf1a8 Mon Sep 17 00:00:00 2001 From: wangjian Date: Thu, 28 Nov 2024 09:43:56 +0800 Subject: [PATCH] add topo server install --- playbook/groups_vars/all | 6 +- playbook/host-multi-machine | 3 + playbook/roles/topo/tasks/main.yml | 13 ++++ playbook/templates/topo/topo_server.yaml.j2 | 80 +++++++++++++++++++++ 4 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 playbook/templates/topo/topo_server.yaml.j2 diff --git a/playbook/groups_vars/all b/playbook/groups_vars/all index a2cbdd2..485da7a 100644 --- a/playbook/groups_vars/all +++ b/playbook/groups_vars/all @@ -1,4 +1,8 @@ --- +mysql_username: PilotGo13579! mysql_password: "PilotGo13579!" redis_password: "PilotGo13579!" -pilotgo_agent_config: /opt/PilotGo/agent/config_agent.yaml \ No newline at end of file +neo4j_username: neo4j +neo4j_password: PilotGo13579! +pilotgo_agent_config: /opt/PilotGo/agent/config_agent.yaml +pilotgo_topo_config: /opt/PilotGo/plugin/topology/server/topo_server.yaml \ No newline at end of file diff --git a/playbook/host-multi-machine b/playbook/host-multi-machine index ca7c71c..40c2808 100644 --- a/playbook/host-multi-machine +++ b/playbook/host-multi-machine @@ -4,6 +4,9 @@ [redis] 2.2.2.2 +[neo4j] +2.2.3.3 + [pilotgo] 3.3.3.3 diff --git a/playbook/roles/topo/tasks/main.yml b/playbook/roles/topo/tasks/main.yml index e69de29..e9f80e3 100644 --- a/playbook/roles/topo/tasks/main.yml +++ b/playbook/roles/topo/tasks/main.yml @@ -0,0 +1,13 @@ +--- +- name: install pilotgo-topo-server + dnf: + name: PilotGo-plugin-topology-server + state: present + register: pilotgo_topo_info + ignore_errors: yes +- name: exit when pilotgo-topo-server fail install + fail: + msg: 'dnf install PilotGo-server failed' + when: pilotgo_topo_info.rc != 0 +- name: change PilotGo topo server config + template: src=templates/topo/topo_server.yaml.j2 dest={{ pilotgo_topo_config }} \ No newline at end of file diff --git a/playbook/templates/topo/topo_server.yaml.j2 b/playbook/templates/topo/topo_server.yaml.j2 new file mode 100644 index 0000000..8e55145 --- /dev/null +++ b/playbook/templates/topo/topo_server.yaml.j2 @@ -0,0 +1,80 @@ +#------------------------------- topo server ------------------------------- +topo: +# + https_enabled: false + cert_file: "" + key_file: "" +# +# 插件服务端服务器监听地址 + server_listen_addr: "0.0.0.0:9991" +# +# 远程客户端与插件服务端建立连接时插件的地址 + server_target_addr: "{{ groups['topo'][0] }}:9991" +# +# 插件agent端口号 + agent_port: "9992" +# +# 指定图数据库,若为"",则不启用图数据库来保存并查看历史图数据(支持的图数据库:neo4j) + graphDB: "" +# +# 静态资源目录:*.tar.gz *.rpm *.sh,用于通过PilotGo平台向业务节点远程部署topology plugin agent或其他资源 +# path: "/opt/PilotGo/plugin/topology/resource" +# +#------------------------------- log ------------------------------- +log: +# + level: debug +# +# 可选stdout和file。stdout:输出到终端控制台;file:输出到path下的指定文件。 + driver: file +# + path: /opt/PilotGo/plugin/topology/server/log/toposerver.log + max_file: 1 + max_size: 10485760 +# +#------------------------------- neo4j ------------------------------- +neo4j: +# + addr: "bolt://{{ groups['neo4j'][0] }}:7687" + username: "{{ neo4j_username }}" + password: "{{ neo4j_password }}" + DB: "neo4j" +# +# 数据采集时间间隔,单位秒(s) + period: 86400 +# +# 图历史数据保留时间,单位小时(h) + retention: 24 +# +# 执行清理图历史数据的时间(h:m:s) + cleartime: "02:30:00" +# +#------------------------------- redis ------------------------------- +redis: +# + addr: "{{ groups['redis'][0] }}:6379" + use_tls: true + password: '{{ redis_password }}' + DB: 1 + dialTimeout: 5s +# +#------------------------------- mysql ------------------------------- +mysql: +# + addr: "{{ groups['mysql'][0] }}:3306" + username: '{{ mysql_username }}' + password: '{{ mysql_password }}' + DB: "PluginTopo" +# +#------------------------------- influxdb 暂不启用 ------------------------------- +influx: +# + addr: "http://localhost:8086" + token: "" + org: "" + bucket: "" +# +#------------------------------- prometheus 暂不启用 ------------------------------- +prometheus: +# + addr: "http://localhost:9090" -- Gitee