MySQL database servers (slave)-

I/O thread and SQL Thread-

Replication I/O threads-
When a start slave statement is issued on a replica server, the replica creates an I/O thread, which connects to the source and asks it to send the updates recorded in its binary logs. The replication I/O thread reads the updates that the source’s Binlog Dump thread sends and copies them to local files that comprise the replica’s relay log.
The state of this thread is shown as Slave_IO_running in the output of show slave status.
Replication SQL threads-
The replica creates an SQL thread to read the relay log that is written by the replication I/O thread and execute the transactions contained in it.
There are three main threads for each source/replica connection. A source that has multiple replicas creates one binary log dump thread for each currently connected replica, and each replica has its own replication I/O and SQL threads.
Binary log dump thread-
The source creates a thread to send the binary log contents to a replica when the replica connects. This thread can be identified in the output of show process list on the source as the Binlog Dump thread.
The binary log dump thread acquires a lock on the source’s binary log for reading each event that is to be sent to the replica. As soon as the event has been read, the lock is released, even before the event is sent to the replica.
Step 1-
Login to the database and check the global variable gtid.

Step 2-
To Check the server id and binary logfile.

Step 3-
Open the MySQL configuration file and config.
Gtid_mode=ON
enforce_gtid_consistency=ON
server id=100
log-bin=gtidsource

Step 4 –
Restart MySQL service.

Step 5-
Now check global variable gtid, server_id and binary log.

Step 6-
Create a user in master.
Create user repl@’%’ identified by ‘Rainbow@123’
Step 7-
check global variable gtid in replica.

Step 8-
Check server_id and binary_log in replica.

Step 9-
Now check replica status.

Leave a Reply