add redis-exporter for maat-redis.

This commit is contained in:
fumingwei
2020-11-21 17:06:40 +06:00
parent c6a1f9fdaa
commit b73dc0a16f
5 changed files with 34 additions and 0 deletions

View File

@@ -140,5 +140,9 @@ http {
location /metrics/blade/mcn3/mrapm_stream {
proxy_pass http://192.168.100.4:8902/metrics;
}
location /metrics/blade/mcn0/maat_redis {
proxy_pass http://192.168.100.1:9121/metrics;
}
}
}

View File

@@ -0,0 +1,11 @@
[Unit]
Description=Redis Exporter for MAAT-REDIS
After=network.target
[Service]
ExecStart=/usr/bin/redis_exporter -redis.addr=redis://localhost:7002 -redis-only-metrics
Type=simple
[Install]
WantedBy=multi-user.target

View File

@@ -4,6 +4,12 @@
dest: "/usr/lib/systemd/system"
mode: 0644
- name: "copy maat-redis exporter file to dest"
copy:
src: "{{ role_path }}/files/maat-redis-exporter.service"
dest: "/usr/lib/systemd/system"
mode: 0644
- name: "Template the maat-redis.conf"
template:
src: "{{ role_path }}/templates/maat-redis.conf.j2"
@@ -16,3 +22,10 @@
state: started
daemon_reload: yes
enabled: yes
- name: "start maat-redis exporter"
systemd:
name: maat-redis-exporter.service
state: started
daemon_reload: yes
enabled: yes

BIN
roles/redis/files/redis_exporter Executable file

Binary file not shown.

View File

@@ -10,3 +10,9 @@
- "/tmp/ansible_deploy/jemalloc-3.6.0-1.el7.x86_64.rpm"
- "/tmp/ansible_deploy/redis40u-4.0.14-1.ius.centos7.x86_64.rpm"
state: present
- name: "redis exporter"
copy:
src: '{{ role_path }}/files/'
dest: /usr/bin/
mode: 0755