Bug 1159390 - [RFE] Allow open_files_limit & max_connections to be set for mysql/mariaDB
Summary: [RFE] Allow open_files_limit & max_connections to be set for mysql/mariaDB
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-foreman-installer
Version: Foreman (RHEL 6)
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ga
: Installer
Assignee: Jason Guiditta
QA Contact: Ami Jeain
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-31 18:41 UTC by Lee Yarwood
Modified: 2023-02-22 23:02 UTC (History)
8 users (show)

Fixed In Version: openstack-foreman-installer-3.0.8-1.el7ost
Doc Type: Enhancement
Doc Text:
This enhancement exposes the open_files_limit and max_connections parameters for MySQL/MariaDB in the installer.
Clone Of:
Environment:
Last Closed: 2015-02-09 15:17:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0156 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Installer Bug Fix Advisory 2015-02-09 20:13:39 UTC

Description Lee Yarwood 2014-10-31 18:41:18 UTC
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

Comment 3 Felipe Alfaro Solana 2014-11-03 11:50:37 UTC
Would be nice to have this available for RHOS 4.0.

Comment 4 Lukas Bezdicka 2014-12-17 12:33:09 UTC
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?

Comment 5 Ivan Chavero 2014-12-17 13:34:42 UTC
Agree with Lukas, the puppet module already knows hot to handle this setting. 
I think that this should be addressed in OFI

Comment 7 Jason Guiditta 2014-12-17 15:41:48 UTC
Patch posted to allow override, we already set this as above:

https://github.com/redhat-openstack/astapor/pull/438

Comment 8 Jason Guiditta 2014-12-17 20:11:45 UTC
Merged by cwolfe

Comment 11 errata-xmlrpc 2015-02-09 15:17:47 UTC
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


Note You need to log in before you can comment on or make changes to this bug.