Chapter 18 (Hosting your own web site) . Replication 541 To enable the

Chapter 18 . Replication 541 To enable the program on the monitor host to query the slaves adding a user on the slaves MySQL server is necessary. The user must have the processprivilege to issue the SHOWstatement. Consider this example: grant process on *.* to rmonitor@192.168.1.75 identified by maddog31 ; This statement is issued on all MySQL servers in the replication set. The monitoring host will be 192.168.1.75and will be monitored by user rmonitor. The code for the monitoring program is as follows: 192.168.1.136 , 1=> 192.168.1.1 ); $master = array(0=> 192.168.1.71 ); The previous code snippet builds arrays for master and slave servers. In my replication setup, there are only two slave servers and one master server. For an enhancement of this script, you could store the replication servers within a database and query for those servers. $username = rmonitor ; $password = maddog31 ; print

n ; print

n ; The previous snippet sets the values for connecting to the MySQL servers in the replication set as well as some basic HTML. foreach ($slave as $server) { print

n ; slavestatus($server,$username,$password); print

n ; } foreach ($master as $server) { print

n ; masterstatus($server,$username,$password); print

n ; }
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Leave a Reply


Last Update Type IP Replication File Position Run?