Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ MySQL and MariaDB new master from the cluster configuration GTID     - Python class of operator overloading (Programming)

- Java implementation linear table - represents the order of representation and chain (Programming)

- Using Linux stat command to view the files (Linux)

- Linux iptables firewall and vsftpd to resolve the issue (Linux)

- The method of Linux into the rescue mode (Linux)

- Attic-- delete duplicate data backup program (Linux)

- libreadline.so.6: can not open shared object file problem solution (Linux)

- Specifies the open ports of the SUSE firewall settings (Linux)

- Docker container plaintext password problem-solving way (Server)

- Ubuntu 14.04 How to install Cinnamon 2.4.5 (Linux)

- Install Xshell on Mac OS X (Linux)

- How to import JNI resulting .so libraries in Android Studio (Programming)

- Windows 7 hard disk to install Ubuntu 15.04 (Linux)

- Linux cron job (Linux)

- Red Hat Linux mount U disk (Linux)

- Introduction and use of the Raspberry Pi (Linux)

- Arronax allows you to easily create desktop startup file (Linux)

- Keepalived achieve high availability Nginx Reverse Proxy (Server)

- MongoDB3.0.x version of the user authorization profile (stand-alone environment) (Database)

- ld.so.conf.d profile (Linux)

 
         
  MySQL and MariaDB new master from the cluster configuration GTID
     
  Add Date : 2017-08-31      
         
         
         
  Written in front of the "MySQL and MariaDB traditional master-slave cluster configuration", the technology has been very mature. From Mysql5.6 and MariaDB10.0 start, with the new master plan from GTID, but both systems to this version appeared branch, implementation has been different, different configuration, described below, respectively.

MariaDB:

I use the version or version 10.1, the current version of this version is not stable, but does not affect the test.

Until created copy the user.

We are here because it is newly created database, so the main library at the first reset state, this operation is not required, if later found to synchronize sql fails, skip this line executable failed sql.

MariaDB [mysql]> reset master;

Then you can find the old bin-log have been removed, has only a newly created log file.

Then execute the following statement, note behind master_use_gtid = current_pos line with the traditional patterns are different.

MariaDB [mysql]> change master to

master_host = 'localhost',

master_port = 10001,

master_user = 'rep',

master_password = '123456',

master_use_gtid = current_pos;

Query OK, 0 rows affected (0.36 sec)

 

MariaDB [mysql]> start slave;

Query OK, 0 rows affected (0.18 sec)

 

MariaDB [mysql]> show slave status \ G;

*************************** 1. row ******************** *******

              Slave_IO_State: Waiting for master to send event

                  Master_Host: localhost

                  Master_User: rep

                  Master_Port: 10001

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000001

          Read_Master_Log_Pos: 313

              Relay_Log_File: lyw-hp-relay-bin.000002

                Relay_Log_Pos: 601

        Relay_Master_Log_File: mysql-bin.000001

            Slave_IO_Running: Yes

            Slave_SQL_Running: Yes

                          . . . . . .

                         

                  Using_Gtid: Current_Pos

Later than the traditional master-slave more than a line Using_Gtid: Current_Pos, described the use of a new master-slave mode.

After setting, the same need with testing, changes to the master repository affect the content from the library.

Mysql:

Mysql5.6 version began to support GTID reproduction mode, it is configured with different MariaDB, you need to modify the configuration in the configuration file. Add content follows

[Mysqld]

gtid-mode = on

log-slave-updates = true

enforce-gtid-consistency = true


Then start both databases. Also you need to configure the synchronization user.

Then execute the following command from the library, pay attention to this last line master_auto_position = 1 with different MariaDB's.

mysql> change master to

master_host = 'localhost',

master_port = 20001,

master_user = 'rep',

master_password = '123456',

master_auto_position = 1;

mysql> start slave;

mysql> show slave status \ G;

*************************** 1. row ******************** *******

              Slave_IO_State: Waiting for master to send event

                  Master_Host: localhost

                  Master_User: rep

                  Master_Port: 20001

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000004

          Read_Master_Log_Pos: 850

              Relay_Log_File: lyw-hp-relay-bin.000002

                Relay_Log_Pos: 1060

        Relay_Master_Log_File: mysql-bin.000004

            Slave_IO_Running: Yes

            Slave_SQL_Running: Yes

                          . . . . . .

          Retrieved_Gtid_Set: a34819a9-700f-11e5-a841-34238703623c: 1-3

            Executed_Gtid_Set: a34819a9-700f-11e5-a841-34238703623c: 1-3

The last two lines of the visible increase in the state associated with the GTID, Retrieved_Gtid_Set, Executed_Gtid_Set, described using GTID this new synchronous mode.

The same way, a plurality of the primary database can be followed from the database, increase reliability and throughput of data read.

Above master-slave configuration is the most basic configuration, on-line use is not enough, the main hung up, and does not automatically switch, please pay attention.
     
         
         
         
  More:      
 
- To install Google Chrome browser under Ubuntu 14.04 LTS (Linux)
- Hadoop2.6.3 build clusters and the development of MapReduce WIN7 by Eclipse on Linux demo (Server)
- Sort sql MySQL 5.6 upgrade slow Cause Analysis (Database)
- Simple solution CC attack under Linux VPS (Linux)
- CentOS-based Kickstart automated installation practice (Linux)
- It is time to upgrade your gulp 4.0 (Programming)
- Oracle to start to solve the error ORA-27102 (Database)
- AngularJS application unit testing started (Programming)
- Use Visual Studio 2015 to develop Android program (Programming)
- How to Create a file can not be changed under Linux (Linux)
- Android using SVG vector graphics to create cool animation effects (Programming)
- Jetty JNDI Development combat (Linux)
- MySQL IO SSD attempt at optimization (Database)
- Sublime Text - Opens the current file in a browser (Linux)
- Linux check disk parameters trapping lack amendments (Linux)
- Linux and Windows virtual machine shared folders ---- Linux install VMware tools (Linux)
- ARM runtime environment built from scratch using QEMU emulator (Linux)
- Binary tree traversal algorithm summary (recursive and non-recursive) (Programming)
- Let Mac OS X dedicated high-speed mobile hard disk can also be read in Linux (Linux)
- How to use the Docker Machine cluster deployment Swarm (Server)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.