下文給大家?guī)?lái)有關(guān)MySQL 8.0 InnoDB Cluster出現(xiàn)故障如何解決內(nèi)容,相信大家一定看過類似的文章。我們給大家?guī)?lái)的有何不同呢?一起來(lái)看看正文部分吧,相信看完MySQL 8.0 InnoDB Cluster出現(xiàn)故障如何解決你一定會(huì)有所收獲。
專注于為中小企業(yè)提供成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)金川免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了1000多家企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。
InnoDB Cluster 一節(jié)點(diǎn)丟失
初始化故障節(jié)點(diǎn)
systemctl stop mysqld rm -rf /var/lib/mysql/* systemctl start mysqld
導(dǎo)出正常節(jié)點(diǎn)的數(shù)據(jù)庫(kù),并傳到故障節(jié)點(diǎn)
mysqldump --all-databases --triggers --routines --events --quick --single-transaction --flush-logs --master-data=2 > dbs.dump scp dbs.dump 192.168.1.224:~/
故障節(jié)點(diǎn)導(dǎo)入數(shù)據(jù)庫(kù)
mysql> set sql_log_bin=0; mysql> ALTER USER root@'localhost' IDENTIFIED BY 'MySQL8.0'; mysql> source dbs.dump mysql> set sql_log_bin=1;
重啟故障節(jié)點(diǎn) MySQL
systemctl restart mysqld
將故障節(jié)點(diǎn)重新加入集群
MySQL 192.168.1.226:33060+ ssl JS > var cluster=dba.getCluster('appCluster')
MySQL 192.168.1.226:33060+ ssl JS > cluster.removeInstance('root@192.168.1.224:3306')
MySQL 192.168.1.226:33060+ ssl JS > cluster.addInstance('root@192.168.1.224:3306')集群恢復(fù)正常
MySQL 192.168.1.226:33060+ ssl JS > cluster.status()
{
"clusterName": "appCluster",
"defaultReplicaSet": {
"name": "default",
"primary": "192.168.1.226:3306",
"ssl": "REQUIRED",
"status": "OK",
"statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",
"topology": {
"192.168.1.224:3306": {
"address": "192.168.1.224:3306",
"mode": "R/O",
"readReplicas": {},
"role": "HA",
"status": "ONLINE"
},
"192.168.1.225:3306": {
"address": "192.168.1.225:3306",
"mode": "R/O",
"readReplicas": {},
"role": "HA",
"status": "ONLINE"
},
"192.168.1.226:3306": {
"address": "192.168.1.226:3306",
"mode": "R/W",
"readReplicas": {},
"role": "HA",
"status": "ONLINE"
}
}
},
"groupInformationSourceMember": "mysql://root@192.168.1.226:3306"}
對(duì)于上文關(guān)于MySQL 8.0 InnoDB Cluster出現(xiàn)故障如何解決,大家覺得是自己想要的嗎?如果想要了解更多相關(guān),可以繼續(xù)關(guān)注我們的行業(yè)資訊板塊。
當(dāng)前題目:MySQL8.0InnoDBCluster出現(xiàn)故障如何解決
文章URL:http://www.chinadenli.net/article6/gpcpig.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、網(wǎng)站設(shè)計(jì)公司、網(wǎng)站策劃、手機(jī)網(wǎng)站建設(shè)、網(wǎng)站營(yíng)銷、營(yíng)銷型網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)