Two SonarQube on same linux machine?

Hello SonarSource Community!

Just ran into an issue of SQ 7.9 not starting on my sandbox Linux machine.

I had been running 6.7.5 (Demo) and 7.3 (Demo) side by side on the same machine (using different ports for web and elasticsearch).

They both ran fine. Wanted to checkout 7.9. I stopped 7.3 and assigned those ports to 7.9 and tried to start it up. It won’t start. If I kill 6.7.5, 7.9 will start. If I kill 7.9, 6.7.5 will start - but I can’t have them both running at the same time.

Researched the es.log from 7.9 and found that Elasticsearch seems to be trying to join a cluster and timeout. This repeats a few times. BTW, I did have the Max File Descriptors set so I don’t think that is the problem but the message does appear.

2019.08.08 16:36:22 DEBUG es[][i.n.b.ByteBufUtil] -Dio.netty.maxThreadLocalCharBufferSize: 16384
2019.08.08 16:36:22 DEBUG es[][o.e.t.TcpTransport] Bound profile [default] to address {127.0.0.1:9901}
2019.08.08 16:36:22 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:9901}, bound_addresses {127.0.0.1:9901}
2019.08.08 16:36:22 WARN  es[][o.e.b.BootstrapChecks] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
2019.08.08 16:36:22 DEBUG es[][o.e.n.Node] waiting to join the cluster. timeout [30s]
2019.08.08 16:36:25 DEBUG es[][o.e.d.z.ZenDiscovery] filtered ping responses: (ignore_non_masters [false])
        --> ping_response{node [{sonarqube}{1Ef7FBlxTUCeN8f_GHX14Q}{IYVPZo_zQXWaEYCXa7SWew}{127.0.0.1}{127.0.0.1:9901}{rack_id=sonarqube}], id[7], master [null],cluster_state_version [-1], cluster_name[sonarqube]}
2019.08.08 16:36:25 DEBUG es[][o.e.d.z.ZenDiscovery] elected as master, waiting for incoming joins ([0] needed)
2019.08.08 16:36:25 DEBUG es[][o.e.c.s.MasterService] processing [zen-disco-elected-as-master ([0] nodes joined)]: execute

Any insight into what the issue might be?

Can I run two SonarQube servers on the same linux machine?

Should I run more than one SonarQube server on a linux machine?

Any help is greatly appreciated!

Steve

You have to assign unique ports for all sonar components, including elasticsearch.

Also, I think you must configure elasticsearch instances as single nodes: https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html

1 Like

@edu is right. If you are using the Community Edition, another option is to use the docker image. You could run as many container as you want (given the hardware capability of the host), while mapping only the web port.

Thank you for the link! I will check that out. I have been changing all the ports so that wasn’t the issue.

Great idea - I’ll have to explore that option in my company.

What if we are using a Developer Edition - are there added complexities if using Docker?

I see where I can set it as a single node - where would I actually configure that - conf/sonar.properties?

If so how?

If not, where would I configure ElasticSearch?

Thanks again!