Setting up Sonarqube DR

I’m setting up a DR (disaster recovery) in my Sonarqube application and the database that it’s configured to consume is from a Postgres Replica DB (a replica from the main DB).

The way Postgres replica DB works is that the DB being replicated is in read only mode and you’ll be able to write it on to it once you tell the main DB to stop it’s replication that’s how i understood it.

Now, that I’m done setting up Sonarqube on another region in Azure and wanted to test if it works. I started the sonarqube services but it fails in the ES.

2023.01.12 09:01:37 INFO es[o.e.c.s.ClusterApplierService] master node changed {previous , current [{sonarqube}{p9kc9zNsRwKxCvFHI4BX2w}{Fg-2EXkRSNuutGGGPK2Vpw}{127.0.0.1}{127.0.0.1:40637}{cdfhimrsw}]}, term: 1, version: 1, reason: Publication{term=1, version=1}
2023.01.12 09:01:37 INFO es[o.e.h.AbstractHttpServerTransport] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2023.01.12 09:01:37 INFO es[o.e.n.Node] started
2023.01.12 09:01:37 INFO es[o.e.g.GatewayService] recovered [0] indices into cluster_state
2023.01.12 09:01:43 INFO es[o.e.n.Node] stopping …
2023.01.12 09:01:43 INFO es[o.e.n.Node] stopped
2023.01.12 09:01:43 INFO es[o.e.n.Node] closing …
2023.01.12 09:01:43 INFO es[o.e.n.Node] closed

2023.01.12 09:01:31 INFO app[o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:40637]
2023.01.12 09:01:31 INFO app[o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [/jsso/sonarqube-9.5.0.56709/elasticsearch]: /jsso/sonarqube-9.5.0.56709/elasticsearch/bin/elasticsearch
2023.01.12 09:01:31 INFO app[o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2023.01.12 09:01:37 INFO app[o.s.a.SchedulerImpl] Process[es] is up
2023.01.12 09:01:37 INFO app[o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [/jsso/sonarqube-9.5.0.56709]: /usr/lib/jvm/java-11-openjdk-11.0.16.0.8-1.el8_6.x86_64/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/jsso/sonarqube-9.5.0.56709/temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx2G -Xms512m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-9.5.0.56709.jar:/jsso/sonarqube-9.5.0.56709/lib/jdbc/postgresql/postgresql-42.3.3.jar org.sonar.server.app.WebServer /jsso/sonarqube-9.5.0.56709/temp/sq-process12299567999635004properties
2023.01.12 09:01:43 INFO app[o.s.a.SchedulerImpl] Process[Web Server] is stopped
2023.01.12 09:01:43 INFO app[o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.01.12 09:01:43 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 143
2023.01.12 09:01:43 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped
← Wrapper Stopped

My question is, do I need to make the DB in read write mode before I can see the successful start up of Sonarqube? Currently it’s pointed to the Postgres replicated DB wherein it’s set to read only. Thanks!

Hey there

It looks like the web process is what stops first – is there any information in the web.log file about why it stopped?

there’s nothing that I can see why it stopped. Is there an option where I can turn on more details when Sonarqube starts to write log files?

You can adjust the log level in your conf/sonar.properties file (or via environment variables if deployed via Docker).