How to Change Master to Slave with CLI

To change a Master to a Slave without using Mashery Local Cluster Manager administrator, you can use Command Line Interface (CLI).

Create a temporary file (for example, /tmp/change_master.py) with the following code (fill in the <old master IP> and <new master IP> fields):
import sys;
sys.path.append('/var/www/htdocs/service/mashery/cgi');
import debug;
debug.change_master_to('<old master IP>','<new master IP>')
Then, execute the following command:
docker cp /tmp/change_master.py ml-cm:/tmp
docker exec -it ml-cm python/tmp/change_master.py