Commit graph

59 commits

Author SHA1 Message Date
Gabriel Filion
1522deafda mysql root password is leaked to the process list
Every time the root password reset is used we're leaking the password to
the process list. If we use the already present /root/.my.cnf for
credentials then it has the same effect for verification and we avoid
leaking the password.
2015-05-13 16:02:36 -04:00
Jerome Charaoui
a713d36aeb Merge branch 'master' of git://git.puppet.immerda.ch/module-mysql
Conflicts:
	files/scripts/optimize_tables.rb
	manifests/server/base.pp
2015-02-24 16:46:45 -05:00
mh
e1649647f3 fix issues for EL7 + simplify account security
* EL7 uses mariadb & systemd -> adjust setpasswd script to that
* move the security ensurance to the setpassword script, as it's
  easier to ensure that there
2015-01-24 18:05:08 +01:00
mh
fd71b9473f split on new line, which fixes an issue if no table is found 2015-01-12 23:29:41 +01:00
mh
02c8f3342e introduce new mariadb based config for EL7 2015-01-10 02:18:15 +01:00
Gabriel Filion
0f817282af Merge branch 'mention_path' 2014-03-12 16:26:42 -04:00
Jerome Charaoui
8fbc1b33ee Fix command output capturing in optimize_tables.rb for Ruby 1.9 2014-03-11 17:57:03 -04:00
mh
cae3a3cbe8 fix #6638 - remove the unless check & improve script
To workaround a limitation of the exec provider within puppet, we
do the unless check no within the script itself and ensure that
we use the password there.

https://labs.riseup.net/code/issues/6638
2014-02-05 22:34:17 +01:00
mh
7bde4efe1e improve optimize script 2014-01-12 14:19:26 +01:00
mh
c38546e15f introduce the /etc/mysql/conf.d/ directory for CentOS 2013-12-05 20:14:04 +01:00
mh
1caaa07190 some reasonable defaults 2013-12-05 10:47:25 +01:00
mh
eb03b7f647 update to latest EL release 2013-12-04 23:40:38 +01:00
mh
808a83374c rename deprecated option 2013-12-04 23:24:59 +01:00
mh
bad8721b44 also chown the data dir 2013-12-04 23:19:09 +01:00
mh
5665884209 EL6.4 doesn't know about bdb 2013-12-04 23:12:22 +01:00
Gabriel Filion
3c93ba2339 setmysqlpass: be more careful before plundering into action
Since this script is rooting the database, it'd be good to use a little
more precaution so that we don't let systems be in an inconsistent case
when crashing.

In cases where the PATH variable is not appropriately set (variable is
empty by default when script is invoked by puppet) the script shuts down
mysql and then is not able to call most commands.
2013-11-15 04:07:28 -05:00
mh
6d9a846867 introduce helpers for mysql backups 2013-02-19 10:12:35 +01:00
mh
dd6c24844b Merge remote-tracking branch 'shared/master'
Conflicts:
	files/config/my.cnf.Debian
	manifests/server/base.pp
	manifests/server/munin/default.pp
	manifests/server/nagios.pp
2013-01-02 17:03:18 +01:00
mh
1f0784b73e Merge remote-tracking branch 'laurantb/master'
Conflicts:
	manifests/server/cron/backup.pp
2012-04-29 12:55:07 +02:00
Micah Anderson
ad04b1fbe7 Merge remote-tracking branch 'lelutin/squeeze_my_cnf' into shared 2012-04-11 18:25:17 -04:00
Gabriel Filion
8180e27115 Import my.cnf from Debian Squeeze
Lenny support was phased out and squeeze is the current stable.

There is an instruction in the file that originally came from lenny:
skip-bdb doesn't exist anymore in the mysql version in squeeze, so the
config file makes a fresh mysql install crash on Squeeze.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2012-04-09 02:26:23 -04:00
Micah Anderson
d66e58c325 Merge commit '356fdab8147f8a32a3f14514f2bb77f4f312c734' into shared
Conflicts:
	files/munin/mysql_connections
	manifests/server/base.pp
	manifests/server/munin/default.pp
2012-03-07 11:49:28 -05:00
Micah Anderson
e9ff8b6a23 Merge remote-tracking branch 'lelutin/root_pw_no_arg' into shared
Conflicts:
	manifests/server/base.pp
2012-03-07 11:02:01 -05:00
mh
a72ab41660 add innodb_file_per_table option by default
mysql has one innodb file per default and this can become very
huge, which can trigger various issues [1]. So in general it
is recommended to set the innodb_file_per_table option [2].

[1] http://forums.mysql.com/read.php?35,121880,121886
[2] http://dev.mysql.com/doc/refman/5.0/en/innodb-multiple-tablespaces.html
2012-01-17 22:31:44 +01:00
Laurent Bachelier
27c37a5b1b BDB is not compiled anymore on Debian systems
It would make the daemon fail to load if put in the config.
2011-03-17 15:55:13 +01:00
mh
356fdab814 add some other mysql plugins 2010-12-21 22:10:34 +01:00
Gabriel Filion
e894ddb718 Avoid root password leak to process list
The current procedure of setting the root MySQL password leaks the root
password by giving it to the setmysqlpass.sh script on the command line.
This means that during the couple of seconds that the script is
executing, the password is visible in the process list!

