<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                #### 開啟MySQL復制 所有數據庫建立復制賬戶 >MHA需求,因為切換主庫后,其他從庫會作為主庫,這樣就不用單獨再創建賬戶了、 ```shell CREATE USER 'repl'@'192.168.%' IDENTIFIED BY 'repl'; GRANT REPLICATION SLAVE ON *.* TO 'repl'@'192.168.%'; ``` 修改配置文件 ```shell master_info_repository = TABLE relay_log_info_repository = TABLE sync_binlog = 1 log-slave-updates = 1 log-bin=mysql-bin binlog_format = ROW server-id=168001230 ``` 注釋: ```shell #Master信息存儲在表里 master_info_repository = TABLE #Relaylog信息存儲在表里 relay_log_info_repository = TABLE #所有事務提交錢,寫入binlog sync_binlog = 1 #角色是從庫時,產生binlog,級聯復制用 log-slave-updates = 1 #binlog日志開關及名稱 log-bin=mysql-bin #binlog格式 binlog_format = ROW #Server-id,保持唯一,建議IP地址 server-id=168001230 ``` #### 配置MySQL復制 ##### 查看MySQL主庫Position情況 ```shell show master status\G ``` 主庫執行 ```shell [root@localhost][(none)]> show master status; +------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +------------------+----------+--------------+------------------+-------------------+ | mysql-bin.000002 | 323 | | | | +------------------+----------+--------------+------------------+-------------------+ ``` ##### 從庫創建同步配置 從庫執行 ```shell CHANGE MASTER TO MASTER_HOST='192.168.0.230', MASTER_USER='repl', MASTER_PASSWORD='repl', MASTER_LOG_FILE='mysql-bin.000002', MASTER_LOG_POS=323; ``` 出現兩個warning ```shell | Note | 1759 | Sending passwords in plain text without SSL/TLS is extremely insecure. | | Note | 1760 | Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. | ``` 建議SSL和 start slave 時指定用戶名密碼,不將密碼保存在主庫 從庫執行 ```shell change master to master_host='192.168.0.230',,master_log_file='mysql-bin.000002',master_log_pos=323; ``` 啟動復制進程 ```shell start slave user='repl' password='repl'; show slave status\G; ``` ##### 測試主庫寫入 ##### 主庫查看狀態 出現Binlog Dump 線程 ```shell [root@localhost][(none)]> show processlist; +----+------+---------------------+------+-------------+------+---------------------------------------------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+---------------------+------+-------------+------+---------------------------------------------------------------+------------------+ | 6 | repl | 192.168.0.236:10745 | NULL | Binlog Dump | 5014 | Master has sent all binlog to slave; waiting for more updates | NULL | | 8 | repl | 192.168.0.235:1619 | NULL | Binlog Dump | 101 | Master has sent all binlog to slave; waiting for more updates | NULL | ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看