This is the fifth day of my participation in the August More text Challenge. For details, see:August is more challenging

Record the troubleshooting process, hoping to help people in need, but also to bring some new experience in troubleshooting

I started Sonar as a non-root user but still couldn’t access the web page

Check the soanr status and find that it has stopped running

Check whether the port is occupied

Check log, found es error

Process exited with exit value [es]: 143

Three warning messages are found in the ES log

  •  setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
    Copy the code

Not solved

  •  max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
    Copy the code

In the/etc/security/limits. Add in the conf configuration files

User name hard nofile 65536

User name soft nofile 65536

Use the ulimit-hn command to check whether the configuration takes effect:

  •  max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    Copy the code

Add the value of vm. Max_map_count to the /etc/sysctl.conf configuration file

Then run sysctl -p to make the configuration take effect

And it still doesn’t work.

If we look at the error report, we see that first the Web program stops, then the ES program stops

So we need to take a look at the Web log

And found that it has experienced the [start web] – > [connection es] – > [create a database connection] – > [web start-up failure] – > [Java exception error]

Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').

Unable to connect to database. Check the connections and Settings (see properties prefixed with "Sonar. Jdbc.").

The database connection failed

  • Modify the sonar config file opt/sonarqube 6.7.4 / conf/sonar. The properties

    Change the database connection user name and password, and uncomment the connection address in the bottom line of the diagram

    Ps: Sonar listens on port 9000 by default. If port 9000 is occupied, change it.

Start sonar again, su user name./bin/linux-x86-64/ sonars. sh start