Changing the Traffic Manager Port

To change the Traffic Manager port in Mashery Local for Docker, modify the docker-compose.yml file to change the 80:80 under services:/ml-tm:/ports: to <host port>:<container port>, where the container port is the port you configured for the proxy.

Note that the host port could be different from the container port. The host port is the port that would be used to access the proxy from outside. After changing the ports in the docker-compose.yml, you will need to do docker-compose down and up to take them into effect. If you know the ports you are planning to switch in the future, you can add them in advance. Then, later when you decide to switch the port, you can simply change it from the UI (under Instance Management > Instance Settings > HTTP/HTTPS port).

There could be two scenarios for changing the proxy port:
Scenario 1
  • Add the new port mapping to docker-compose.yml
  • Execute the command below if the Mashery Local Docker instance is running:
    docker-compose down
  • Execute
    docker-compose up -d
  • Change port from UI
  • Check whether port is in effect:
    docker exec -it ml-tm netstat -nlp |grep LISTEN|grep tcp
    					 
  • If the new port is not being listened, execute the command:
    docker exec -it ml-tm nohup service javaproxy restart
    					 
Scenario 2
  • Change port from UI
  • Add the new port mapping to docker-compose.yml
  • Execute
    docker-compose down
  • Execute
    docker-compose up -d