OpenStack程序员

openstack trove支持mysql5.7

2018-06-15  本文已影响18人  Jon_Wong

最近在做mysql5.7的产品化预研,碰到一点坑,在此说明一下。社区里面merge了一个patch(https://review.openstack.org/#/c/526728/),代码改动量不大,其实改动最大的是mysql本身,所以在制作mysql5.7镜像的时候需要注意很多地方

my.cnf的改动

安全性

$mysql> update user set authentication_string = password(''), password_expired = 'N', password_last_changed = now() where user = 'root';
$mysql>  uninstall plugin validate_password;

备份

trove创建从节点、备份等功能都依赖percona-xtrabackup工具,但是percona-xtrabackup在2.4.8及其以上版本才支持mysql5.7,因此我们需要更新该工具至合适的版本

mysqld_safe

mysql5.7不再安装这个工具,但是trove创建从节点的时候却需要使用这个工具

For some Linux platforms, MySQL installation from RPM or Debian packages includes systemd support for managing MySQL server startup and shutdown.
On these platforms, [**mysqld_safe**](https://dev.mysql.com/doc/refman/5.7/en/mysqld-safe.html "4.3.2 mysqld_safe — MySQL Server Startup Script") is not installed because it is unnecessary. 
For more information, see [Section 2.5.10, “Managing MySQL Server with systemd”](https://dev.mysql.com/doc/refman/5.7/en/using-systemd.html "2.5.10 Managing MySQL Server with systemd").
    def _start_mysqld_safe_with_init_file(self, init_file, err_log_file):
        child = pexpect.spawn("sudo mysqld_safe"
                              " --skip-grant-tables"
                              " --skip-networking"
                              " --init-file='%s'"
                              " --log-error='%s'" %
                              (init_file.name, err_log_file.name)
                              )
上一篇下一篇

猜你喜欢

热点阅读