The 4Gb mem_limit should not be lower as this is the minimal value for Elasticsearch.
-### Logs
+### Scalability
-The sonarqube_logs volume will be populated with a new folder depending on the containers hostname and all logs of this container will be put into this folder.
-This behavior also happens when a custom log path is specified via the [Docker Environment Variables](/setup/environment-variables/).
+Application nodes can be scaled using replicas. This is not the case for the Search nodes as Elasticsearch will not become ready. See the [Configure and Operate a Cluster](/setup/operate-cluster/) for more information.
-### Search and Application nodes
+### Volumes
+You'll use the following volumes in your configuration:
-The Application nodes can be scaled using replicas. Please note that this is not the case for the Search nodes: Elasticsearch will not become ready.
+- `sonarqube_data` – In the Docker Compose configuration example in the following section, volumes are shared between replicas in the application nodes, so you don't need a `sonarqube_data` volume on your application nodes. In the search nodes, the `sonarqube_data` volume contains the Elasticsearch data and helps reduce startup time, so we recommend having a `sonarqube_data` volume on each search node.
+- `sonarqube_extensions` – For application nodes, we recommend sharing a common `sonarqube_extensions` volume which contains any plugins you install and the Oracle JDBC driver if necessary.
+- `sonarqube_logs` – For both application and search nodes, we recommend sharing a common `sonarqube_logs` volume which contains SonarQube logs. The volume will be populated with a new folder depending on the container's hostname and all logs of this container will be put into this folder. This behavior also happens when a custom log path is specified via the [Docker Environment Variables](/setup/environment-variables/).
## Example Docker Compose configuration
| VIRTUAL_HOST: sonarqube.dev.local
| VIRTUAL_PORT: 9000
| volumes:
-| - sonarqube_data:/opt/sonarqube/data
| - sonarqube_extensions:/opt/sonarqube/extensions
| - sonarqube_logs:/opt/sonarqube/logs
| search-1:
| SONAR_JDBC_PASSWORD: sonar
| SONAR_CLUSTER_ES_HOSTS: "search-1,search-2,search-3"
| SONAR_CLUSTER_NODE_NAME: "search-1"
+| volumes:
+| - search-data-1:/opt/sonarqube/data
| search-2:
| image: sonarqube:8.6-datacenter-search
| hostname: "search-2"
| SONAR_JDBC_PASSWORD: sonar
| SONAR_CLUSTER_ES_HOSTS: "search-1,search-2,search-3"
| SONAR_CLUSTER_NODE_NAME: "search-2"
+| volumes:
+| - search-data-2:/opt/sonarqube/data
| search-3:
| image: sonarqube:8.6-datacenter-search
| hostname: "search-3"
| SONAR_JDBC_PASSWORD: sonar
| SONAR_CLUSTER_ES_HOSTS: "search-1,search-2,search-3"
| SONAR_CLUSTER_NODE_NAME: "search-3"
+| volumes:
+| - search-data-3:/opt/sonarqube/data
| db:
| image: postgres:12
| networks:
| driver: bridge
|
|volumes:
-| sonarqube_data:
| sonarqube_extensions:
| sonarqube_logs:
+| search-data-1:
+| search-data-2:
+| search-data-3:
| postgresql:
| postgresql_data:
| ```
## Scalability
You have the option of adding application nodes (up to 10 total application nodes) to your cluster to increase computing capabilities.
-### Adding an Application Node
+### Scaling in a Traditional Environment
+
+#### **Adding an Application Node**
To add an Application Node:
1. 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:
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
+#### **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.
+### Scaling in a Docker Environment
+
+#### **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.
+
## Monitoring
CPU and RAM usage on each node have to be monitored separately with an APM.
* YELLOW: SonarQube is usable, but it needs attention in order to be fully operational
* RED: SonarQube is not operational
-To call it from a monitoring system without having to give admin credentials, it is possible to setup a System Passcode through the property `sonar.web.systemPasscode`. This must be configured in _$SONARQUBE-HOME/conf/sonar.properties_.
+To call it from a monitoring system without having to give admin credentials, it is possible to setup a system passcode. You can configure this through the `sonar.web.systemPasscode` property in _$SONARQUBE-HOME/conf/sonar.properties_ if you're using a traditional environment or through the corresponding environment variable if you're using a Docker environment.
### Cluster Status
On the System Info page at **Administration > System**, you can check whether your cluster is running safely (green) or has some nodes with problems (orange or red).
[Hazelcast](https://hazelcast.org/) is used to manage the communication between the cluster's application nodes. You don't need to install it yourself, it's provided out of the box.
-The following properties may be defined in the _$SONARQUBE-HOME/conf/sonar.properties_ file of each node in a cluster. When defining a property that contains a list of hosts (`*.hosts`) the port is not required if the default port was not overridden in the configuration.
+If you're working in a Docker environment, your properties are configured using environment variables.
+
+If you're working in a traditional environment, the following properties may be defined in the _$SONARQUBE-HOME/conf/sonar.properties_ file of each node in a cluster. When defining a property that contains a list of hosts (`*.hosts`) the port is not required if the default port was not overridden in the configuration.
[[warning]]
| Ports can be unintentionally exposed. We recommend only giving external access to the application nodes and to main port (`sonar.web.port`).