MARIADB Gtid-based replication

Source: Internet
Author: User
Tags crc32 mixed unique id

1, configure the master-slave node of the service configuration file


1.1. Configure the Master node:

#binlog_format =mixed

Binlog-format=row


# required Unique ID between 1 and 2^32-1

# defaults to 1 if master-host are not set

# but would not function as a master if omitted

Server-id = 1


Log-slave-updates=true

Master-info-repository=table

Relay-log-info-repository=table

Sync-master-info=1

slave-parallel-threads=2

Binlog-checksum=crc32

Master-verify-checksum=1

Slave-sql-verify-checksum=1

Binlog-rows-query-log_events=1

report-port=3306

Report-host=www.pancou.com


1.2. Configure the Slave node:

[Mysqld]

#binlog_format =mixed

Binlog-format=row


# required Unique ID between 1 and 2^32-1

# defaults to 1 if master-host are not set

# but would not function as a master if omitted

Server-id = 2


Log-slave-updates=true

Master-info-repository=table

Relay-log-info-repository=table

Sync-master-info=1

slave-parallel-threads=2

Binlog-checksum=crc32

Master-verify-checksum=1

Slave-sql-verify-checksum=1

Binlog-rows-query-log_events=1

report-port=3306

Report-host=www.pancou.com



MariaDB [(none)]> change master to master_host= ' 192.168.110.128 ', master_port=3306,master_user= ' Repl_user ', master _password= ' Pancou ', master_use_gtid=current_pos;

Query OK, 0 rows affected (0.06 sec)


MariaDB [(None)]> start slave;

Query OK, 0 rows affected (0.01 sec)


MariaDB [(none)]> change master to master_host= ' 192.168.110.130 ', master_port=3306,master_host= ' Repl_user ', master _password= ' Pancou ', master_use_gtid=current_pos;

Query OK, 0 rows affected (0.03 sec)


MariaDB [(None)]> start slave;

Query OK, 0 rows affected (0.02 sec)


MariaDB [(none)]> show Slave status\g

1. Row ***************************

Slave_io_state:connecting to Master

Master_host:repl_user

Master_user:repl_user

master_port:3306

Connect_retry:60

Master_log_file:

Read_master_log_pos:4

relay_log_file:www-relay-bin.000001

Relay_log_pos:4

Relay_master_log_file:

Slave_io_running:connecting

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:4

relay_log_space:248

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:0

Last_io_error:

last_sql_errno:0

Last_sql_error:

Replicate_ignore_server_ids:

Master_server_id:2

MASTER_SSL_CRL:

Master_ssl_crlpath:

Using_gtid:current_pos

gtid_io_pos:0-2-645

1 row in Set (0.00 sec)


MariaDB [(None)]> show variables like ' slave_parallel% ';

+---------------------------+--------+

| variable_name | Value |

+---------------------------+--------+

| slave_parallel_max_queued | 131072 |

| Slave_parallel_threads | 2 |

+---------------------------+--------+

2 rows in Set (0.01 sec)


This article is from the "Linunx" blog, please be sure to keep this source http://lijianmin2008.blog.51cto.com/621678/1925091

MARIADB Gtid-based replication

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.