<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當(dāng)前位置: 首頁 - 科技 - 知識百科 - 正文

        Mysql主從復(fù)制,單臺服務(wù)器上實施

        來源:懂視網(wǎng) 責(zé)編:小采 時間:2020-11-09 13:09:57
        文檔

        Mysql主從復(fù)制,單臺服務(wù)器上實施

        Mysql主從復(fù)制,單臺服務(wù)器上實施:原文鏈接:http://blog.csdn.net/songxixi/article/details/8737555 現(xiàn)在公司向在一臺服務(wù)器上做主從復(fù)制,現(xiàn)在了解到的是需要安裝多個mysql不同的服務(wù),才可以,我現(xiàn)在 在現(xiàn)有單實例數(shù)據(jù)庫下,分了不同的端口以下所示紅色部分;[root@mysql ~
        推薦度:
        導(dǎo)讀Mysql主從復(fù)制,單臺服務(wù)器上實施:原文鏈接:http://blog.csdn.net/songxixi/article/details/8737555 現(xiàn)在公司向在一臺服務(wù)器上做主從復(fù)制,現(xiàn)在了解到的是需要安裝多個mysql不同的服務(wù),才可以,我現(xiàn)在 在現(xiàn)有單實例數(shù)據(jù)庫下,分了不同的端口以下所示紅色部分;[root@mysql ~

        原文鏈接:?http://blog.csdn.net/songxixi/article/details/8737555 現(xiàn)在公司向在一臺服務(wù)器上做主從復(fù)制,現(xiàn)在了解到的是需要安裝多個mysql不同的服務(wù),才可以,我現(xiàn)在 在現(xiàn)有單實例數(shù)據(jù)庫下,分了不同的端口以下所示紅色部分;[root@mysql ~]# netstat -t

        原文鏈接:?http://blog.csdn.net/songxixi/article/details/8737555

        現(xiàn)在公司向在一臺服務(wù)器上做主從復(fù)制,現(xiàn)在了解到的是需要安裝多個mysql不同的服務(wù),才可以,我現(xiàn)在 在現(xiàn)有單實例數(shù)據(jù)庫下,分了不同的端口以下所示紅色部分;
        [root@mysql ~]# netstat -tunlp
        Active Internet connections (only servers)
        Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name 
        tcp 0 0 0.0.0.0:1001 0.0.0.0:* LISTEN 2515/rpc.statd 
        tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2483/portmap 
        tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2750/cupsd 
        tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3056/sendmail: acce 
        tcp 0 0 :::3306 :::* LISTEN 4025/mysqld 
        tcp 0 0 :::3307 :::* LISTEN 17423/mysqld 
        tcp 0 0 :::3308 :::* LISTEN 17388/mysqld 
        tcp 0 0 :::3309 :::* LISTEN 20371/mysqld 
        tcp 0 0 :::22 :::* LISTEN 2741/sshd 
        udp 0 0 0.0.0.0:995 0.0.0.0:* 2515/rpc.statd 
        udp 0 0 0.0.0.0:998 0.0.0.0:* 2515/rpc.statd 
        udp 0 0 0.0.0.0:42601 0.0.0.0:* 3204/avahi-daemon: 
        udp 0 0 0.0.0.0:5353 0.0.0.0:* 3204/avahi-daemon: 
        udp 0 0 0.0.0.0:111 0.0.0.0:* 2483/portmap 
        udp 0 0 0.0.0.0:631 0.0.0.0:* 2750/cupsd 
        udp 0 0 :::5353 :::* 3204/avahi-daemon: 
        udp 0 0 :::59254 :::* 3204/avahi-daemon: 
        [root@mysql mysql]# mysqld_multi --defaults-extra-file=/etc/mysqld_multi.cnf report
        Reporting MySQL servers
        MySQL server from group: mysqld2 is running
        MySQL server from group: mysqld3 is running
        MySQL server from group: mysqld4 is running
        [root@mysql mysql]# lsof -i:3308
        COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
        mysqld 17388 mysql 11u IPv6 45429 TCP *:tns-server (LISTEN)
        [root@mysql mysql]# lsof -i:3307
        COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
        mysqld 17423 mysql 11u IPv6 45479 TCP *psession-prxy (LISTEN)
        [root@mysql mysql]# lsof -i:3309
        COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
        mysqld 20371 mysql 11u IPv6 47851 TCP *:tns-adv (LISTEN)
        [root@mysql mysql]# lsof -i:3306
        COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
        mysqld 4025 mysql 11u IPv6 16575 TCP *:mysql (LISTEN)
        [root@mysql mysql]#
        [root@mysql ~]# 
        在以上服務(wù)都啟動正常的情況下,配置主從,我沒有調(diào)整IO的線程,不知道在不同端口見做主從復(fù)制關(guān)系,以下是我配置最后遇到的錯誤,請綠林好漢幫忙看看啊,拍磚。。
        mysql> show slave status\G;
        *************************** 1. row ***************************
         Slave_IO_State: 
         Master_Host: 192.168.1.10
         Master_User: slave001
         Master_Port: 3308
         Connect_Retry: 60
         Master_Log_File: mysql-bin.000003
         Read_Master_Log_Pos: 1027
         Relay_Log_File: localhost3308-relay-bin.000001
         Relay_Log_Pos: 4
         Relay_Master_Log_File: mysql-bin.000003
         Slave_IO_Running: No
         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: 1027
         Relay_Log_Space: 107
         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: NULL
        Master_SSL_Verify_Server_Cert: No
         Last_IO_Errno: 1593
         Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
         Last_SQL_Errno: 0
         Last_SQL_Error: 
         Replicate_Ignore_Server_Ids: 
         Master_Server_Id: 1
        1 row in set (0.00 sec)
        ERROR: 
        No query specified
        mysql>
        我在mysqld_multi.cnf里面添加了以下紅色的,復(fù)制內(nèi)容啟動還是報錯,請指點哇
        [mysqld_multi]
        mysqld = /usr/local/mysql/bin/mysqld_safe
        mysqladmin = /usr/local/mysql/bin/mysqladmin
        user = multi_admin
        password = my_password
        [mysqld2]
        socket = /tmp/mysql3307.sock
        port = 3307
        pid-file = /usr/local/mysql/data3307/localhost3307.pid
        datadir = /usr/local/mysql/data3307
        #language = /usr/local/mysql/share/mysql/english
        user = mysql
        [mysqld3]
        #mysqld = /path/to/mysqld_safe
        #ledir = /path/to/mysqld-binary/
        #mysqladmin = /path/to/mysqladmin
        socket = /tmp/mysql3308.sock
        port = 3308
        pid-file = /usr/local/mysql/data3308/localhost3308.pid
        datadir = /usr/local/mysql/data3308
        #language = /usr/local/mysql/share/mysql/swedish
        user = mysql
        master-host = 192.168.1.10
        master-user = slave001
        master-password = slave001
        master-port = 3306
        replicate-do-db=test
        錯誤:
        mysql> show slave status\G;
        *************************** 1. row ***************************
         Slave_IO_State: 
         Master_Host: 192.168.1.10
         Master_User: slave001
         Master_Port: 3306
         Connect_Retry: 60
         Master_Log_File: mysql-bin.000018
         Read_Master_Log_Pos: 107
         Relay_Log_File: localhost3308-relay-bin.000001
         Relay_Log_Pos: 4
         Relay_Master_Log_File: mysql-bin.000018
         Slave_IO_Running: No
         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: 107
         Relay_Log_Space: 107
         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: NULL
        Master_SSL_Verify_Server_Cert: No
         Last_IO_Errno: 1593
         Last_IO_Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
         Last_SQL_Errno: 0
         Last_SQL_Error: 
         Replicate_Ignore_Server_Ids: 
         Master_Server_Id: 1
        1 row in set (0.00 sec)
        哎,經(jīng)過幾個小時的琢磨,終于看到廬山真面目了!以下是成功啟動的效果;
        [root@mysql ~]# mysqld_multi --defaults-extra-file=/etc/my.cnf report
        Reporting MySQL servers
        MySQL server from group: mysqld1 is running
        MySQL server from group: mysqld2 is running
        MySQL server from group: mysqld3 is running
        MySQL server from group: mysqld4 is running
        [root@mysql ~]# mysqld_multi --defaults-extra-file=/etc/my.cnf report
        Reporting MySQL servers
        MySQL server from group: mysqld1 is running
        MySQL server from group: mysqld2 is running
        MySQL server from group: mysqld3 is running
        MySQL server from group: mysqld4 is running
        [root@mysql ~]# mysqld_multi --defaults-extra-file=/etc/my.cnf report
        Reporting MySQL servers
        MySQL server from group: mysqld1 is running
        MySQL server from group: mysqld2 is running
        MySQL server from group: mysqld3 is running
        MySQL server from group: mysqld4 is running
        [root@mysql ~]# mysqld_multi --defaults-extra-file=/etc/my.cnf report
        Reporting MySQL servers
        MySQL server from group: mysqld1 is running
        MySQL server from group: mysqld2 is running
        MySQL server from group: mysqld3 is running
        MySQL server from group: mysqld4 is running
        [root@mysql ~]#
        其實,在我配置muti的時候有些參數(shù)沒有做好設(shè)置,到時server-id服務(wù)啟動不起來,我把所有的muti的mysqld【1-4】全部放到我們的配置文件內(nèi)/etc/my.cnf,包括我們的3306端口的實例庫,在啟動的時候一起跑即可!以下是我my.cnf的配置文件信心,請查閱;
        # The following options will be passed to all MySQL clients
        [mysqld_multi]
        mysqld = /usr/local/mysql/bin/mysqld_safe
        mysqladmin = /usr/local/mysql/bin/mysqladmin
        user = root
        # Here follows entries for some specific programs
        # The MySQL server
        [mysqld1]
        datadir=/usr/local/mysql/data
        socket=/tmp/mysql.sock
        user=mysql
        old_passwords=1
        port=3306
        skip-name-resolve
        server_id=1
        log-bin=mysql-bin
        max_connections=1000
        key_buffer_size=218348
        query_cache_size=10
        read_rnd_buffer_size=134228
        table_cache=10000
        tmp_table_size=5362
        log-slow-queries=slow.log
        long_query_time=1
        concurrent_insert=2
        thread_cache_size=300
        #log=/usr/local/mysql/data/mysql1.log
        pid-file=/usr/local/mysql/data/mysql1.pid
        log-error=/usr/local/mysql/data/log.1
        log-slave-updates
        slave-skip-errors=ALL
        [mysqld2]
        datadir=/usr/local/mysql/data3307
        socket=/tmp/mysql3307.sock
        user=mysql
        old_passwords=1
        skip-name-resolve
        server_id=222
        log-bin=mysql-bin
        max_connections=1000
        key_buffer_size=218348
        query_cache_type=0
        read_rnd_buffer_size=1342128
        table_cache=10000
        tmp_table_size=5368912
        log-slow-queries=slow.log
        long_query_time=1
        concurrent_insert=2
        thread_cache_size=300
        port=3307
        pid-file=/usr/local/mysql/data3307/localhost3307.pid
        log-error=/usr/local/mysql/data3307/log.2
        [mysqld3]
        datadir=/usr/local/mysql/data3308
        socket=/tmp/mysql3308.sock
        user=mysql
        old_passwords=1
        skip-name-resolve
        server_id=223
        log-bin=mysql-bin
        max_connections=1000
        key_buffer_size=218348
        query_cache_type=0
        read_rnd_buffer_size=1342128
        table_cache=10000
        tmp_table_size=5368912
        log-slow-queries=slow.log
        long_query_time=1
        concurrent_insert=2
        thread_cache_size=300
        port=3308
        pid-file=/usr/local/mysql/data3308/localhost3308.pid
        log-error=/usr/local/mysql/data3308/log.3
        [mysqld4]
        datadir=/usr/local/mysql/data3309
        socket=/tmp/mysql3309.sock
        user=mysql
        old_passwords=1
        skip-name-resolve
        server_id=224
        log-bin=mysql-bin
        max_connections=1000
        key_buffer_size=218348
        query_cache_type=0
        read_rnd_buffer_size=1342128
        table_cache=10000
        tmp_table_size=5368912
        log-slow-queries=slow.log
        long_query_time=1
        concurrent_insert=2
        thread_cache_size=300
        port=3309
        pid-file=/usr/local/mysql/data3309/localhost3309.pid
        log-error=/usr/local/mysql/data3309/log.4
        

        聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        Mysql主從復(fù)制,單臺服務(wù)器上實施

        Mysql主從復(fù)制,單臺服務(wù)器上實施:原文鏈接:http://blog.csdn.net/songxixi/article/details/8737555 現(xiàn)在公司向在一臺服務(wù)器上做主從復(fù)制,現(xiàn)在了解到的是需要安裝多個mysql不同的服務(wù),才可以,我現(xiàn)在 在現(xiàn)有單實例數(shù)據(jù)庫下,分了不同的端口以下所示紅色部分;[root@mysql ~
        推薦度:
        標(biāo)簽: 復(fù)制 鏈接 服務(wù)
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 亚洲熟伦熟女新五十路熟妇| 亚洲色图综合在线| 亚洲精品无码专区久久久| 亚洲国产成人精品无码区二本| 久久久久久亚洲AV无码专区| 久久亚洲中文字幕精品有坂深雪 | 亚洲gv白嫩小受在线观看| 亚洲AV无码一区二区乱孑伦AS| 久久精品亚洲日本波多野结衣 | 中文字幕av无码无卡免费| 九九九精品成人免费视频| 国产免费小视频在线观看| 亚洲精品WWW久久久久久| 亚洲Av永久无码精品一区二区| 最近最好的中文字幕2019免费| 国产亚洲AV手机在线观看| 一级毛片在线免费播放| 自拍偷自拍亚洲精品第1页| 一级一看免费完整版毛片| 亚洲性在线看高清h片| 中文字幕av无码不卡免费| 久久这里只有精品国产免费10| 亚洲制服丝袜在线播放| 免费不卡视频一卡二卡| 亚洲综合在线一区二区三区| 国产成人精品免费直播| 久久久久亚洲精品无码系列| 黄网站免费在线观看| 亚洲色图黄色小说| 日本一区二区三区免费高清在线| 国产成人精品免费直播| 国产精品hd免费观看| 亚洲av无码成人黄网站在线观看 | 无码一区二区三区亚洲人妻| 波多野结衣免费视频观看| v片免费在线观看| 国产精品亚洲а∨无码播放| 最近免费中文字幕中文高清| 在线a人片天堂免费观看高清| 久久国产成人亚洲精品影院| 国产免费爽爽视频在线观看|