mysql 5.6 gtid複製

來源:互聯網
上載者:User

標籤:mysql   gtid   

grant replication slave on *.* to [email protected]‘ip‘ identified by ‘xxx‘;

flush privileges;


change master to master_host=‘192.168.1.103‘,master_port=3306,master_user=‘repl‘,master_password=‘ffffff‘,master_auto_position=1;

start slave;

show slave status\G


my.cnf檔案

# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

[client]

port = 3306

socket = /tmp/mysqld1.sock


[mysqld]


# Remove leading # and set to the amount of RAM for the most important data

# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

# innodb_buffer_pool_size = 128M


# Remove leading # to turn on a very important data integrity option: logging

# changes to the binary log between backups.

# log_bin


# These are commonly set, remove the # and set as required.

basedir = /usr/local/mysql1

datadir = /data/mysql1

port = 3306

socket = /tmp/mysqld1.sock


server-id = 1


#binlog

log-bin = /data/mysql1/logs/mysql1-bin

binlog_format = row

binlog-row-image = minimal

binlog_cache_size = 512K

max_binlog_size = 100M

gtid-mode=on

enforce-gtid-consistency=true

log-slave-updates=true

slave_parallel_workers = 2


sync_binlog = 1


#relay log

relay-log = /data/mysql1/logs/relay1-log

max_relay_log_size = 100M


#check binlog

binlog_checksum = CRC32

slave_allow_batching = 1

master_verify_checksum = 1

slave_sql_verify_checksum = 1


binlog_rows_query_log_events = 1

master-info-repository=TABLE

relay-log-info-repository=TABLE

sync-master-info=1


binlog-ignore-db=mysql

binlog-ignore-db=information_schema

binlog-ignore-db=performance_schema

replicate-ignore-db=mysql

replicate-ignore-db=information_schema

replicate-ignore-db=performance_schema

auto-increment-increment=10

auto-increment-offset=1



# Remove leading # to set options mainly useful for reporting servers.

# The server defaults are faster for transactions and fast SELECTs.

# Adjust sizes as needed, experiment to find the optimal values.

# join_buffer_size = 128M

# sort_buffer_size = 2M

# read_rnd_buffer_size = 2M 


mysql 5.6 gtid複製

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.