On the second database server - ACS - Reference Guides

ACS Installation and Administration Guide

Product
ACS
AFS_Version
7.11
Category
Reference Guides
language
English
audience
public

Continue with the second database server

1. Connect to the database server:

mysql -uroot -p'root_password'


2. Add the right on all to the database CKS user with these database instructions:

GRANT ALL ON *.* TO antisearch@'cks1-box' IDENTIFIED BY 'kangoo';

GRANT ALL ON *.* TO antisearch@'cks2-box' IDENTIFIED BY 'kangoo';

GRANT ALL ON *.* TO antisearch@'localhost' IDENTIFIED BY 'kangoo';

GRANT ALL ON *.* TO antisearch@'127.0.0.1' IDENTIFIED BY 'kangoo';

Change cks1-box and cks2-box with the CKS servers fully qualified hostnames.


3. Add the replication right to the user antirepl (a user created for replication):

GRANT REPLICATION SLAVE ON *.* TO antirepl@'%' IDENTIFIED BY 'kangoo';


4. Edit the /etc/my.cnf configuration file and add these two lines in the [mysql] part of the file:

log-bin

server-id=2


5. Restart the database:

/etc/init.d/mysql restart


6. Configure the link to the master:

CHANGE MASTER TO MASTER_HOST='cks1-box', MASTER_USER='antirepl',
MASTER_PASSWORD='kangoo', MASTER_LOG_FILE='FILE',
MASTER_LOG_POS=POSITION;

Replace FILE and POSITION in the previous instruction by the values gathered previously (master status box 1, step 6 of the previous topic).

antirepl is the master's replication user we created on the first server.


7. Start the slave:

START SLAVE;


8. Display the master status and keep the output as File and Position information are needed for the other database instance configuration:

SHOW MASTER STATUS;

+-------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+-------------------+----------+--------------+------------------+
| mysqld-bin.000001 | 228 | | |
+-------------------+----------+--------------+------------------+
1 row in set (0.00 sec)