Question

How do i manually replicate a master failure scenario?

I have 2 servers that act as master and slave which replicates each other. What i am trying to do is to replicate a scenario of master failure that is, when continuous write happens to master server when master fails. i am accessing the master server using a perl script and inserting values to a table in master server. how can i manually abruptly stop the insertion of data to master server as it would happen when a master is down suddenly.

Was it helpful?

Solution

I would do the following...

1) if the server is running UNIX os .

     The perl command would be ..

                system ("ps -ef | grep username| awk '{ print $2 }' | xargs kill -9") ;

             This would kill all the proceeses in your unix server and return to your perl script. Pl note that if you do not want to return to your perl script , use exec command instead of system. Also note that if you are running a database , it would be a better idea to kill your database processes first.

2) If you are running a windows server

     The perl command would be ..

              system ("taskkill /f /fi username") ;

This would kill all the proceeses of the user forcefully of your windows server and return to your perl script.

                   Hope This helps
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top