diff --git a/prometheus/README.rst b/prometheus/README.rst index 49f8c238..cc47da19 100644 --- a/prometheus/README.rst +++ b/prometheus/README.rst @@ -34,3 +34,26 @@ Install node_exporter cd /opt/openstack-ansible-ops/prometheus openstack-ansible installNodeExporter.yml + + +If you want to deploy the mysqld_exporter, you need to create the Galera user for it first + +.. code-block:: yaml + + galera_additional_users: + - name: "exporter" + host: '%' + password: "{{ prometheus_mysqld_exporter_galera_password }}" + priv: '*.*:PROCESS,REPLICATION CLIENT,SELECT,SLAVE MONITOR' + resource_limits: + MAX_USER_CONNECTIONS: 3 + check_hostname: false + state: present + + +Then install the mysqld_exporter + +.. code-block:: bash + + cd /opt/openstack-ansible-ops/prometheus + openstack-ansible installMysqldExporter.yml diff --git a/prometheus/installMysqldExporter.yml b/prometheus/installMysqldExporter.yml new file mode 100644 index 00000000..7f80405d --- /dev/null +++ b/prometheus/installMysqldExporter.yml @@ -0,0 +1,17 @@ +--- + + +- name: Refresh local facts + hosts: galera_all + tasks: + - name: refresh local facts + setup: + +- name: mysqld_exporter + hosts: galera_all + roles: + - role: prometheus.prometheus.mysqld_exporter + vars: + mysqld_exporter_host: "{{ ansible_host }}" + mysqld_exporter_password: "{{ prometheus_mysqld_exporter_galera_password }}" + mysqld_exporter_web_listen_address: "{{ ansible_host }}:9104"