How to add a node for load balancing
This guide is for adding a node to an OPC cluster and configuring it for load balancing.
The process goes through the same steps as adding a standby node for HA, with some additional steps to configure the profile of the node once it has been added to the cluster.
GUI Method
The cluster is designed to have nodes added that have a clean install of the On-Premise-Controller and no helpdesk instances on.
If you are adding a node that already has a Deskpro helpdesk instance already present, this can lead to errors and the overwriting of any data on the standby node.
From the cluster menu, go to the Secondary node card and click 'Add Ssecondary Node'

The next menu will prompt for the node details.

IP Address - The IP address of the node being added
Port - the SSH port that is in use
User name - The user you are configuring HA for, this can be the root user or a custom SSH user
If you are setting a custom user you will need to make sure that they are in the below user groups as well as adding the user to the /etc/sudoers
file on each node in the cluster: deskpro_admin
adm
sudo
Authorization Method - For initial node setup we support both password and SSH key (guide) methods for the initial configuration. The cluster setup will add it's own SSH key pairs for the service once the node is added.
Once the configuration is filled out, click 'save' and the OPC will run through connectivity checks then configure the node, adding it to the cluster.

Clicking continue will take you back to the cluster menu where the new node will be listed in the secondary node card.

Click the Id of the Node you want to use for load balancing to go to the node details page

Click "Edit Configuration" then change the profile from "standard" to "web"

Click save to change the nodes profile, clicking the node Id again will show the profile is now set to web

CLI Method
The cluster is designed to have nodes added that have a clean install of the On-Premise-Controller and no helpdesk instances on. If you are adding a node that already has a Deskpro helpdesk instance already present, this can lead to errors and the overwriting of any data on the standby node.
To add a node to a cluster on the command line you need to run the node add
command on the main node in the cluster. You can only add a new node to the cluster from the main node.
For initial node setup we support both password and SSH key (guide) methods for the initial configuration. The cluster setup will add it's own SSH key pairs for the service once the node is added.
Using SSH Key pairs You will need to setup SSH key pairs between all the servers in your cluster before setting up the cluster with this method. If using a user other than root
please change the --ssh-user
field to match your custom user.
opc cluster node add --ssh-host IPADDRESS --ssh-user root --ssh-key-path ~/.ssh/KEYFILE --profile web copy
Using Password auth You can use password auth to connect the nodes of the cluster. If using a user other than root
please change the --ssh-user
field to match your custom user.
opc cluster node add --ssh-host IPADDRESS --ssh-user root --ssh-password PASSWORD --profile web copy
Once the configuration is filled out, click 'save' and the OPC will run through connectivity checks then configure the node, adding it to the cluster.

You can then check the cluster status to confirm the node has been added successfully:
opc cluster node list copy

To then set the node to use the "web" profile for load balancing, make a note of the node Id, then run
opc cluster node -i <node Id> update-config --profile web copy

You can then check the nodes profile is set to "web" using the same cluster node list command
opc cluster node list copy

Please log in or register to submit a comment.