HP OSMS Blueprint: Database Server on HP Server Platforms with MySQL and RHEL5
-> MASTER_LOG_FILE='mysql-bin.000001',
-> MASTER_LOG_POS=1678;
NOTE: In this example, specify the replication user account that you created, the master
log file name, and the log position that you recorded previously from the output of the show
master status command on the master server.
4. Start the slave threads, which initiate the master/slave server connection, by running the
following command on the slave server:
mysql> start slave;
5. Run the show slave status command to verify that the slave server is connected to the
master server correctly:
mysql> show slave status\G
The following output is displayed:
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: master
Master_User: osmusr
Master_Port: 3306
…
NOTE: Use the backslash G ( \G ) option with any MySQL command to display the
command output vertically rather than horizontally. This can be particularly useful with
commands that result in a large amount of information.
If the value of the Slave_IO_State field is Waiting for master server to send
event, the slave server has connected to the master server and will catch up on any updates
that have occurred. If the slave server was not configured correctly, the value of
Slave_IO_State is Connecting to master. If this occurs, review the error log on the
slave server for additional information.
Synchronizing Data
After you configure the master server and the slave server, perform the following steps to
synchronize the database data.
1. Create the test database, osmsdb, and the test table, customer, on the master server by
referring to the SQL scripts in “Creating the Sample Database for MySQL” (page 15).
2. Verify that the osmsdb database and customer table are created automatically on the slave
server. To do this, enter the following commands from the MySQL command-line running
on the slave servers:
mysql> show databases;
Verify that osmsdb is listed in the output.
mysql> use osmsdb;
mysql> show tables;
Verify that customeris listed as a table in the output.
3. Run some SQL commands that modify the customer table on the master server, and verify
that these changes are reflected in the table on the slave server. For example, insert a record
by entering the following command on the master server:
mysql> insert into customer values (1, ‘customer1’, \
‘2000-01-01 10:10:10’, ‘table’, 1234)
4. Verify that the SQL commands are executed automatically on the slave server.
Configuring MySQL Server Replication 19