MySQL高可用架构之MySQL5.6 MHA
Posted elontian
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL高可用架构之MySQL5.6 MHA相关的知识,希望对你有一定的参考价值。
[[email protected] ~]#cd /opt/source/
[[email protected] ~]#tar -zxf mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz
[[email protected] ~]#ln -s /opt/source/mysql-5.6.37-linux-glibc2.12-x86_64 /usr/local/mha
[[email protected] ~]#mkdir -p /data/mysql_33051/{data,logs,run,tmp}
[[email protected] ~]#vi /data/mysql_33051/my.cnf
[[email protected] ~]#chown -R mysql.mysql /data/mysql_33051/
[[email protected] ~]#/usr/local/mha/scripts/mysql_install_db --defaults-file=/data/mysql_33051/my.cnf --basedir=/usr/local/mha --datadir=/data/mysql_33051/data --user=mysql #初始化实例,未使用默认位置好的my.cnf,则在初始化的时候需要第一位置指定,否则不能识别
[[email protected] ~]#/usr/local/mha/bin/mysqld_safe --defaults-file=/data/mysql_33051/my.cnf --user=mysql & #启动实例
[[email protected] ~]#ps -ef |grep mysql
root 8964 6737 1 15:57 pts/0 00:00:00 /bin/sh /usr/local/mha/bin/mysqld_safe --defaults-file=/data/mysql_33051/my.cnf --user=mysql
mysql 10435 8964 61 15:57 pts/0 00:00:04 /usr/local/mha/bin/mysqld --defaults-file=/data/mysql_33051/my.cnf --basedir=/usr/local/mysql --datadir=/data/mysql_33051/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysql_33051/logs/mysqlerror.log --open-files-limit=65535 --pid-file=/data/mysql_33051/run/mysqld.pid --socket=/data/mysql_33051/run/mysql.sock --port=33051
以上是关于MySQL高可用架构之MySQL5.6 MHA的主要内容,如果未能解决你的问题,请参考以下文章