<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關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題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關鍵字專題關鍵字專題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
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        MySQL-group-replication配置步驟(推薦)

        來源:懂視網 責編:小采 時間:2020-11-09 20:36:13
        文檔

        MySQL-group-replication配置步驟(推薦)

        MySQL-group-replication配置步驟(推薦):MySQL-Group-Replication 是mysql-5.7.17版本開發出來的新特性;它在master-slave 之間實現了強一致性, 但是就目前來說主要是性能不太好。 【1】確定當前的mysql數據庫版本為5.7.17及以上 /usr/local/mysql/bin/mysqld --
        推薦度:
        導讀MySQL-group-replication配置步驟(推薦):MySQL-Group-Replication 是mysql-5.7.17版本開發出來的新特性;它在master-slave 之間實現了強一致性, 但是就目前來說主要是性能不太好。 【1】確定當前的mysql數據庫版本為5.7.17及以上 /usr/local/mysql/bin/mysqld --

        MySQL-Group-Replication 是mysql-5.7.17版本開發出來的新特性;它在master-slave 之間實現了強一致性,

        但是就目前來說主要是性能不太好。

        【1】確定當前的mysql數據庫版本為5.7.17及以上

        /usr/local/mysql/bin/mysqld --version
        /usr/local/mysql/bin/mysqld Ver 5.7.17 for linux-glibc2.5 on x86_64 (MySQL Community Server (GPL))

        【2】實驗環境為一臺主機上安裝3臺mysql,它們三個組成一個group-replication 組

        /tmp/4406.cnf 內容如下:

        [mysqld]
        ####: for global
        user =jianglexing # mysql
        basedir =/usr/local/mysql # /usr/local/mysql/
        datadir =/tmp/4406/ # /usr/local/mysql/data
        server_id =4406 # 0
        port =4406 # 3306
        socket =/tmp/4406/mysql.sock # /tmp/mysql.sock
        auto_increment_increment =1 # 1
        auto_increment_offset =1 # 1
        lower_case_table_names =1 # 0
        secure_file_priv = # null
        
        
        ####: for binlog
        binlog_format =row # row
        log_bin =mysql-bin # off
        binlog_rows_query_log_events =on # off
        log_slave_updates =on # off
        expire_logs_days =4 # 0
        binlog_cache_size =32768 # 32768(32k)
        binlog_checksum =none # CRC32
        sync_binlog =1 # 1
        
        
        ####: for error-log
        log_error =mysql-err.log # /usr/local/mysql/data/localhost.localdomain.err
        
        
        ####: for slow query log
        
        
        ####: for gtid
        gtid_mode =on # off
        enforce_gtid_consistency =on # off
        
        
        ####: for replication
        master_info_repository =table # file
        relay_log_info_repository =table # file
        
        
        ####: for group replication
        transaction_write_set_extraction =XXHASH64 # off
        loose-group_replication_group_name ="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" # 
        loose-group_replication_start_on_boot =off # off
        loose-group_replication_local_address ="127.0.0.1:24901" #
        loose-group_replication_group_seeds ="127.0.0.1:24901,127.0.0.1:24902,127.0.0.1:24903"
        loose-group_replication_bootstrap_group =off # off
        
        
        ####: for innodb
        default_storage_engine =innodb # innodb
        default_tmp_storage_engine =innodb # innodb
        innodb_data_file_path =ibdata1:12M:autoextend # ibdata1:12M:autoextend
        innodb_temp_data_file_path =ibtmp1:12M:autoextend # ibtmp1:12M:autoextend
        innodb_log_group_home_dir =./ # ./
        innodb_log_files_in_group =2 # 2
        innodb_log_file_size =48M # 50331648(48M)
        innodb_file_format =Barracuda # Barracuda
        innodb_file_per_table =on # on
        innodb_page_size =16k # 16384(16k)
        innodb_thread_concurrency =0 # 0
        innodb_read_io_threads =4 # 4
        innodb_write_io_threads =4 # 4
        innodb_purge_threads =4 # 4
        innodb_print_all_deadlocks =on # off
        innodb_deadlock_detect =on # on
        innodb_lock_wait_timeout =50 # 50
        innodb_spin_wait_delay =6 # 6
        innodb_autoinc_lock_mode =2 # 1
        innodb_stats_persistent =on # on
        innodb_stats_persistent_sample_pages =20 # 20
        innodb_adaptive_hash_index =on # on
        innodb_change_buffering =all # all
        innodb_change_buffer_max_size =25 # 25
        innodb_flush_neighbors =1 # 1
        innodb_flush_method =O_DIRECT # 
        innodb_doublewrite =on # on
        innodb_log_buffer_size =16M # 16777216(16M)
        innodb_flush_log_at_timeout =1 # 1
        innodb_flush_log_at_trx_commit =1 # 1
        autocommit =1 # 1
        
        [client]
        auto-rehash

        /tmp/5506.cnf 內容如下:

        [mysqld]
        ####: for global
        user =jianglexing # mysql
        basedir =/usr/local/mysql # /usr/local/mysql/
        datadir =/tmp/5506 # /usr/local/mysql/data
        server_id =5506 # 0
        port =5506 # 3306
        socket =/tmp/5506/mysql.sock # /tmp/mysql.sock
        auto_increment_increment =1 # 1
        auto_increment_offset =1 # 1
        lower_case_table_names =1 # 0
        secure_file_priv = # null
        
        
        ####: for binlog
        binlog_format =row # row
        log_bin =mysql-bin # off
        binlog_rows_query_log_events =on # off
        log_slave_updates =on # off
        expire_logs_days =4 # 0
        binlog_cache_size =32768 # 32768(32k)
        binlog_checksum =none # CRC32
        sync_binlog =1 # 1
        
        
        ####: for error-log
        log_error =mysql-err.log # /usr/local/mysql/data/localhost.localdomain.err
        
        
        ####: for slow query log
        
        
        ####: for gtid
        gtid_mode =on # off
        enforce_gtid_consistency =on # off
        
        
        ####: for replication
        master_info_repository =table # file
        relay_log_info_repository =table # file
        
        
        ####: for group replication
        transaction_write_set_extraction =XXHASH64 # off
        loose-group_replication_group_name ="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" # 
        loose-group_replication_start_on_boot =off # off
        loose-group_replication_local_address ="127.0.0.1:24902" #
        loose-group_replication_group_seeds ="127.0.0.1:24901,127.0.0.1:24902,127.0.0.1:24903"
        loose-group_replication_bootstrap_group =off # off
        
        
        ####: for innodb
        default_storage_engine =innodb # innodb
        default_tmp_storage_engine =innodb # innodb
        innodb_data_file_path =ibdata1:12M:autoextend # ibdata1:12M:autoextend
        innodb_temp_data_file_path =ibtmp1:12M:autoextend # ibtmp1:12M:autoextend
        innodb_log_group_home_dir =./ # ./
        innodb_log_files_in_group =2 # 2
        innodb_log_file_size =48M # 50331648(48M)
        innodb_file_format =Barracuda # Barracuda
        innodb_file_per_table =on # on
        innodb_page_size =16k # 16384(16k)
        innodb_thread_concurrency =0 # 0
        innodb_read_io_threads =4 # 4
        innodb_write_io_threads =4 # 4
        innodb_purge_threads =4 # 4
        innodb_print_all_deadlocks =on # off
        innodb_deadlock_detect =on # on
        innodb_lock_wait_timeout =50 # 50
        innodb_spin_wait_delay =6 # 6
        innodb_autoinc_lock_mode =2 # 1
        innodb_stats_persistent =on # on
        innodb_stats_persistent_sample_pages =20 # 20
        innodb_adaptive_hash_index =on # on
        innodb_change_buffering =all # all
        innodb_change_buffer_max_size =25 # 25
        innodb_flush_neighbors =1 # 1
        innodb_flush_method =O_DIRECT # 
        innodb_doublewrite =on # on
        innodb_log_buffer_size =16M # 16777216(16M)
        innodb_flush_log_at_timeout =1 # 1
        innodb_flush_log_at_trx_commit =1 # 1
        autocommit =1 # 1

         /tmp/6606.cnf 內容如下:

        [mysqld]
        ####: for global
        user =jianglexing # mysql
        basedir =/usr/local/mysql # /usr/local/mysql/
        datadir =/tmp/6606/ # /usr/local/mysql/data
        server_id =6606 # 0
        port =6606 # 3306
        socket =/tmp/6606/mysql.sock # /tmp/mysql.sock
        auto_increment_increment =1 # 1
        auto_increment_offset =1 # 1
        lower_case_table_names =1 # 0
        secure_file_priv = # null
        
        
        ####: for binlog
        binlog_format =row # row
        log_bin =mysql-bin # off
        binlog_rows_query_log_events =on # off
        log_slave_updates =on # off
        expire_logs_days =4 # 0
        binlog_cache_size =32768 # 32768(32k)
        binlog_checksum =none # CRC32
        sync_binlog =1 # 1
        
        
        ####: for error-log
        log_error =mysql-err.log # /usr/local/mysql/data/localhost.localdomain.err
        
        
        ####: for slow query log
        
        
        ####: for gtid
        gtid_mode =on # off
        enforce_gtid_consistency =on # off
        
        
        ####: for replication
        master_info_repository =table # file
        relay_log_info_repository =table # file
        
        
        ####: for group replication
        transaction_write_set_extraction =XXHASH64 # off
        loose-group_replication_group_name ="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" # 
        loose-group_replication_start_on_boot =off # off
        loose-group_replication_local_address ="127.0.0.1:24903" #
        loose-group_replication_group_seeds ="127.0.0.1:24901,127.0.0.1:24902,127.0.0.1:24903"
        loose-group_replication_bootstrap_group =off # off
        
        
        ####: for innodb
        default_storage_engine =innodb # innodb
        default_tmp_storage_engine =innodb # innodb
        innodb_data_file_path =ibdata1:12M:autoextend # ibdata1:12M:autoextend
        innodb_temp_data_file_path =ibtmp1:12M:autoextend # ibtmp1:12M:autoextend
        innodb_log_group_home_dir =./ # ./
        innodb_log_files_in_group =2 # 2
        innodb_log_file_size =48M # 50331648(48M)
        innodb_file_format =Barracuda # Barracuda
        innodb_file_per_table =on # on
        innodb_page_size =16k # 16384(16k)
        innodb_thread_concurrency =0 # 0
        innodb_read_io_threads =4 # 4
        innodb_write_io_threads =4 # 4
        innodb_purge_threads =4 # 4
        innodb_print_all_deadlocks =on # off
        innodb_deadlock_detect =on # on
        innodb_lock_wait_timeout =50 # 50
        innodb_spin_wait_delay =6 # 6
        innodb_autoinc_lock_mode =2 # 1
        innodb_stats_persistent =on # on
        innodb_stats_persistent_sample_pages =20 # 20
        innodb_adaptive_hash_index =on # on
        innodb_change_buffering =all # all
        innodb_change_buffer_max_size =25 # 25
        innodb_flush_neighbors =1 # 1
        innodb_flush_method =O_DIRECT # 
        innodb_doublewrite =on # on
        innodb_log_buffer_size =16M # 16777216(16M)
        innodb_flush_log_at_timeout =1 # 1
        innodb_flush_log_at_trx_commit =1 # 1
        autocommit =1 # 1

        【3】初始化三個數據庫實例

        cd /usr/local/mysql/
        ./bin/mysqld --defautls-file=/tmp/4406.cnf --datadir=/tmp/4406 --initialize-insecrue
        
        ./bin/mysqld --defautls-file=/tmp/5506.cnf --datadir=/tmp/5506 --initialize-insecrue
        
        ./bin/mysqld --defautls-file=/tmp/6606.cnf --datadir=/tmp/6606 --initialize-insecrue

        【4】配置group-replication 的初始實例

        /usr/local/mysql/bin/mysqld --defaults-file=/tmp/4406.cnf &
        mysql -h127.0.0.1 -uroot -P4406
        
        -- 增加用戶
         set sql_log_bin=0;
         create user rpl_user@'%' identified by '123456';
         grant replication slave,replication client on *.* to rpl_user@'%';
         create user rpl_user@'127.0.0.1' identified by '123456';
         grant replication slave,replication client on *.* to rpl_user@'127.0.0.1';
         create user rpl_user@'localhost' identified by '123456';
         grant replication slave,replication client on *.* to rpl_user@'localhost';
         set sql_log_bin=1;
        
        -- 增加復制憑證
         change master to 
         master_user='rpl_user',
         master_password='123456'
         for channel 'group_replication_recovery';
        
        -- 安裝組復制物件
         install plugin group_replication soname 'group_replication.so';
        
        -- 啟動組復制
         set global group_replication_bootstrap_group=on;
         start group_replication;
         set global group_replication_bootstrap_group=off;

        【5】5506 實例的配置過程如下:

        /usr/local/mysql/bin/mysqld --defaults-file=/tmp/5506.cnf &
        mysql -h127.0.0.1 -uroot -P5506
        
        -- 增加用戶
         set sql_log_bin=0;
         create user rpl_user@'%' identified by '123456';
         grant replication slave,replication client on *.* to rpl_user@'%';
         create user rpl_user@'127.0.0.1' identified by '123456';
         grant replication slave,replication client on *.* to rpl_user@'127.0.0.1';
         create user rpl_user@'localhost' identified by '123456';
         grant replication slave,replication client on *.* to rpl_user@'localhost';
         set sql_log_bin=1;
        
        -- 增加復制憑證
         change master to 
         master_user='rpl_user',
         master_password='123456'
         for channel 'group_replication_recovery';
        
        -- 安裝組復制物件
         install plugin group_replication soname 'group_replication.so';
        
        -- 啟動組復制
         start group_replication; # 注意這里不是初始化了,只要加入就行

        【6】6606 實例的操作與5506的操作一樣,這樣group replication 的配置就完成了。

        以上這篇MySQL-group-replication 配置步驟(推薦)就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

        您可能感興趣的文章:

      1. mysql5.5 master-slave(Replication)配置方法
      2. 基于mysql replication的問題總結
      3. 聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        MySQL-group-replication配置步驟(推薦)

        MySQL-group-replication配置步驟(推薦):MySQL-Group-Replication 是mysql-5.7.17版本開發出來的新特性;它在master-slave 之間實現了強一致性, 但是就目前來說主要是性能不太好。 【1】確定當前的mysql數據庫版本為5.7.17及以上 /usr/local/mysql/bin/mysqld --
        推薦度:
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 免费在线精品视频| 一二三四影视在线看片免费| 亚洲AV中文无码乱人伦| 亚洲av日韩aⅴ无码色老头| 男人的好免费观看在线视频| 涩涩色中文综合亚洲| 久久精品网站免费观看| 中文字幕精品三区无码亚洲 | 亚洲中文字幕久久精品无码APP| 免费的黄色网页在线免费观看| 国产人妖ts在线观看免费视频| 猫咪免费观看人成网站在线| 狠狠色婷婷狠狠狠亚洲综合| 精品无码一级毛片免费视频观看| 亚洲啪啪综合AV一区| 日韩在线不卡免费视频一区| 精品亚洲成A人无码成A在线观看| 搡女人真爽免费视频大全| 亚洲av永久无码精品秋霞电影秋 | 911精品国产亚洲日本美国韩国| 最近最好最新2019中文字幕免费| 亚洲一级在线观看| 四虎永久精品免费观看| 99久久婷婷免费国产综合精品| 亚洲黄色在线网站| 午夜老司机免费视频| 一区二区三区在线免费观看视频| 国产亚洲婷婷香蕉久久精品 | 亚洲成熟丰满熟妇高潮XXXXX| 深夜国产福利99亚洲视频| 中文字幕无码一区二区免费| 亚洲午夜电影一区二区三区| 四虎免费永久在线播放| 国产va在线观看免费| 亚洲最大的成人网| 亚洲色无码一区二区三区| 免费看国产精品3a黄的视频| 精选影视免费在线 | 亚洲综合色7777情网站777| 亚洲综合国产精品第一页 | 免费观看的av毛片的网站|