Horizontal Scaling

The aan application services are spread across systems that form a Docker Swarm cluster. You can add unlimited computer nodes and scale to hundreds of nodes.
apip42
The
API Portal
 application services are spread across systems that form a Docker Swarm cluster. You can add unlimited computer nodes and scale to hundreds of nodes.
API Portal
 is deployed in a Docker Swarm cluster and uses the Docker Swarm capability to deploy, scale, and manage the  
API Portal
 services. The CA application fully utilizes the placement constraint feature of Docker Swarm. Because 
API Portal
 is Docker native, the application can be installed on any Linux hosts capable of running Docker. 
API Portal
 must meet the minimum hardware requirements.
This article contains the following information:
API Portal Services
API Portal
 services run on nodes matching the node constraints (node labels).
Service Name
Node Constraints
Automatic Scale
Dispatcher
Swarm Master Nodes
Yes, is deployed on all Swarm Master nodes
solr
portal.persist
No, has one instance running only
ingress
portal
Yes
analytics-server
portal
Yes
portal-enterprise
portal
Yes
portal-data
portal
Yes
pssg
portal
Yes
tenant-provisioner
portal
No, has one instance running only
rabbit-mq
portal
No, has one instance running only
authenticator
portal
Yes
smtp
portal
No, has one instance running only
portaldb
postgresql.master
No, has one instance running only
portaldb-slave
postgresql.slave
No, has one instance running only
Prerequisites
  • A new VM that is provisioned by the CA hardened VM or by your provisioned VM is required
  • Create a non-root user
  • Install Docker 17.09 CE or later
Add More Manager Nodes
In a small cluster, it is sufficient to have a single manager node. If multiple manager nodes are required, two manager nodes are necessary to maintain proper quorum. See https://docs.docker.com/engine/swarm/admin_guide/#maintain-the-quorum-of-managers for more information.
Follow these steps:
  1. SSH into your Docker Swarm Master node.
  2. Retrieve the Docker Swarm manager join token using the following command:
    docker swarm join-token manager
    Docker returns the command to execute on the new system. The following command is an example output:
    To add a manager to this swarm, run the following command: docker swarm join --token SWMTKN-1-29e9p5ttcvl0t5ubuefbhk0i2r0qhectr274nwkit9do78rri7-4wx971ml9qnqkbh9jiv1x6dyh 192.168.65.2:2377
  3. Copy the output of this command.
  4. Access the system that you want to add as a manager node and execute the output command.
Add More Worker Nodes
To set up multi-node environment, you must install Docker on all nodes and configure the firewall using the
configure-node.sh
script in the
util
directory.
Follow these steps:
  1. Copy the
    configure-node.sh
    script to the system with the worker node and run as a root user or a a user with sudo access using the following command:
    ./configure-node.sh -n worker
    The firewall on the CentOS system is updated to allow Docker nodes to communicate.
  2. On the master node, execute the following command on the system that you installed 
    API Portal
    :
    docker swarm join-token worker
    Docker outputs the command to execute on the new system, for example:
    To add a manager to this swarm, run the following command: docker swarm join --token SWMTKN-1-29e9p5ttcvl0t5ubuefbhk0i2r0qhectr274nwkit9do78rri7-9oh8sgwtt9kyo9vkhnkc0bdua 192.168.65.2:2377
  3. Copy the output of this command.
  4. Access the system that you want to add as a worker node and execute the output command.
Add Node Label for Service Placement
You must add two labels to the node for Docker Swarm to orchestrate services onto the newly created node. The node labels are added from the Docker Swarm Manager node.
Follow these steps:
  1. SSH into your Docker Swarm Manager node.
  2. Retrieve the node information using the following command:
    docker node ls   ### output of command ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS fe9kgbgntm57io25jq0g0brxi * manager01.ca.com Ready Active Leader nbnyw79v3qyzknjuw5wcp2jwg worker01.ca.com Ready Active
  3. Type the following command to set the required node labels:
    docker node update --label-add portal=true --label-add portal.persist=true <NODE_ID>
    API Portal
     scales out automatically.
  4. To view the updated replicas count, execute the following command:
    docker stack services portal
    The following example output displays:
    wxfj76uv5pez portal_pssg global 1/2 apim-portal.packages.ca.com/apim-portal/pssg:onprem-beta
    The output indicates that the services PSSG in the portal namespace has one running instance of two replicas. Because the new node was added, the new services are brought up quickly.