Merge pull request #198 from mhellmic/maxconnections

add a maximum connection parameter and set the default to 1000
This commit is contained in:
Ashley Penney 2013-07-02 10:43:29 -07:00
commit aa5d1f070b
5 changed files with 31 additions and 25 deletions

View file

@ -49,6 +49,7 @@ class mysql::config(
$pidfile = $mysql::pidfile,
$port = $mysql::port,
$purge_conf_dir = $mysql::purge_conf_dir,
$max_connections = $mysql::max_connections,
$restart = $mysql::restart,
$root_group = $mysql::root_group,
$root_password = $mysql::root_password,

View file

@ -112,6 +112,7 @@ class mysql(
$port = $mysql::params::port,
$purge_conf_dir = $mysql::params::purge_conf_dir,
$python_package_name = $mysql::params::python_package_name,
$max_connections = $mysql::params::max_connections,
$restart = $mysql::params::restart,
$root_group = $mysql::params::root_group,
$root_password = $mysql::params::root_password,

View file

@ -20,6 +20,7 @@ class mysql::params {
$old_root_password = ''
$package_ensure = 'present'
$purge_conf_dir = false
$max_connections = 151
$port = 3306
$max_allowed_packet = '16M'
$root_password = 'UNSET'

View file

@ -5,6 +5,7 @@ describe 'mysql::config' do
{
:root_password => 'UNSET',
:old_root_password => '',
:max_connections => '151',
:bind_address => '127.0.0.1',
:port => '3306',
:max_allowed_packet => '16M',
@ -18,34 +19,34 @@ describe 'mysql::config' do
describe 'with osfamily specific defaults' do
{
'Debian' => {
:datadir => '/var/lib/mysql',
:service_name => 'mysql',
:config_file => '/etc/mysql/my.cnf',
:socket => '/var/run/mysqld/mysqld.sock',
:pidfile => '/var/run/mysqld/mysqld.pid',
:root_group => 'root',
:ssl_ca => '/etc/mysql/cacert.pem',
:ssl_cert => '/etc/mysql/server-cert.pem',
:ssl_key => '/etc/mysql/server-key.pem'
:datadir => '/var/lib/mysql',
:service_name => 'mysql',
:config_file => '/etc/mysql/my.cnf',
:socket => '/var/run/mysqld/mysqld.sock',
:pidfile => '/var/run/mysqld/mysqld.pid',
:root_group => 'root',
:ssl_ca => '/etc/mysql/cacert.pem',
:ssl_cert => '/etc/mysql/server-cert.pem',
:ssl_key => '/etc/mysql/server-key.pem'
},
'FreeBSD' => {
:datadir => '/var/db/mysql',
:service_name => 'mysql-server',
:config_file => '/var/db/mysql/my.cnf',
:socket => '/tmp/mysql.sock',
:pidfile => '/var/db/mysql/mysql.pid',
:root_group => 'wheel',
:datadir => '/var/db/mysql',
:service_name => 'mysql-server',
:config_file => '/var/db/mysql/my.cnf',
:socket => '/tmp/mysql.sock',
:pidfile => '/var/db/mysql/mysql.pid',
:root_group => 'wheel'
},
'RedHat' => {
:datadir => '/var/lib/mysql',
:service_name => 'mysqld',
:config_file => '/etc/my.cnf',
:socket => '/var/lib/mysql/mysql.sock',
:pidfile => '/var/run/mysqld/mysqld.pid',
:root_group => 'root',
:ssl_ca => '/etc/mysql/cacert.pem',
:ssl_cert => '/etc/mysql/server-cert.pem',
:ssl_key => '/etc/mysql/server-key.pem'
:datadir => '/var/lib/mysql',
:service_name => 'mysqld',
:config_file => '/etc/my.cnf',
:socket => '/var/lib/mysql/mysql.sock',
:pidfile => '/var/run/mysqld/mysqld.pid',
:root_group => 'root',
:ssl_ca => '/etc/mysql/cacert.pem',
:ssl_cert => '/etc/mysql/server-cert.pem',
:ssl_key => '/etc/mysql/server-key.pem'
}
}.each do |osfamily, osparams|
@ -177,6 +178,7 @@ describe 'mysql::config' do
"socket = #{param_values[:socket]}",
"pid-file = #{param_values[:pidfile]}",
"datadir = #{param_values[:datadir]}",
"max_connections = #{param_values[:max_connections]}",
"bind-address = #{param_values[:bind_address]}",
"max_allowed_packet = #{param_values[:max_allowed_packet]}"
]
@ -242,7 +244,7 @@ describe 'mysql::config' do
describe 'unset ssl params should fail when ssl is true on freebsd' do
let :facts do
{:osfamily => 'FreeBSD'}
{:osfamily => 'FreeBSD'}
end
let :params do

View file

@ -15,6 +15,7 @@ port = <%= @port %>
basedir = <%= @basedir %>
datadir = <%= @datadir %>
tmpdir = <%= @tmpdir %>
max_connections = <%= @max_connections %>
skip-external-locking
<% if @bind_address %>