Puppetlabs-mysql with Percona

294 views
Skip to first unread message

Matt Shields

unread,
Mar 24, 2015, 8:27:37 AM3/24/15
to puppet...@googlegroups.com
Does anyone have an example of provisioning Percona MySQL using the puppetlabs-mysql module?

Here's my puppet code:

 15   package { 'percona-release':
 16     ensure   => present,
 18     provider => rpm,
 19   }
 20 
 21   $override_options = {
 22     'mysqld'            => {
 23       'bind-address'    => '0.0.0.0',
 24       'max_connections' => '1024',
 25     }
 26   }
 27 
 28   class { '::mysql::server':
 29     package_name            => 'Percona-Server-server-56',
 30     root_password           => "${percona_root}",
 31     remove_default_accounts => true,
 32     override_options        => $override_options,
 33     require                 => [ Package['percona-release'] ],
 34    }

And here's the output I'm getting.

[root@testing-bidb001 ~]# puppet agent -t       
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for testing-bidb001
Info: Applying configuration version '1427198241'
Notice: /Stage[main]/Profile::Bidb/Package[percona-release]/ensure: created
Notice: /Stage[main]/Mysql::Server::Install/Package[mysql-server]/ensure: created
Notice: /Stage[main]/Mysql::Server::Config/File[/etc/mysql]/ensure: created
Notice: /Stage[main]/Mysql::Server::Config/File[/etc/my.cnf]/ensure: defined content as '{md5}8ef60204b1f3c4d7ffd673f9debc5df1'
Notice: /Stage[main]/Mysql::Server::Config/File[/etc/mysql/conf.d]/ensure: created
Error: Could not start Service[mysqld]: Execution of '/sbin/service mysqld start' returned 1: mysqld: unrecognized service
Wrapped exception:
Execution of '/sbin/service mysqld start' returned 1: mysqld: unrecognized service
Error: /Stage[main]/Mysql::Server::Service/Service[mysqld]/ensure: change from stopped to running failed: Could not start Service[mysqld]: Execution of '/sbin/service mysqld start' returned 1: mysqld: unrecognized service
Error: Could not prefetch mysql_user provider 'mysql': Execution of '/usr/bin/mysql -NBe SELECT CONCAT(User, '@',Host) AS User FROM mysql.user' returned 1: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Notice: /Stage[main]/Mysql::Server::Root_password/Mysql_user[root@localhost]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Root_password/Mysql_user[root@localhost]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Root_password/File[/root/.my.cnf]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Root_password/File[/root/.my.cnf]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server/Anchor[mysql::server::end]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server/Anchor[mysql::server::end]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[@testing-bidb001.useast.fanmanager.com]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[@testing-bidb001.useast.fanmanager.com]: Skipping because of failed dependencies
Error: Could not prefetch mysql_database provider 'mysql': Execution of '/usr/bin/mysql -NBe show databases' returned 1: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_database[test]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_database[test]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[@testing-bidb001]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[@testing-bidb001]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[@%]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[@%]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[ro...@testing-bidb001.useast.fanmanager.com]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[ro...@testing-bidb001.useast.fanmanager.com]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[root@::1]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[root@::1]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[@localhost]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[@localhost]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[ro...@127.0.0.1]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[ro...@127.0.0.1]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[root@testing-bidb001]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[root@testing-bidb001]: Skipping because of failed dependencies
Notice: Finished catalog run in 20.06 seconds


Matt

Elisiano Petrini

unread,
Mar 25, 2015, 8:45:55 PM3/25/15
to puppet...@googlegroups.com
Hi Matt,
    you might need to override also ::mysql::server::service_name. I don't know what's the service name of percona but it looks like that is not 'mysqld':

> Error: Could not start Service[mysqld]: Execution of '/sbin/service mysqld start' returned 1: mysqld: unrecognized service

Best Regards,
    Elisiano Petrini
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[roo...@testing-bidb001.useast.fanmanager.com]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[roo...@testing-bidb001.useast.fanmanager.com]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[root@::1]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[root@::1]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[@localhost]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[@localhost]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[roo...@127.0.0.1]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[roo...@127.0.0.1]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Account_security/Mysql_user[root@testing-bidb001]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Account_security/Mysql_user[root@testing-bidb001]: Skipping because of failed dependencies
Notice: Finished catalog run in 20.06 seconds


Matt

Matt Shields

