example42 / puppet-mysql

Mysql Puppet Module
http://www.example42.com
Other
16 stars 38 forks source link

missing RHEL support #66

Closed tobixen closed 8 years ago

tobixen commented 8 years ago

We're trying to roll out mysql on CentOS7, and there are multiple breakages. Seems like this module only works on Mint, FreeBSD and Ubuntu?

I'll see if I can beat this module into submission on CentOS7. Possibly there will be a pull request from me in the near future.

alvagante commented 8 years ago

Ok thanks, it was developed in RHEL 5 or 6 times and should work there. Fixing for Centos7 COULD be just a matter of fixing some settings in params.pp

tobixen commented 8 years ago

I'm going through it, and it seems like the values in the "default"-section are all good - still my colleague complains he can't get it to roll. Maybe because he's using percona instead of mariadb. Anyway, I'll keep looking. Good to hear it's tested for RHEL6, then probably there is just minor tweaks that are needed to get it rolling under systemd.

tobixen commented 8 years ago

How bizarre. Seems like his problem is all due to a bug in the Percona XtraDB Cluster rpm package. With normal percona and mariadb installed, mysql@ is a link to mysqld and the real service name is mysqld. This is also the default service name in the package, so everything is good.

In the cluster version of Percona, the service name is mysql, and no links from mysqld, so things break.

We've temporary worked around this by setting the service name to mysql in hiera. I believe this is a bug with the rpm and not with the puppet-mysql module.

I'll let you know when we have mysql up and running with the desired configuration and/or if we encounter any other issues.

tobixen commented 8 years ago

Seems like this issue really is a non-issue. Except for the problem with Percona XtraDB Cluster (which can be easily worked around with a simple hiera setting thanks to the good module design) and some other local issues with our own modules, I'm happy to announce that things works smoothly on RHEL7. Well, we haven't done any thorough testing of the module, but for our purposes it seems to work. Closing.

tobixen commented 8 years ago

Sorry to say, I have to reopen this one. I'm now trying to roll out mysql on a "fresh" CentOS7 VM, without specifying server package name and without pulling in any extra repoes ... and it breaks.

So far I've figured:

I hope to complete a pull request during next week.

alvagante commented 8 years ago

Oh, I was forgetting that on RHEL 7 MariadDB is used instead of Mysql. I'd use a mariadb module for that, then. It makes no sense to try to bend this module to manage mariadb. Check also here: https://github.com/example42/puppet-mysql/pull/51

tobixen commented 8 years ago

Oh darn.

I was under the impression that, from a system configuration standpoint, mariadb, percona and oracle mysql was quite similar beasts. In my point of view, mariadb is simply the "mysql flavor that's available out of the box in RHEL7", and all that is needed is to tweak some of the default settings under mysql::params::*.

Anyway, I do suppose you have given it a harder thought since you've already created a separate mariadb module ...

Indeed we're using mostly Percona, so maybe I'm wasting efforts now anyway.

tobixen commented 8 years ago

I've stopped working on this. Done some minor changes to params.pp in my fork to get the right default values to support mariadb on RHEL7 - see https://github.com/tobixen/puppet-mysql, branch feature_rhel7. I sort of believe the only thing missing to get this working is to rename the pidfile, but won't throw more time into this one as for now.

tobixen commented 8 years ago

Got it up and running on centos7 and percona - but for some reason /root/.my.cnf and /root/.my.cnf.backup is saved before it attempts to change the root password of the database

Notice: /Stage[main]/Mysql::Password/Exec[mysql_backup_root_my_cnf]/returns: executed successfully
Notice: /Stage[main]/Mysql::Password/File[/root/.my.cnf]/ensure: created
Info: /Stage[main]/Mysql::Password/File[/root/.my.cnf]: Scheduling refresh of Exec[mysql_root_password]
Notice: /Stage[main]/Mysql::Password/Exec[mysql_root_password]/returns: mysqladmin: connect to server at 'localhost' failed
Notice: /Stage[main]/Mysql::Password/Exec[mysql_root_password]/returns: error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Notice: /Stage[main]/Mysql::Password/Exec[mysql_root_password]/returns: Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
Error: /Stage[main]/Mysql::Password/Exec[mysql_root_password]: Failed to call refresh: mysqladmin --defaults-file=/root/.my.cnf.backup -uroot password 'hunter2' returned 1 instead of one of [0]
Error: /Stage[main]/Mysql::Password/Exec[mysql_root_password]: mysqladmin --defaults-file=/root/.my.cnf.backup -uroot password 'hunter2' returned 1 instead of one of [0]
Notice: Finished catalog run in 38.91 seconds

[root@test-centos7 ~]# mysqladmin ping
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'

[root@test-centos7 ~]# mysqladmin -p ping 
Enter password: 
mysqld is alive
tobixen commented 8 years ago

I'll open up a separate issue for that.