mysql主從同步從庫(kù)上Slave_IO_Running:Connecting問(wèn)題

MySQL主從同步從庫(kù)上Slave_IO_Running: Connecting問(wèn)題

成都創(chuàng)新互聯(lián)堅(jiān)持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:網(wǎng)站設(shè)計(jì)制作、網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿(mǎn)足客戶(hù)于互聯(lián)網(wǎng)時(shí)代的梅里斯網(wǎng)站設(shè)計(jì)、移動(dòng)媒體設(shè)計(jì)的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!

一.在做主從同步時(shí)遇到的問(wèn)題

 

數(shù)據(jù)庫(kù)主從問(wèn)題從庫(kù)上Slave_IO_Running: Connecting  

在做mysql主從同步的時(shí)候有時(shí)候發(fā)現(xiàn)在從庫(kù)上Slave_IO_Running: Connecting

mysql主從同步從庫(kù)上Slave_IO_Running: Connecting問(wèn)題 

 

二.解決辦法通常是5個(gè)問(wèn)題:

1.網(wǎng)絡(luò)不通      #互ping機(jī)器ip,無(wú)丟包率正常訪問(wèn),排除

2.密碼不對(duì)      #MySQL重新授權(quán)遠(yuǎn)程用戶(hù)登陸賬號(hào),重新設(shè)置密碼,排除

3.pos不正確     #主服務(wù)器,登陸數(shù)據(jù)庫(kù)重新查看起始偏移量show master status,排除

4.ID問(wèn)題        

#ID的問(wèn)題,在安裝完mysql數(shù)據(jù)庫(kù)的時(shí)候默認(rèn)他們的server-id=1 但是在做主從同步的時(shí)候需要將ID號(hào)碼設(shè)置不一樣才行,查看數(shù)據(jù)庫(kù)配置文件cat  /etc/my.cnf,文件寫(xiě)的不同,排除

5.防火墻策略  

查看防火墻策略,是否放通雙方的服務(wù)端口 iptables -nL,最后發(fā)現(xiàn) 防火墻策略寫(xiě)了多端口防火墻策略的端口不生效,解決防火墻策略單獨(dú)開(kāi)放端口,暫停從服務(wù)的io讀取stop slave;重新在從的數(shù)據(jù)庫(kù)寫(xiě)入以下語(yǔ)句:

mysql> change master to

    -> master_host='192.168.137.36',             

    -> master_user='root',                 

    -> master_password='abc123',

    -> master_port=3307,

    -> master_log_file='mysql-bin.000001',

    -> master_log_pos=848;

Query OK, 0 rows affected, 2 warnings (0.05 sec)

 

mysql> start slave;

Query OK, 0 rows affected (0.02 sec)

 

mysql> show slave status\G

*************************** 1. row ***************************

               Slave_IO_State: Waiting for master to send event

                  Master_Host: 192.168.137.36

                  Master_User: root

                  Master_Port: 3307

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000001

          Read_Master_Log_Pos: 1298

               Relay_Log_File: localhost-relay-bin.000002

                Relay_Log_Pos: 770

        Relay_Master_Log_File: mysql-bin.000001

             Slave_IO_Running: Yes

            Slave_SQL_Running: Yes

              Replicate_Do_DB:

          Replicate_Ignore_DB:

           Replicate_Do_Table:

       Replicate_Ignore_Table:

      Replicate_Wild_Do_Table:

  Replicate_Wild_Ignore_Table:

                   Last_Errno: 0

                   Last_Error:

                 Skip_Counter: 0

          Exec_Master_Log_Pos: 1298

              Relay_Log_Space: 981

              Until_Condition: None

               Until_Log_File:

                Until_Log_Pos: 0

           Master_SSL_Allowed: No

           Master_SSL_CA_File:

           Master_SSL_CA_Path:

              Master_SSL_Cert:

            Master_SSL_Cipher:

               Master_SSL_Key:

        Seconds_Behind_Master: 0

Master_SSL_Verify_Server_Cert: No

                Last_IO_Errno: 0

                Last_IO_Error:

               Last_SQL_Errno: 0

               Last_SQL_Error:

  Replicate_Ignore_Server_Ids:

             Master_Server_Id: 9

                  Master_UUID: ad899234-9c81-11e7-99bd-000c29af2bef

             Master_Info_File: /data/mysql_data1/master.info

                    SQL_Delay: 0

          SQL_Remaining_Delay: NULL

      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates

           Master_Retry_Count: 86400

                  Master_Bind:

      Last_IO_Error_Timestamp:

     Last_SQL_Error_Timestamp:

               Master_SSL_Crl:

           Master_SSL_Crlpath:

           Retrieved_Gtid_Set:

            Executed_Gtid_Set:

                Auto_Position: 0

         Replicate_Rewrite_DB:

                 Channel_Name:

           Master_TLS_Version:

1 row in set (0.00 sec)

注意:標(biāo)注的倆個(gè)紅色yes為正常。

新聞標(biāo)題:mysql主從同步從庫(kù)上Slave_IO_Running:Connecting問(wèn)題
本文來(lái)源:http://muchs.cn/article16/ipjjgg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計(jì)用戶(hù)體驗(yàn)、企業(yè)網(wǎng)站制作、營(yíng)銷(xiāo)型網(wǎng)站建設(shè)、企業(yè)建站定制開(kāi)發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(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)

h5響應(yīng)式網(wǎng)站建設(shè)