Creating a Mashery Local Cluster
Follow the steps below for each zone:
- Deploy NoSQL components first. The first NoSQL container is deployed as a seed. Open the file
tmgc-nosql.yml and replace
${HOST_NAME} with the name of the host. The name of the host is the value shown under the
HOSTNAME column in the output of the
docker node ls command. 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. The output should be as below. Make sure it gets deployed successfully before proceeding.k6rpc2tmey91 nosqlstack_nosql_seed replicated 1/1 tmlbuilder.company.com/tml/tml-nosql:v5.2.0.160
Run docker service ls. 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 a separate node, open the file tmgc-nosql-ring.yml and replace ${HOST_NAME} with the desired host, and then make replicas equal to 1 (replicas: 1 ) on line 6 and run the following 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. - Deploy Configuration Manager (CM). As this is a stateless component, it can be run on any node. Run the following command:
docker stack deploy -c tmgc-cm.yml cmstack --with-registry-auth
Run docker service ls. The 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 tmlbuilder.company.com/tml/tml-cm:v5.2.0.160
- Create a
tar.gz of the resources folder in the manifest folder by executing the following:
tar -czf resources.tar.gz "resources/"
- Deploy Log Service. Open the file
tmgc-log.yml 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
- Deploy SQL Service. Open the file
tmgc-sql.yml 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
- Deploy Cache Service. Open the file
tmgc-cache.yml 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
- Deploy Traffic Manager (TM) Service. Run the following command. TM will be distributed by Swarm Manager among available nodes.
./deploy-tm-pod.sh
Once the deployment is complete, you can get the placement of containers node-wise by running the following command on the Swarm master:docker node ps $(docker node ls -q) --filter desired-state=Running | uniq
When the cluster is created, it creates a load balancer.
Copyright © Cloud Software Group, Inc. All rights reserved.