下面講講關(guān)于搭建MySQL5.7的多源復(fù)制方法,文字的奧妙在于貼近主題相關(guān)。所以,閑話就不談了,我們直接看下文吧,相信看完搭建MySQL5.7的多源復(fù)制方法這篇文章你一定會有所受益。
發(fā)展壯大離不開廣大客戶長期以來的信賴與支持,我們將始終秉承“誠信為本、服務(wù)至上”的服務(wù)理念,堅(jiān)持“二合一”的優(yōu)良服務(wù)模式,真誠服務(wù)每家企業(yè),認(rèn)真做好每個細(xì)節(jié),不斷完善自我,成就企業(yè),實(shí)現(xiàn)共贏。行業(yè)涉及成都高空作業(yè)車租賃等,在成都網(wǎng)站建設(shè)、全網(wǎng)整合營銷推廣、WAP手機(jī)網(wǎng)站、VI設(shè)計(jì)、軟件開發(fā)等項(xiàng)目上具有豐富的設(shè)計(jì)經(jīng)驗(yàn)。
MySQL5.7多源復(fù)制的實(shí)驗(yàn)
環(huán)境:
node1: 192.168.2.171 主庫1
node3: 192.168.2.170 主庫2
node2: 192.168.2.172 歸檔用的從庫
1、node2上需要配置復(fù)制過濾掉mysql庫:
replicate_wild_ignore_table=mysql.%
replicate_wild_ignore_table=test.%
### 5.7上可以直接使用 stop slave; CHANGE REPLICATION FILTER REPLICATE_WILD_IGNORE_TABLE = ('mysql.%','test.%'); start salve;動態(tài)修改復(fù)制過濾庫。
2、先將node1、node3上的備份mysqldump -uxx -pxx -q --single-transaction --master-data=2 導(dǎo)入到node2上。
3、在node2上配置主從復(fù)制
node2上執(zhí)行:
change master to
master_host='192.168.2.171',
master_user='rpl',
master_password='rpl',
master_port=3306,
master_log_file='mysql-bin.000001',
master_log_pos=4 for channel 'master-1';
change master to
master_host='192.168.2.170',
master_user='rpl',
master_password='rpl',
master_port=3306,
master_log_file='mysql-bin.000001',
master_log_pos=12 for channel 'master-2';
啟動復(fù)制:
start slave for channel 'master-1';
start slave for channel 'master-2';
查看狀態(tài):
show slave status for channel 'master-1'\G
show slave status for channel 'master-2'\G
停止:
stop slave for channel 'master-1';
stop slave for channel 'master-2';
清空同步信息和日志:
reset slave for channel 'master-1';
reset slave for channel 'master-2';
刷下relaylog:
flush relay logs for channel 'master-1';
flush relay logs for channel 'master-2';
對于以上搭建MySQL5.7的多源復(fù)制方法相關(guān)內(nèi)容,大家還有什么不明白的地方嗎?或者想要了解更多相關(guān),可以繼續(xù)關(guān)注我們的行業(yè)資訊板塊。
本文名稱:搭建MySQL5.7的多源復(fù)制方法
URL標(biāo)題:http://www.rwnh.cn/article32/gjhpsc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供自適應(yīng)網(wǎng)站、電子商務(wù)、動態(tài)網(wǎng)站、網(wǎng)站內(nèi)鏈、建站公司、網(wǎng)頁設(shè)計(jì)公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)