MYSQL Chaining

This describes setting up a new chain with mysql replication.
This is the basic layout. (M master, S1 slave of master, S2 slave of S1)
M <- S1 <- S2
Creating a chain:
  1. On S1:
stop slave; systemctl disable mysqld; show slave status\G # COPY THIS TO TEXT FILE show mater status\G # COPY THIS TO TEXT FILE
service mysqld stop;
  1. Create an image of S1, this will be S2. In GCP go to the VM instance of S1, click on its disk, click create Image.
========================================
Log into your new image, S2:
  1. edit /etc/my.cnf, add a way to skip the start of a slave.
[mysqld] skip-slave-start
  1. Remove the old UUID, this needs to be unique, so delete it,
rm -f /var/lib/mysql/auto.cnf
  1. change the server-id to anything unique
vi /etc/my.cnf, find "server-id" change it to something unique EG ** server-id=1552009061
  1. systemctl enable mysqld; #ensure mysql will start on boot
  2. service mysqld start;
  3. reset slave;
  4. Set the new master position. These should be the numbers from step 1.
CHANGE MASTER TO MASTER_HOST='10.128.0.120', MASTER_USER='epic', MASTER_PASSWORD='p@p1c', MASTER_PORT=3306, MASTER_LOG_FILE='mysql-bin.000031', MASTER_LOG_POS=100096113, MASTER_CONNECT_RETRY=10;
  1. start slave;
  2. remove, from /etc/my.cnf the skipping of a slave
[mysqld] skip-slave-start ← remove
12 from /etc/my.cnf , ensure read-only = true

  1. go to S1; systemctl enable mysqld; service mysqld start;

Comments

  1. They provide info and advice to encourage accountable gambling, both to gamers and casino operators, and give assist to those who might need a gambling problem. We've reviewed and ranked all the high on-line casinos in the UK based mostly on our rigorous evaluate process. Be around enjoyable folks and have money in your pocket each night as a mixologist, or declare your home in the ever-growing casino gaming industry in as little as three months. You can begin one of Crescent's top-quality packages with no cash down. One ace and one 10 card thecasinosource.com or jack card automatically imply 21, so thoughts that|do not neglect that} going into the game.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to scale a website-My Approach

What is functional programming?