Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Projects are exported on only one of the application nodes 
  • The archive of the exported projects must be copied to all the applications nodes in the target server


Configuration details

(follow the default configuration first, details below is only for specific cases)

...

PropertyDescriptionDefaultMandatoryValue for application nodesValue for search nodes
sonar.cluster.enabled
Activates the cluster mode
false
mandatorytruetrue
sonar.cluster.name

The name of the cluster. Required if multiple clusters are present on the same network. For example this prevents mixing Production and Preproduction clusters.

This will be the name stored in the Hazelcast cluster and used as the name of the Elasticsearch cluster.

sonarqubeoptional(see description)(see description)
sonar.cluster.hosts

Comma-delimited list of all hosts in the cluster. Items must contain the port if the default sonar.cluster.node.port value is not used. Items format is sonar.cluster.node.host or sonar.cluster.node.host:sonar.cluster.node.port.

Status
colourGreen
titleFrom Data Center Edition 7.2+
: sonar.cluster.hosts must contain only application hosts.

(none)mandatory(see description)(see description)
sonar.cluster.search.hosts
Comma-delimited list of search hosts in the cluster. Items must contain the port if the default sonar.search.port value is not used. Items format is sonar.search.host or sonar.search.host:sonar.search.port.
(none)
mandatory(see description)(see description)
sonar.cluster.node.name
The name of the node that is used on Elasticsearch and stored in Hazelcast member attribute (NODE_NAME) for sonar-applicationsonarqube-{UUID}optional(see description)

(see description)

sonar.cluster.node.type

Type of node: either application or search

(none)

mandatoryapplicationsearch
sonar.cluster.node.host

IP address of the network card that will be used by Hazelcast to communicate with the members of the cluster.

If not specified, the first interface will be chosen (note that loopback interfaces won't be selected)

(none) 

optional

 

(see description)(see description)
sonar.cluster.node.port

The Hazelcast port for communication with each host (member) of the cluster.

Status
colourGreen
titleFrom Data Center Edition 7.2+
: sonar.cluster.node.port must be defined only application nodes.

9003optional(see description)

(see description)

From 7.2+: none

sonar.cluster.node.web.port

Hazelcast port for communication with the ComputeEngine process, only for application nodes. Port must be accessible to all other search and application nodes.

If not specified, a dynamic port will be chosen and all ports must be open among the nodes.

(none) 
optional (see description)(none)
sonar.cluster.node.ce.port

Hazelcast port for communication with the WebServer process, only for application nodes. Port must be accessible to all other search and application nodes.

If not specified, a dynamic port will be chosen and all ports must be open among the nodes.

(none) 
optional (see description)(none)
sonar.search.host
Listening IP, only for search nodes. IP must be accessible to all other search and application nodes.
127.0.0.1
mandatory for search nodes(none)(see description)
sonar.search.port
Listening port, only for search nodes. Port must be accessible to all other search and application nodes.
9001
optional(none)(see description)
sonar.search.initialStateTimeout

The timeout for the Elasticsearch nodes to elect a master node. The default value will be fine in most cases, but in a situation where startup is failing because of a timeout, this may need to be adjusted. The value must be set in the format : {integer}{time unit}. Valid {timeunit} values are :

  • ms : milliseconds
  • s : seconds
  • m : minutes
  • h : hours
  • d : days
  • w : weeks

cluster: 120s

standalone: 30s

optional(none)(see description)
sonar.auth.jwtBase64Hs256Secret

Required for authentication with multiple web servers. It is used to keep user sessions opened when they are redirected from one web server to another by the load balancer.

See sonar.properties for details about how to generate this secret key.

(none)
mandatory(see description)(none)


Frequently Asked Questions

  • Does Elasticsearch discover automatically other ES nodes? No. Multicast is disabled. All hosts (IP+port) must be listed.
  • Can different nodes run on the same machine? Yes but the best is to have 5 machines to be really resilient to failures
  • Do the members of a cluster can be discovered automatically? No, all nodes must be configured in sonar.properties

Limitations

  • A downtime of the cluster has to be accepted when performing SonarQube upgrade or plugins installations
  • There is no way to perform actions on the cluster from a central app - all operations have to be done manually on each node of the cluster
  • All application nodes must be stopped when installing, uninstalling or upgrading a plugin
  • Plugins are not shared, it means if you install/uninstall/upgrade a given plugin in one application node, you need to do the same actions on the other application node