Creating a Mashery Local Cluster

Note: TIBCO Mashery Local 5.2 on a Swarm cluster relies on host pinning to achieve statefulness, for example, you need to specify the host name where you want to run Mashery Local stateful components (NoSQL, Log, SQL and Cache) in the corresponding deployment file, and then run deployment step by step.
Follow the steps below for each zone:
  1. Note: Cluster deployment requires root level privileges in order for the Mashery Local containers to run. Log in as root to perform the tml-cluster deployment.
    Deploy NoSQL components first. The first NoSQL container is deployed as seed. Open the file tmgc-nosql.yml and replace ${HOST_NAME} with name of host. Name of the host is the value shown under HOSTNAME column in the output of docker node ls command. In case of on-premises VirtualBox, you can replace this with "master" as we create a VM with name "master" and execute the following command:
    docker stack deploy -c tmgc-nosql.yml nosqlstack --with-registry-auth
    Run docker service ls and output should be as below. Make sure it gets deployed successfully before proceeding.
    k6rpc2tmey91        nosqlstack_nosql_seed   replicated          1/1                 mashbuilder-1.na.tibco.com/tml/tml-nosql:v5.2.0.160
    Run docker service ls and successful output should show nosqlstack_nosql_seed is replicated.
    If you have more than one NoSQL component and you want each of them to be deployed on separate node, then open the file tmgc-nosql-ring.yml and replace ${HOST_NAME} with the desired host and make replicas equal to 1 (replicas: 1 ) on line 6 and run below command after each change.
    docker stack deploy -c tmgc-nosql-ring.yml nosqlnonseedstack --with-registry-auth
    Successful output should show nosqlnonseedstack_nosql_nonseed is replicated.
  2. Deploy Configuration Manager (CM). Run the following command:
    docker stack deploy -c tmgc-cm.yml cmstack --with-registry-auth 
    Run "docker service ls" and output should be as below. Make sure it gets deployed successfully (showing "1/1" in 4th column of the output) before proceeding.
        ID             NAME           MODE     REPLICAS      IMAGE  					
    j4x64bis9qmb   cmstack_tmlcm   replicated   1/1   mashbuilder-1.na.tibco.com/tml/tml-cm:v5.2.0.160
  3. Deploy Log Service. Open the file tmgc-log.yaml and replace ${HOST_NAME} with the desired host for each instance of log deployment and make replicas equal to 1 (replicas: 1 ) on line 6 and run the following command after each change.
    docker stack deploy -c tmgc-log.yml logstack --with-registry-auth
  4. Deploy SQL Service. Open the file tmgc-sql.yaml and replace ${HOST_NAME} with the desired host where you want deploy SQL service and run the following command. As per design, you can only have one SQL per zone.
    docker stack deploy -c tmgc-sql.yml sqlstack --with-registry-auth
  5. Deploy Cache Service. Open the file tmgc-cache.yaml and replace ${HOST_NAME} with the desired host for each instance of cache deployment and make replicas equal to 1 (replicas: 1 ) on line 6 and run the following command after each change.
    docker stack deploy -c tmgc-cache.yml cachestack --with-registry-auth
  6. Deploy Traffic Manager (TM) Service. Run the following command. TM will be distributed by Swarm Manager among available nodes.
    ./deploy-tm-pod.sh