Example Setup to Run Mashery Local Master and Slave on a Local Machine

Prerequisites

Docker, docker-machine, and docker-compose installed locally (for example, on a Mac).

Procedure

  1. Follow the instructions to build Mashery Local for Docker images locally with docker-machine.
    Prepare a directory that has the three image gz files, the modified (optional) docker-compose.yml file and init-ml.sh.
    Note: The docker-compose.yml and init-ml.sh can be found in the examples directory.
    export MOM_HOST="<MOM host>"
    export MOM_KEY="<MOM key>"
    export MOM_SECRET="<MOM secret>"
    chmod a+x *.sh
  2. Create two docker machines: xxx-ml-master and xxx-ml_slave1, where xxx is replaced with your own machine names, then start both docker-machines.
    Note:

    The docker machine names must be xxx-ml-master and xxx-ml_slave1 for the init-ml.sh to work without modification.

    Both docker-machines must be running (Use "docker-machine ls" to check their status.)

  3. Execute the command:
    init-ml.sh xxx load
    (for the first time); or:
    init-ml.sh xxx
    This cleanly restarts the master and slave re-using the already loaded images (with all previous data removed).