From ccf0f388da133c76ca97e9fc8613f55fa7c6d034 Mon Sep 17 00:00:00 2001 From: Tobias Trabelsi <64127335+tobias-trabelsi-sonarsource@users.noreply.github.com> Date: Mon, 15 Feb 2021 08:06:36 +0100 Subject: [PATCH] MMF-2168 fixup for volume documentation in dce --- .../src/pages/setup/install-cluster.md | 23 +++++++++++++------ .../src/pages/setup/operate-cluster.md | 23 +++++++++++++++---- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/server/sonar-docs/src/pages/setup/install-cluster.md b/server/sonar-docs/src/pages/setup/install-cluster.md index 5baad811b6c..de453f4bf83 100644 --- a/server/sonar-docs/src/pages/setup/install-cluster.md +++ b/server/sonar-docs/src/pages/setup/install-cluster.md @@ -227,14 +227,16 @@ The limits of each container depend on the workload that each container has. A g 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 @@ -267,7 +269,6 @@ The Application nodes can be scaled using replicas. Please note that this is not | 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: @@ -283,6 +284,8 @@ The Application nodes can be scaled using replicas. Please note that this is not | 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" @@ -296,6 +299,8 @@ The Application nodes can be scaled using replicas. Please note that this is not | 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" @@ -309,6 +314,8 @@ The Application nodes can be scaled using replicas. Please note that this is not | 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: @@ -339,9 +346,11 @@ The Application nodes can be scaled using replicas. Please note that this is not | driver: bridge | |volumes: -| sonarqube_data: | sonarqube_extensions: | sonarqube_logs: +| search-data-1: +| search-data-2: +| search-data-3: | postgresql: | postgresql_data: | ``` diff --git a/server/sonar-docs/src/pages/setup/operate-cluster.md b/server/sonar-docs/src/pages/setup/operate-cluster.md index 4977e140bee..08ba852821d 100644 --- a/server/sonar-docs/src/pages/setup/operate-cluster.md +++ b/server/sonar-docs/src/pages/setup/operate-cluster.md @@ -40,7 +40,9 @@ You can start or stop a single node in the same way as starting and stopping an ## 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: @@ -61,9 +63,20 @@ To add an Application 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 +#### **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. @@ -73,7 +86,7 @@ In addition, we provide a Web API _api/system/health_ you can use to validate th * 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). @@ -99,7 +112,9 @@ There are three TCP networks to configure: [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`). -- 2.39.5