Since we're already writing the password in the /root/.my.cnf file, make
the setmysqlpass.sh script parse this file to retrieve the password
instead of receiving it from a command line argument.

Also, in some shells the 'echo' command might appear in the process
list. Use a heredoc notation to create the output without using a
command.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-12-18 12:50:17 +01:00
Gabriel Filion
af8b414c32 Avoid root password leak to process list
The current procedure of setting the root MySQL password leaks the root
password by giving it to the setmysqlpass.sh script on the command line.
This means that during the couple of seconds that the script is
executing, the password is visible in the process list!

Since we're already writing the password in the /root/.my.cnf file, make
the setmysqlpass.sh script parse this file to retrieve the password
instead of receiving it from a command line argument.

Also, in some shells the 'echo' command might appear in the process
list. Use a heredoc notation to create the output without using a
command.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
2010-12-15 08:30:53 -05:00
Micah Anderson
9583889456 add mysql munin graphs and adjust the file distribution to match the right location of where they are 2010-11-01 19:43:23 -04:00
Micah Anderson
fa67257056 . remove the check_mysql_health script from the mysql module, instead it belongs in the nagios module
. change the default nagios::service::mysql check to use the check_mysql_health 'connection-time' check mode, which is identical to the original check, with some additional information

. stop using nagios::plugin::deploy because this doesn't work when more than one node attempts to realize this class

. stop exporting the nagios_command because this doesn't work when more than one node attempts to realize this class

. remove the check_health define, instead this be how it was before, as the previous nagios::service::mysql define
2010-10-18 20:52:42 -04:00
Micah Anderson
9463479afa add new version of check_mysql_health plugin 2010-10-17 14:30:59 -04:00
Micah Anderson
784bd6271f add a more advanced mysql health check plugin:
* create a mysql::server::nagios::base class with the common parts needed for the basic plugin, and the health plugin
 * make mysql::server:nagios inherit mysql::server:nagios::base
 * create a new class mysql::server::nagios::check_health inheriting ::base

the nagios module has also received a new define to setup the different nagios::service pieces for the different health check modes that might be desired

its assumed you would setup the different health check modes in site-mysql/init.pp as different hosts will require different modes and/or parameters, for example:

class site-mysql::server {
  include mysql::server::nagios::check_health

  nagios::service::mysql_health { [ 'connection-time', 'uptime', 'threads-connected', 'threadcache-hitrate' ]:
    require => Mysql_grant[$nagios_mysql_user],
  }

  case $hostname {
    "eider": {
      nagios::service::mysql_health { [ 'slave-io-running', 'slave-sql-running', 'slave-lag' ]:
    require => Mysql_grant[$nagios_mysql_user],
      }
    }
  }
}
2010-09-27 13:18:51 -04:00
Micah Anderson
a3e7b031a3 Merge remote branch 'remotes/immerda/master'
Conflicts:
	manifests/server/base.pp
2010-09-22 13:12:51 -04:00
Micah Anderson
eaf52f77a3 increase timeout before killing to account for slower startup speed of larger databases 2010-09-22 12:55:10 -04:00
mh
828e93c72d as we are in ruby we need to double escape that 2010-04-04 12:27:12 +02:00
mh
d40e1130bc escape table and db names 2010-04-04 12:21:33 +02:00
mh
b296d7a710 improve optimize script to work as well on weird named tables 2010-04-02 17:52:44 +02:00
Jerome Charaoui
9ec0ef766c make backup and optimize cron jobs optional; introduce $mysql_backup_cron, $mysql_backup_dir and$mysql_optimize_cron; use a module_dir for scripts 2009-12-10 14:52:50 -05:00
Jerome Charaoui
dcc761cbfd add Debian support 2009-12-10 12:22:25 -05:00
mh
911dbc4426 be nicer during mysql backup
sometimes it can happen that by locking all tables we run into
error 24, which means to many open files.

According to http://rackerhacker.com/2007/08/19/mysql-errcode-24-when-using-lock-tables/
we can use single-transaction to be nicer during backups.
2009-11-19 02:36:13 +01:00
mh
d4cccaa62f set home so .my.cnf is found as we run it as cron weekly 2009-02-22 13:07:39 +00:00
mh
95c5cd82d9 fixing integer conversion 2009-02-22 13:02:08 +00:00
mh
288a33be75 merged with puzzle 2009-02-21 17:22:47 +00:00
mh
2dc631bd2a Merge commit 'puzzle/development' 2008-10-19 22:15:48 +00:00
mh
0403071c55 optimized default my.cnf 2008-08-07 10:09:21 +00:00
mh
aa99ee9826 merged with puzzle 2008-08-07 09:24:59 +00:00
mh
f0ade619a0 if we enable binary logs, we should also enable max days for them 2008-07-29 22:23:29 +00:00
mh
741a6ba1f6 merged with immerda, added data directory to be default 2008-07-14 21:25:49 +00:00
mh
7c987d7fe6 fixed log-bin location 2008-07-13 14:19:37 +00:00
mh
c7752a3775 fixing bin-log param 2008-07-11 15:40:49 +00:00