Hi
I am not been able to run sonarqube due to below mentioned log issue. Please advise how can i solved the issue
root@storage:/opt/sonar/logs# more sonar.log
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2018.01.07 15:23:08 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/temp
**2018.01.07 15:23:08 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001**
2018.01.07 15:23:08 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar/elasticsea
rch]: /opt/sonar/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonar/temp/conf/es
2018.01.07 15:23:08 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.01.07 15:23:08 INFO app[][o.e.p.PluginsService] no modules loaded
2018.01.07 15:23:08 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.01.07 15:23:08 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
2018.01.07 15:23:08 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.01.07 15:23:08 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2018.01.07 15:29:05 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/temp
2018.01.07 15:29:05 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.01.07 15:29:05 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar/elasticsea
rch]: /opt/sonar/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonar/temp/conf/es
2018.01.07 15:29:05 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2018.01.07 15:29:05 INFO app[][o.e.p.PluginsService] no modules loaded
2018.01.07 15:29:05 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
2018.01.07 15:29:06 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
2018.01.07 15:29:06 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
2018.01.07 15:29:06 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.''
root@storage:/opt/sonar/elasticsearch/config# sudo service elasticsearch status
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2018-01-10 14:07:27 +0545; 4s ago
Docs: http://www.elastic.co
Process: 12471 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -Des.pidfile=${PID_DIR}/elasticsearch.pid -Des.default.path.home=${ES_HOME} -De
Process: 12469 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
**Main PID: 12471 (code=exited, status=1/FAILURE)**
Jan 10 14:07:27 storage elasticsearch[12471]: at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1071)
Jan 10 14:07:27 storage elasticsearch[12471]: at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1058)
Jan 10 14:07:27 storage elasticsearch[12471]: at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettings
Jan 10 14:07:27 storage elasticsearch[12471]: at org.elasticsearch.bootstrap.Bootstrap.initialSettings(Bootstrap.java:202)
Jan 10 14:07:27 storage elasticsearch[12471]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:241)
Jan 10 14:07:27 storage elasticsearch[12471]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Jan 10 14:07:27 storage elasticsearch[12471]: Refer to the log for complete error details.
Jan 10 14:07:27 storage systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jan 10 14:07:27 storage systemd[1]: elasticsearch.service: Unit entered failed state.
Jan 10 14:07:27 storage systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
lines 1-18/18 (END)
SonarQube is an open source platform for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs, code smells and security vulnerabilities
**oot@storage:/opt/sonar/elasticsearch/logs# more elasticsearch.log**
[2018-01-09T17:10:20,404][ERROR][o.e.b.Bootstrap ] Exception
java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.6.3.jar:5.6.3]
[2018-01-09T17:10:20,409][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.3.jar:5.6.3]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.3.jar:5.6.3]
... 6 more
Just incase if you need to see sonar.log then below is here with
root@storage:/opt/sonar/logs# more sonar.log
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
2018.01.07 15:23:08 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar/temp
2018.01.07 15:23:08 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.01.07 15:23:08 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar/elasticsea
rch]: /opt/sonar/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonar/temp/conf/es
_**2018.01.07 15:23:08 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running**_
_**2018.01.07 15:23:08 INFO app[][o.e.p.PluginsService] no modules loaded**_
_**2018.01.07 15:23:08 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]**_
_**2018.01.07 15:23:08 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1**_
_**2018.01.07 15:23:08 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped**_
_**2018.01.07 15:23:08 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped**_
<-- Wrapper Stopped
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
Hi Dadoonet
I trigger as following commandfrom example user but it ask for root. How do
i change the user previlege so that i can run it from example user
example@storage:/opt/sonar/elasticsearch/bin$ /etc/init.d/elasticsearch
stopt
You need root privileges to run this script
example@storage:/opt/sonar/elasticsearch/bin$ /etc/init.d/elasticsearch stop
You need root privileges to run this script
example@storage:/opt/sonar/elasticsearch/bin$ /etc/init.d/elasticsearch
start
You need root privileges to run this script
example@storage:/opt/sonar/elasticsearch/bin$ sudo
/etc/init.d/elasticsearch start
[sudo] password for bsaitechnosales:
[ ok ] Starting elasticsearch (via systemctl): elasticsearch.service.
example@storage:/opt/sonar/elasticsearch/bin$
example@storage:/opt/sonar/elasticsearch/bin$ /etc/init.d/elasticsearch
status
You need root privileges to run this script
Jan 10 17:53:33 storage systemd[1]: Starting Elasticsearch...
Jan 10 17:53:33 storage systemd[1]: Started Elasticsearch.
Jan 10 17:53:34 storage elasticsearch[20633]: Exception in thread "main"
SettingsException[Failed to load settings from [elasticsearch.yml]]; nest...
Jan 10 17:53:34 storage elasticsearch[20633]: in 'reader', line 96, column
1:
Jan 10 17:53:34 storage systemd[1]: elasticsearch.service: Main process
exited, code=exited, status=1/FAILURE
Jan 10 17:53:34 storage systemd[1]: elasticsearch.service: Unit entered
failed state.
Jan 10 17:53:34 storage systemd[1]: elasticsearch.service: Failed with
result 'exit-code'.
Hint: Some lines were ellipsized, use -l to show in full.
bsaitechnosales@storage:/opt/sonar/elasticsearch/bin$
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.