Can't deploy InfluxDB/Grafana plugin in a decidated environment with the detach-database plugin

Bug #1558562 reported by Simon Pasquier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StackLight
Fix Released
Medium
guillaume thouvenin
0.9
Won't Fix
Medium
guillaume thouvenin

Bug Description

The grafana_mysql.pp manifest doesn't run successfully in this configuration.

diff --git a/deployment_scripts/puppet/manifests/grafana_mysql.pp b/deployment_scripts/puppet/manifests/grafana_mysql.pp
index 6f27d7f..d3bb22f 100644
--- a/deployment_scripts/puppet/manifests/grafana_mysql.pp
+++ b/deployment_scripts/puppet/manifests/grafana_mysql.pp
@@ -15,7 +15,7 @@
 $influxdb_grafana = hiera('influxdb_grafana')

 if $influxdb_grafana['mysql_mode'] == 'local' {
- $mysql = hiera('mysql')
+ $mysql = hiera_hash('mysql')
     $db_vip = hiera('database_vip')
     $db_admin_user = 'root'
     $db_admin_pass = $mysql['root_password']
@@ -38,7 +38,7 @@ host=<%= @db_vip %>
     mysql::db { $db_name:
       user => $db_username,
       password => $db_password,
- host => $db_vip,
+ host => '%',
       require => File[$db_options_file],
     }

@@ -46,4 +46,4 @@ host=<%= @db_vip %>
       command => "/bin/rm -f ${db_options_file}",
       require => Mysql::Db[$db_name],
     }
-}
\ No newline at end of file
+}

Tags: grafana
Revision history for this message
Roman Sokolkov (rsokolkov) wrote :

+ $mysql = hiera_hash('mysql') related to this override

https://github.com/openstack/fuel-plugin-detach-database/blob/stable/8.0/deployment_scripts/database_hiera_override.pp#L87-L88

+ host => '%', Allow all source IPs when accessing DB. Related to multiple existing VIPs. And incorrect VIP used as SOURCE IP when accessing MySQL

root@node-4:~# ip netns exec haproxy ip r
default via 240.0.0.1 dev hapr-ns metric 10000
10.30.0.0/24 via 240.0.0.1 dev hapr-ns metric 10000
192.168.0.0/24 dev b_es_vip_mgmt proto kernel scope link src 192.168.0.248
192.168.0.0/24 dev b_influxdb proto kernel scope link src 192.168.0.247
192.168.0.0/24 dev b_database proto kernel scope link src 192.168.0.249
192.168.0.0/24 via 240.0.0.1 dev hapr-ns metric 10000
192.168.1.0/24 via 240.0.0.1 dev hapr-ns metric 10000
240.0.0.0/30 dev hapr-ns proto kernel scope link src 240.0.0.2

Changed in lma-toolchain:
milestone: 1.0.0 → 0.10.0
Revision history for this message
guillaume thouvenin (guillaume-thouvenin) wrote :

I just deployed LMA with this review (https://review.openstack.org/#/c/310432/) on MOS 8 and I didn't observe the issue.

The puppet logs show that the manifest has been executed without errors and the grafana DB has been created on MySQL.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cinder |
| glance |
| grafana |
| heat |
| keystone |
| mysql |
| neutron |
| nova |
| performance_schema |
+--------------------+
10 rows in set (0.01 sec)

mysql> use grafana;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+--------------------+
| Tables_in_grafana |
+--------------------+
| api_key |
| dashboard |
| dashboard_snapshot |
| dashboard_tag |
| data_source |
| migration_log |
| org |
| org_user |
| quota |
| star |
| temp_user |
| user |
+--------------------+
12 rows in set (0.00 sec)

mysql>

Revision history for this message
guillaume thouvenin (guillaume-thouvenin) wrote :

Here is the output of the puppet apply of grafana_mysql manifest.

Revision history for this message
guillaume thouvenin (guillaume-thouvenin) wrote :

Forget my two previous comments, I tested with a controller.

Changed in lma-toolchain:
assignee: LMA-Toolchain Fuel Plugins (mos-lma-toolchain) → guillaume thouvenin (guillaume-thouvenin)
Revision history for this message
guillaume thouvenin (guillaume-thouvenin) wrote :

I just tested on MOS 8 with stable/8.0 of fuel-plugin-detach-database and Grafana has been configured. I have access to grafana dashboards.

Here is my env:
# fuel node --env 7
id | status | name | cluster | ip | mac | roles | pending_roles | online | group_id
---|--------|------------------|---------|-------------|-------------------|----------------------------------------|---------------|--------|---------
26 | ready | Untitled (f8:ca) | 7 | 10.109.5.26 | 64:cd:e4:dc:f8:ca | elasticsearch_kibana, influxdb_grafana | | True | 7
27 | ready | Untitled (34:8f) | 7 | 10.109.5.25 | 64:91:f1:2a:34:8f | standalone-database | | True | 7

And I attached the screenshot of grafana that is displaying metrics related to node-26.

Revision history for this message
guillaume thouvenin (guillaume-thouvenin) wrote :
Revision history for this message
Simon Pasquier (simon-pasquier) wrote :

I think having hiera_hash('mysql') instead of hiera('mysql') still makes sense.

Revision history for this message
Simon Pasquier (simon-pasquier) wrote :

And you might want to try co-locating the database role with the influxdb_grafana role on the same node.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-plugin-influxdb-grafana (master)

Fix proposed to branch: master
Review: https://review.openstack.org/311991

Changed in lma-toolchain:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-plugin-influxdb-grafana (master)

Reviewed: https://review.openstack.org/311991
Committed: https://git.openstack.org/cgit/openstack/fuel-plugin-influxdb-grafana/commit/?id=dca830b7a4bad8600ddeb7fbd853eb7fc136139a
Submitter: Jenkins
Branch: master

commit dca830b7a4bad8600ddeb7fbd853eb7fc136139a
Author: Guillaume Thouvenin <email address hidden>
Date: Mon May 2 15:59:04 2016 +0200

    Fix deployment in a dedicated env with detach-database plugin

    This patch fixes several issues when deploying detach_database and
    influxdb_grafana plugins on the same nodes:
     - it uses hiera_hash to get data from mysql keyword
     - it prevents the installation of mysql_client if it is already
       installed
     - it manages the existence of a file /root/.my.cnf

    Change-Id: I2237b905861fbdca4a37caf0e48ee1f71fedfc33
    Closes-Bug: #1558562

Changed in lma-toolchain:
status: In Progress → Fix Committed
Changed in lma-toolchain:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.