Issue with Sonar Qube instance on starting

Hi Team,
We are trying to implement HA setup using Sonarqube community edition. We used AWS ec2 instances - 3 instances - two sonarqube instances and one for NFS to mount common storage among both instance. I mount the Sonar_data folder from first instance which is having data and temp directory to NFS Server and use that mount folder on Second Sonarqube instance and it is failing to start. PFB the detailed information

Sonarqube Version : 7.9.3
Java 11

Sonar.log 2020.07.13 10:49:33 INFO app[o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2020.07.13 10:49:36 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.07.13 10:49:36 INFO app[o.s.a.SchedulerImpl] Process[es] is stopped
2020.07.13 10:49:36 INFO app[o.s.a.SchedulerImpl] SonarQube is stopped

elastic search logs
g.IllegalStateException: failed to obtain node locks, tried [[/opt/sonarqube/sonar_data/data/es6]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:300) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.node.Node.(Node.java:296) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.0.jar:6.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.0.jar:6.8.0]

Hi, Welcome to the community forum. HA is only available in the DCE edition. Outside of this edition, having several SonarQube instances running connected to the same database will lead to corrupted data.

Thanks Pierre. So you mean to say we cant share data and temp between two instances using community edition. We are trying to implement Active-passive strategy. When the first instance is down, we should start second and it should reflect the data as present in first. So we are trying to store data and temp as common , so both will be in sync all the time .

I’m not sure what data you attend to share here. The only data you need to do a disaster recovery is the database: do database backup, and be ready to restore one.

Hi Pierre. Can we use the /opt/sonarqube/data folder and created in first instance and mount this data folder to second instance /opt/sonarqube/data to reflect the sonarqube analysis performed in single instance to display on both instances.
Both instances are connected to single postgresql database.will the above strategy work for sonarqube.?

Hi @Prakash_Vadaga,

As he said earlier,

So, no. You cannot connect multiple SonarQube instances to the same database unless you’re using the Data Center Edition. You cannot share the database. You cannot share the ES indices. You cannot share.

 
HTH,
Ann