Scaling your cluster
You have the option of adding application nodes (up to 10 total application nodes) to your cluster to increase computing capabilities. The operation is different depending on the SonarQube Server installation type.
ZIP installation
Adding an Application Node
To add an application node:
- Configure your new application node in sonar.properties. The following is an example of the configuration to be added to
sonar.properties
for a sixth application node (server6, ip6) in a cluster with the default five servers:
Server6:
...
sonar.cluster.enabled=true
sonar.cluster.node.type=application
sonar.cluster.node.host=ip6
sonar.cluster.node.port=9003
sonar.cluster.hosts=ip1,ip2,ip6
sonar.cluster.search.hosts=ip3:9001,ip4:9001,ip5:9001
sonar.auth.jwtBase64Hs256Secret=YOURGENERATEDSECRET
...
In the example, the hosts followed by ports are written using the IPv4 notation (e.g. ip3:9001
). If you use IPv6 addresses, enclose the IP address in square brackets ([ip3]:9001
).
2. Update the configuration of the preexisting nodes to include your new node. While you don't need to restart the cluster after adding a node, you should ensure the configuration is up to date on all of your nodes to avoid issues when you eventually do need to restart.
Removing an Application Node
When you remove an application node, make sure to update the configuration of the remaining nodes. Much like adding a node, while you don't need to restart the cluster after removing a node, you should ensure the configuration is up to date on all of your nodes to avoid issues when you eventually do need to restart.
Docker installation
Adding Application Nodes
If you're using docker-compose, you can scale the application nodes using the following command:
docker-compose up -d --scale sonarqube=3
Removing Application Nodes
You can reduce the number of application nodes with the same command used to add application nodes by lowering the number.
Kubernetes installation
With Kubernetes' Horizontal Pod Autoscaling (HPA), you can automatically scale your SonarQube Server out and in, resolving any performance issues you may have. See Setting up autoscaling.
Related pages
Was this page helpful?