Search code examples
javaubuntuelasticsearchsonarqube

SonarQube not able to run with Ubuntu when using non embedded database. (elastic search failed to start)


I tried to setup SonarQube 8 and 8.1 in my Ubuntu machine running Ubuntu 18.04 (JDK 11). I am facing one specific issue most probably related with ElasticSearch. Whenever I am trying to start the SonarQube with sonar.sh start command it fails with following error in both es.log and sonar.log

ERROR: [1] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]

Before posting here I tried multiple things but none of them helped me to solve this issue. The things I have tried are below.

  1. Tried setting values in /etc/security/limits.conf

    user  -  nofile  65535
    
  2. Tried setting values in /etc/sysctl.conf

    vm.max_map_count=262144
    fs.file-max=65536
    

Even after changing these system files I am not able to start SonarQube, I always get same error mentioned above every time.

Please Note:

This only happens when I am trying to use the SonarQube along with external database, it work completely ok with embedded H2 database but whenever I enable any external DB (tried both MSSQL and Postgres) I face the same issue.


Solution

  • After searching around a lot finally I found that in Ubuntu you need to add below line in both /etc/systemd/system.conf and /etc/systemd/user.conf to change default open file limit.

    Line to be added

    DefaultLimitNOFILE=65536