Building Your Next Big Thing with Google Cloud Platform by S. P. T. Krishnan & Jose L. Ugia Gonzalez

Building Your Next Big Thing with Google Cloud Platform by S. P. T. Krishnan & Jose L. Ugia Gonzalez

Author:S. P. T. Krishnan & Jose L. Ugia Gonzalez
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA


Listing 7-42. Changing the Status of the Local MySQL Server to Be a Slave of the Master Cloud SQL Server

mysql> CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000031', \

MASTER_LOG_POS=753, MASTER_HOST='173.194.242.117', \

MASTER_USER='replication-user', MASTER_PASSWORD='replica-password';

Query OK, 0 rows affected (0.01 sec)

The final step in configuring the slave MySQL server is to start the slave. You do so using the start slave MySQL command:

mysql> start slave;

Query OK, 0 rows affected (0.00 sec)

You can verify whether the slave MySQL server is configured correctly by showing its status. To do so, use SHOW SLAVE STATUS as shown in Listing 7-43. In the output, if the value for the variable Slave_IO_State is “Waiting for master to send event”, then the setup is complete and the slave server is waiting for the master to send events.

Listing 7-43. Showing the MySQL Slave Status

mysql> SHOW SLAVE STATUS\G;

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

Slave_IO_State: Waiting for master to send event

Master_Host: 173.194.242.117

Master_User: replication-user

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: mysql-bin.000031

Read_Master_Log_Pos: 930

Relay_Log_File: mysqld-relay-bin.000002

Relay_Log_Pos: 430

Relay_Master_Log_File: mysql-bin.000031

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

Replicate_Do_DB:

Replicate_Ignore_DB:

Replicate_Do_Table:

Replicate_Ignore_Table:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Last_Errno: 0

Last_Error:

Skip_Counter: 0

Exec_Master_Log_Pos: 930

Relay_Log_Space: 587

Until_Condition: None

Until_Log_File:

Until_Log_Pos: 0

Master_SSL_Allowed: No

Master_SSL_CA_File:

Master_SSL_CA_Path:

Master_SSL_Cert:

Master_SSL_Cipher:

Master_SSL_Key:

Seconds_Behind_Master: 0

Master_SSL_Verify_Server_Cert: No

Last_IO_Errno: 0

Last_IO_Error:

Last_SQL_Errno: 0

Last_SQL_Error:

Replicate_Ignore_Server_Ids:

Master_Server_Id: 881423946

1 row in set (0.00 sec)

ERROR:

No query specified



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.