SonarQube server creates and populates data stores, including database and Elasticsearch indices, at startup.
In the context of a cluster, these startup operations can't be done at runtime when a node is already up. They must be done only by the first node to be started. This is controlled by the flag property sonar.cluster.web.startupLeader in sonar.properties :
- only a single node must be flagged with true. This node is the first to be started in the cluster. Unexpected side-effects may occur if it's not the case.
- nodes with flag false are started when the first node is operational (datastores created and populated). Their configuration must be consistent with the "first" node : same sonar.properties, except the flag value, and same directory /extensions as defined after startup of "first" node.
Cluster mode must be enabled on all nodes with the property sonar.cluster.enabled=true in sonar.properties. Default value of sonar.cluster.web.startupLeader is false.