Description of problem: Allow open_files_limit & max_connections to be set for mysql/mariaDB Additional info: For openstack-puppet-modules-2013.2-9.3.el6ost.noarch when used with the foreman installer of OSP 4 the following hackaround allows this : # diff -u /usr/share/openstack-puppet/modules/mysql/templates/my.cnf.erb.bk /usr/share/openstack-puppet/modules/mysql/templates/my.cnf.erb --- /usr/share/openstack-puppet/modules/mysql/templates/my.cnf.erb.bk 2014-10-31 18:17:17.052837014 +0000 +++ /usr/share/openstack-puppet/modules/mysql/templates/my.cnf.erb 2014-10-31 18:04:49.077837007 +0000 @@ -11,6 +11,8 @@ port = <%= port %> basedir = <%= basedir %> datadir = <%= datadir %> +open_files_limit = <%= open_files_limit %> +max_connections = <%= max_connections %> tmpdir = /tmp skip-external-locking # diff -u /usr/share/openstack-puppet/modules/mysql/manifests/config.pp.bk /usr/share/openstack-puppet/modules/mysql/manifests/config.pp --- /usr/share/openstack-puppet/modules/mysql/manifests/config.pp.bk 2014-10-31 18:09:08.019837006 +0000 +++ /usr/share/openstack-puppet/modules/mysql/manifests/config.pp 2014-10-31 18:11:42.658837003 +0000 @@ -51,7 +51,9 @@ $log_error = $mysql::params::log_error, $default_engine = 'UNSET', $root_group = $mysql::params::root_group, - $restart = $mysql::params::restart + $restart = $mysql::params::restart, + $open_files_limit = $mysql::params::open_files_limit, + $max_connections = $mysql::params::max_connections, ) inherits mysql::params { File { # diff -u /usr/share/openstack-puppet/modules/mysql/manifests/params.pp.bk /usr/share/openstack-puppet/modules/mysql/manifests/params.pp --- /usr/share/openstack-puppet/modules/mysql/manifests/params.pp.bk 2014-10-31 18:33:56.720837010 +0000 +++ /usr/share/openstack-puppet/modules/mysql/manifests/params.pp 2014-10-31 18:28:17.572837011 +0000 @@ -17,6 +17,8 @@ $etc_root_password = false $ssl = false $restart = true + $open_files_limit = 8192 + $max_connections = 1024 case $::operatingsystem { 'Ubuntu': { # puppet agent -t [..] Info: Applying configuration version '1414780272' Notice: /Stage[main]/Quickstack::Hamysql::Mysql::Config/File[/etc/my.cnf]/content: --- /etc/my.cnf 2014-10-31 18:05:48.720312587 +0000 +++ /tmp/puppet-file20141031-1388-1rp9cq1-0 2014-10-31 18:31:18.163312587 +0000 @@ -11,6 +11,8 @@ port = 3306 basedir = /usr datadir = /var/lib/mysql +open_files_limit = 8192 +max_connections = 1024 tmpdir = /tmp skip-external-locking
Would be nice to have this available for RHOS 4.0.
I don't think this is bug at all, you shouldn't even have to touch the template. Correct solution here is what packstack actually is doing, here is sample of generated packstack code: class { 'mysql::server': package_name => 'mariadb-galera-server', restart => true, root_password => hiera('CONFIG_MARIADB_PW'), require => Package['mariadb-server'], override_options => { 'mysqld' => { bind_address => '0.0.0.0', default_storage_engine => 'InnoDB', max_connections => '1024', open_files_limit => '-1', } } } To explain override_options is hash parsed by the mysql module and passed to template: mysql::server: # Create a merged together set of options. Rightmost hashes win over left. $options = mysql_deepmerge($mysql::params::default_options, $override_options) template: <% @options.sort.map do |k,v| -%> <% if v.is_a?(Hash) -%> [<%= k %>] <% v.sort.map do |ki, vi| -%> <% if ki == 'ssl-disable' or (ki =~ /^ssl/ and v['ssl-disable'] == true) -%> <% next %> <% elsif vi == true or v == '' -%> <%= ki %> <% elsif vi.is_a?(Array) -%> <% vi.each do |vii| -%> <%= ki %> = <%= vii %> <% end -%> <% elsif ![nil, '', :undef].include?(vi) -%> <%= ki %> = <%= vi %> <% end -%> <% end -%> <% end %> <% end -%> The code sample is probably from older openstack-puppet-modules?
Agree with Lukas, the puppet module already knows hot to handle this setting. I think that this should be addressed in OFI
Patch posted to allow override, we already set this as above: https://github.com/redhat-openstack/astapor/pull/438
Merged by cwolfe
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-0156.html