MariaDB bind on correct address
authorJiri Stransky <jistr@redhat.com>
Fri, 10 Apr 2015 09:28:44 +0000 (11:28 +0200)
committerDan Prince <dprince@redhat.com>
Fri, 10 Apr 2015 17:07:02 +0000 (17:07 +0000)
Despite passing bind-address for MariaDB in overcloud_controller.pp
correctly, it was always trying to bind on 0.0.0.0. The problem is
caused by Galera's config file (we install Galera into the image even
though we don't use it yet). Galera's default config file contains
override of the bind-address value to 0.0.0.0, and the setting from
galera.cnf took precendence over what was in server.cnf.

The mariadb-galera-server package assumes that the main config happens
in galera.cnf and it ships an almost empty server.cnf. We now have an
EnableGalera param, when it's set to true the mysql module will manage
galera.cnf instead of server.cnf, overriding the default values from
galera.cnf and fixing the issue.

Change-Id: I7c2fd41d41dcf5eb4ee8b1dbd74d60cc2cabeed9
Closes-Bug: #1442256

controller.yaml
overcloud-without-mergepy.yaml
puppet/controller-puppet.yaml
puppet/manifests/overcloud_controller.pp

index 33286d1..9c0fa0c 100644 (file)
@@ -63,6 +63,10 @@ parameters:
     default: ''
     description: Set to True to enable debugging on all services.
     type: string
+  EnableGalera:
+    default: true
+    description: Whether to use Galera instead of regular MariaDB.
+    type: boolean
   ExtraConfig:
     default: {}
     description: |
index 6172e02..d8c84bc 100644 (file)
@@ -259,6 +259,10 @@ parameters:
     default: 'br-ex'
     description: Interface where virtual ip will be assigned.
     type: string
+  EnableGalera:
+    default: true
+    description: Whether to use Galera instead of regular MariaDB.
+    type: boolean
   ExtraConfig:
     default: {}
     description: |
@@ -532,6 +536,7 @@ resources:
           ControlVirtualInterface: {get_param: ControlVirtualInterface}
           ControllerExtraConfig: {get_param: controllerExtraConfig}
           Debug: {get_param: Debug}
+          EnableGalera: {get_param: EnableGalera}
           ExtraConfig: {get_param: ExtraConfig}
           Flavor: {get_param: OvercloudControlFlavor}
           GlancePort: {get_param: GlancePort}
index 3c29989..780c8cf 100644 (file)
@@ -63,6 +63,10 @@ parameters:
     default: ''
     description: Set to True to enable debugging on all services.
     type: string
+  EnableGalera:
+    default: true
+    description: Whether to use Galera instead of regular MariaDB.
+    type: boolean
   ExtraConfig:
     default: {}
     description: |
@@ -507,6 +511,7 @@ resources:
             - - 'http://'
               - {get_param: VirtualIP}
               - ':5000/v2.0/'
+        enable_galera: {get_param: EnableGalera}
         mysql_innodb_buffer_pool_size: {get_param: MysqlInnodbBufferPoolSize}
         mysql_root_password: {get_param: MysqlRootPassword}
         mysql_cluster_name:
@@ -717,6 +722,7 @@ resources:
 
                 # MySQL
                 admin_password: {get_input: admin_password}
+                enable_galera: {get_input: enable_galera}
                 mysql_innodb_buffer_pool_size: {get_input: mysql_innodb_buffer_pool_size}
                 mysql::server::root_password: {get_input: mysql_root_password}
                 mysql_cluster_name: {get_input: mysql_cluster_name}
index 2b637b3..3e3f2e7 100644 (file)
@@ -39,8 +39,15 @@ if hiera('step') >= 2 {
     include ::ntp
   }
 
+  if str2bool(hiera('enable_galera', 'true')) {
+    $mysql_config_file = '/etc/my.cnf.d/galera.cnf'
+  } else {
+    $mysql_config_file = '/etc/my.cnf.d/server.cnf'
+  }
+
   # TODO Galara
   class { 'mysql::server':
+    config_file => $mysql_config_file,
     override_options => {
       'mysqld' => {
         'bind-address' => hiera('controller_host')