blablacar / ggn

Link container builds with envs to end up into low level orchestration
35 stars 9 forks source link

Problem with node and env attributes - leaf overrided #3

Closed mfouilleul closed 8 years ago

mfouilleul commented 9 years ago

I created a attributes directory with some galera config on my environment:

vi ../env/prod/services/db-log/attributes/galera.cnf.yml

---
override:
  galera:
    mysqld:
      wsrep_provider_options:
        gcache.size: "1G"
        gmcast.segment: 1
        gcs.fc_limit: 500
        gcs.fc_master_slave: "YES"
        gcs.fc_factor: "1.0"

It is basically some "environment" attributes.

I added some "node attributes" in the manifest as:

vi ../env/prod/services/db-log/service-manifest.yml
...
nodes:
  - hostname: mydb5
    ip: XX.XX.XX.XX
    fleet:
      - MachineMetadata="rack=1" "pos=1"
    attributes:
      galera:
        mysqld:
          wsrep_cluster_address:"gcomm://mydb1.prod,mydb2.prod,mydb3.prod,mydb4prod"

My problem is that the mysqld section is overrided by the node attribute.

In the unit I have:

[...]"galera":{"mysqld":"wsrep_cluster_address:\\\"gcomm://mydb1.prod,mydb2.prod,mydb3.prod,mydb4prod\\\""}[...]

Instead of

[...]"galera":{"mysqld":"wsrep_cluster_address:"gcomm://mydb1.prod,mydb2.prod,mydb3.prod,mydb4prod","wsrep_provider_options":{"gcache.size":"1G","gcs.fc_factor":"1.0","gcs.fc_limit":500,"gcs.fc_master_slave":"YES","gmcast.segment":1}}[...]

Note that the attribute wsrep_cluster_address is part of the mysqld value,

Key => "mysqld": 
Value => "wsrep_cluster_address:\\\"gcomm://bbcdblog4,bbcdblog5,bbcdblog6,dblog8\\\""

Thanks

n0rad commented 9 years ago

it seems to come from yaml parser that give the complete wsrep_cluster_address line as a key. (need to be check)

if you change

wsrep_cluster_address:"gcomm://mydb1.prod,mydb2.prod,mydb3.prod,mydb4prod"

to

wsrep_cluster_address: "gcomm://mydb1.prod,mydb2.prod,mydb3.prod,mydb4prod"

it solve the problem