麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 數(shù)據(jù)庫 > 文庫 > 正文

數(shù)據(jù)庫集群的主從復(fù)制模型完整達(dá)成

2024-09-07 22:12:58
字體:
供稿:網(wǎng)友
  主從配置過程:
  參看:
      https://mariadb.com/kb/en/library/setting-up-replication/
      https://dev.mysql.com/doc/refman/5.5/en/replication-configuration.html
  主服務(wù)器192.168.27.7配置:
 
  [root@master ~]$vim /etc/my.cnf
  [mysqld]
  datadir=/var/lib/mysql
  socket=/var/lib/mysql/mysql.sock
  # Disabling symbolic-links is recommended to prevent assorted security risks
  symbolic-links=0
  innodb_file_per_table
  log_bin
  server-id=1
 
  MariaDB [(none)]> grant replication slave on *.* to repluser@'192.168.27.%' identified by 'centos';
  Query OK, 0 rows affected (0.00 sec)
  從服務(wù)器192.168.27.17服務(wù)配置:
 
  從服務(wù)器上的配置:
  [mysqld]
  datadir=/var/lib/mysql
  socket=/var/lib/mysql/mysql.sock
  # Disabling symbolic-links is recommended to prevent assorted security risks
  symbolic-links=0
  # Settings user and group are ignored when systemd is used.
  innodb_file_per_table
  server_id=2
 
  注意:默認(rèn)的server_id是0;
  MariaDB [(none)]> show variables like 'server_id';
  +---------------+-------+
  | Variable_name | Value |
  +---------------+-------+
  | server_id     | 0     |
  +---------------+-------+
  1 row in set (0.01 sec)
 
 
  查看幫助:
  MariaDB [(none)]> help change master to;
  CHANGE MASTER TO
    MASTER_HOST='master2.mycompany.com',
    MASTER_USER='replication',
    MASTER_PASSWORD='bigs3cret',
    MASTER_PORT=3306,
    MASTER_LOG_FILE='master2-bin.001',
    MASTER_LOG_POS=4,
    MASTER_CONNECT_RETRY=10;
 
 
  MariaDB [(none)]> CHANGE MASTER TO
      ->   MASTER_HOST='192.168.27.7',
      ->   MASTER_USER='repluser',
      ->   MASTER_PASSWORD='centos',
      ->   MASTER_PORT=3306,
      ->   MASTER_LOG_FILE='mariadb-bin.000001',
      ->   MASTER_LOG_POS=245,
      ->   MASTER_CONNECT_RETRY=10;
  Query OK, 0 rows affected (0.02 sec)
 
 
 
 
  MariaDB [(none)]> show slave status/G
  *************************** 1. row ***************************
                 Slave_IO_State:
                    Master_Host: 192.168.27.7
                    Master_User: repluser
                    Master_Port: 3306
                  Connect_Retry: 10
                Master_Log_File: mariadb-bin.000001
            Read_Master_Log_Pos: 245
                 Relay_Log_File: mariadb-relay-bin.000001
                  Relay_Log_Pos: 4
          Relay_Master_Log_File: mariadb-bin.000001
               Slave_IO_Running: No     線程未啟動(dòng);
              Slave_SQL_Running: No     線程未啟動(dòng);
                Replicate_Do_DB:
            Replicate_Ignore_DB:
             Replicate_Do_Table:
         Replicate_Ignore_Table:
        Replicate_Wild_Do_Table:
    Replicate_Wild_Ignore_Table:
 
  MariaDB [(none)]> show slave status/G
  *************************** 1. row ***************************
                 Slave_IO_State: Waiting for master to send event
                    Master_Host: 192.168.27.7
                    Master_User: repluser
                    Master_Port: 3306
                  Connect_Retry: 60
                Master_Log_File: mariadb-bin.000002
            Read_Master_Log_Pos: 245     讀取的日志的位置;
                 Relay_Log_File: mariadb-relay-bin.000005
                  Relay_Log_Pos: 531
          Relay_Master_Log_File: mariadb-bin.000002
               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: 245  執(zhí)行的日志的位置;
                Relay_Log_Space: 1113
                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     落后的時(shí)間差;
  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: 1
  1 row in set (0.00 sec)

(編輯:武林網(wǎng))

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 私库av在线免费观看 | 欧美性生交xxxxx久久久 | 新久草在线视频 | 中文字幕亚洲情99在线 | 欧美一级理论 | 久久av免费 | www.777含羞草 | 亚洲第一成人在线视频 | 国产精品一区在线观看 | 羞羞视频免费网站入口 | 国产精品视频免费在线观看 | 污片视频网站 | 国产一区二区三区四区五区在线 | 97久久人人超碰caoprom | 九色新网址 | 超碰一区 | 国产精品一区久久久久 | 欧美女人天堂 | 亚洲欧美日韩中文在线 | 久久久久久久久久美女 | 色交视频| 萌白酱福利视频在线网站 | 日本在线免费观看 | 国产精品福利一区 | 国产91一区二区三区 | 69性欧美高清影院 | 国产乱淫a∨片免费观看 | 日本成人在线播放 | 亚洲最新黄色网址 | 黄色片快播| 国产精品啪一品二区三区粉嫩 | 精品国产精品久久 | 国产精品视频一区二区噜噜 | 免费网站看毛片 | 中文字幕在线视频日本 | 国产色91| 久久99精品国产99久久6男男 | 国产一及毛片 | 亚洲成人高清电影 | 网站激情 | 毛片视频免费观看 |