unread,
Mar 26, 2015, 8:43:22 AM3/26/15
to puppet...@googlegroups.com
I've tried setting the service_name to mysql in the class definition since Percona calls the service mysql instead of mysqld, but I'm still getting errors.  Looks like it's now trying to start Percona/mysql but getting errors.  Here's the puppet output plus the mysql log.


 31   class { '::mysql::server':
 32     package_name            => 'Percona-Server-server-56',
 33     root_password           => "${percona_root}",
 34     #    remove_default_accounts => true,
 35     service_name            => 'mysql',
 36     override_options        => $override_options,
 37     require                 => [ Package['percona-release'] ],
 38   }

Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for bidb001
Info: Applying configuration version '1427372678'
Notice: /Stage[main]/Profile::Bidb/Package[percona-release]/ensure: created
Notice: /Stage[main]/Mysql::Server::Install/Package[mysql-server]/ensure: created
Notice: /Stage[main]/Mysql::Server::Config/File[/etc/mysql]/ensure: created
Notice: /Stage[main]/Mysql::Server::Config/File[/etc/my.cnf]/ensure: defined content as '{md5}b5f7f94eab5170143b230460be142427'
Notice: /Stage[main]/Mysql::Server::Config/File[/etc/mysql/conf.d]/ensure: created
Error: Could not start Service[mysqld]: Execution of '/sbin/service mysql start' returned 1: Starting MySQL (Percona Server).. ERROR! The server quit without updating PID file (/var/run/mysqld.pid).
Wrapped exception:
Execution of '/sbin/service mysql start' returned 1: Starting MySQL (Percona Server).. ERROR! The server quit without updating PID file (/var/run/mysqld.pid).
Error: /Stage[main]/Mysql::Server::Service/Service[mysqld]/ensure: change from stopped to running failed: Could not start Service[mysqld]: Execution of '/sbin/service mysql start' returned 1: Starting MySQL (Percona Server).. ERROR! The server quit without updating PID file (/var/run/mysqld.pid).
Error: Could not prefetch mysql_user provider 'mysql': Execution of '/usr/bin/mysql -NBe SELECT CONCAT(User, '@',Host) AS User FROM mysql.user' returned 1: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
Notice: /Stage[main]/Mysql::Server::Root_password/Mysql_user[root@localhost]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Root_password/Mysql_user[root@localhost]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server::Root_password/File[/root/.my.cnf]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server::Root_password/File[/root/.my.cnf]: Skipping because of failed dependencies
Notice: /Stage[main]/Mysql::Server/Anchor[mysql::server::end]: Dependency Service[mysqld] has failures: true
Warning: /Stage[main]/Mysql::Server/Anchor[mysql::server::end]: Skipping because of failed dependencies
Notice: Finished catalog run in 25.16 seconds

[root@bidb001 ~]# cat /var/log/mysqld.log 
150326 12:31:45 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2015-03-26 12:31:45 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-03-26 12:31:45 21937 [Warning] Using unique option prefix myisam_recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
2015-03-26 12:31:45 21937 [Note] Plugin 'FEDERATED' is disabled.
2015-03-26 12:31:45 21937 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-03-26 12:31:45 21937 [Note] InnoDB: The InnoDB memory heap is disabled
2015-03-26 12:31:45 21937 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-03-26 12:31:45 21937 [Note] InnoDB: Memory barrier is not used
2015-03-26 12:31:45 21937 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-03-26 12:31:45 21937 [Note] InnoDB: Using Linux native AIO
2015-03-26 12:31:45 21937 [Note] InnoDB: Using CPU crc32 instructions
2015-03-26 12:31:45 21937 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-03-26 12:31:45 21937 [Note] InnoDB: Completed initialization of buffer pool
2015-03-26 12:31:45 21937 [Note] InnoDB: Highest supported file format is Barracuda.
2015-03-26 12:31:45 21937 [Note] InnoDB: 128 rollback segment(s) are active.
2015-03-26 12:31:45 21937 [Note] InnoDB: Waiting for purge to start
2015-03-26 12:31:45 21937 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.23-72.1 started; log sequence number 1625987
2015-03-26 12:31:45 21937 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 10f307f6-d3b4-11e4-acac-12c330e0d72c.
2015-03-26 12:31:45 21937 [Warning] Failed to setup SSL
2015-03-26 12:31:45 21937 [Warning] SSL error: SSL_CTX_set_default_verify_paths failed
2015-03-26 12:31:45 21937 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2015-03-26 12:31:45 21937 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2015-03-26 12:31:45 21937 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
2015-03-26 12:31:45 21937 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
2015-03-26 12:31:45 21937 [Note] Server socket created on IP: '0.0.0.0'.
2015-03-26 12:31:45 21937 [ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/run/mysqld.pid' (Errcode: 13 - Permission denied)
2015-03-26 12:31:45 21937 [ERROR] Can't start server: can't create PID file: Permission denied
150326 12:31:46 mysqld_safe mysqld from pid file /var/run/mysqld.pid ended


Matt

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c2574d88-52fa-4b06-97ce-1dec8b468902%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Shields

unread,
Mar 26, 2015, 9:33:30 AM3/26/15
to puppet...@googlegroups.com
Not sure why but it looks like when trying to start Percona, it couldn't create a pid file because there was no /var/run/mysql directory and no permissions set.  I had to manually create the folder and set permissions, now it seems to be working.

 15   package { 'percona-release':
 16     ensure   => present,
 18     provider => rpm,
 19   }
 20 
 21   file { '/var/run/mysql':
 22     ensure => directory,
 23     owner  => 'mysql',
 24     group  => 'mysql',
 25   }
 26   
 27   $override_options = {
 28     'mysqld'            => {
 29       'bind-address'    => '0.0.0.0',
 30       'max_connections' => '1024',
 31       'pid-file'        => '/var/run/mysql/mysqld.pid',
 32       #      'disable-ssl'     => true,
 33     }
 34   } 
 35   
 36   class { '::mysql::server':
 37     package_name            => 'Percona-Server-server-56',
 38     root_password           => "${percona_root}",
 39     #    remove_default_accounts => true,
 40     service_name            => 'mysql',
 41     override_options        => $override_options,
 42     require                 => [ Package['percona-release'] ],
 43   } 

Matt
Reply all
Reply to author
Forward
0 new messages