标签:ica 复制 png pre yum http 配置 oca ORC
注意:如果主mysql已经跑了一段时间,需要用备份软件把数据备份恢复到从服务器上去,确保主从服务器数据一致,否则可能报错,而且mysql 只有5.6 以后才支持gtid,安装时确保你的软件支持gpid[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
basedir=/usr/local/mysql
user=mysql
port=3306
server-id=1
gtid-mode=ON
enforce-gtid-consistency=ON
binlog_format=row
log-bin=log-bin
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
我都是用的rpm默认路径,实际安装自己需求该路径
3.编辑从文件
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
basedir=/usr/local/mysql
user=mysql
port=3306
server-id=2
gtid-mode=ON
enforce-gtid-consistency=ON
binlog_format=ROW
log-bin=log-bin
log_slave_updates=ON
skip-slave-start=1
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
4.创建具有复制权限的账号,在主的上面创建grant replication slave on *.* to ‘rep‘@‘192.168.%.%‘ identified by ‘123456‘;
5.从服务器配置连接
进入mysql配置change master to master_host=‘192.168.1.32‘, master_user=‘rep‘,master_password=‘123456‘,master_port=3306,master_auto_position=1;
6.启动同步,查看
start slave;#启动
show slave status;
这里两个yes 说明同步成功了
标签:ica 复制 png pre yum http 配置 oca ORC
原文地址:https://blog.51cto.com/13620944/2436620