简体   繁体   中英

Install latest version of Sonarqube - Version: 7.9.1 LTS

I am trying to install Version: 7.9.1 LTS of Sonarqube in Amazon Linux AWS EC2. Below is my bash script.

java -version openjdk version "11.0.2" 2019-01-15 LTS

Script:-

$ wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.9.1.zip
$ sudo unzip sonarqube-7.9.1.zip -d /opt/sonar79
$ groupadd sonar
$ useradd -c "Sonar System User" -d /opt/sonar79 -g sonar -s /bin/bash sonar
$ chown -R sonar:sonar /opt/sonar79
$ cd opt/sonar76/sonarqube-7.9/bin/linux-x86-64/
$ sudo ./sonar.sh start

When I checked the status of sonar it says - [ec2-user@ip-10-123-123-123 linux-x86-64]$ sudo ./sonar.sh status.SonarQube is not running.

Please suggest. Amazon Linux 2 AMI OS Error Logs:- --> 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.

WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11+ to run

java.lang.IllegalStateException: SonarQube requires Java 11+ to run

at org.sonar.application.App.checkJavaVersion(App.java:93)

at org.sonar.application.App.start(App.java:56)

at org.sonar.application.App.main(App.java:98)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)

at java.lang.Thread.run(Thread.java:748)

<-- 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.

WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11+ to run

java.lang.IllegalStateException: SonarQube requires Java 11+ to run

at org.sonar.application.App.checkJavaVersion(App.java:93)

at org.sonar.application.App.start(App.java:56)

at org.sonar.application.App.main(App.java:98)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)

at java.lang.Thread.run(Thread.java:748)

<-- 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.

2019.07.31 15:14:00 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar79/sonarqube-7.9.1/temp

2019.07.31 15:14:00 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001

2019.07.31 15:14:00 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar79/sonarqube-7.9.1/elasticsearch]: /opt/sonar79/sonarqube-7.9.1/elasticsearch/bin/elasticsearch

2019.07.31 15:14:00 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

2019.07.31 15:14:01 INFO app[][o.e.p.PluginsService] no modules loaded

2019.07.31 15:14:01 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]

2019.07.31 15:14:07 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1

2019.07.31 15:14:07 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped

2019.07.31 15:14:07 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.

2019.07.31 15:19:07 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar79/sonarqube-7.9.1/temp

2019.07.31 15:19:07 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001

2019.07.31 15:19:07 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar79/sonarqube-7.9.1/elasticsearch]: /opt/sonar79/sonarqube-7.9.1/elasticsearch/bin/elasticsearch

2019.07.31 15:19:08 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

2019.07.31 15:19:08 INFO app[][o.e.p.PluginsService] no modules loaded

2019.07.31 15:19:08 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]

2019.07.31 15:19:13 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1

2019.07.31 15:19:13 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped

2019.07.31 15:19:13 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped

<-- Wrapper Stopped

--> Wrapper Started as Daemon

Launching a JVM...

Unable to start JVM: No such file or directory (2)

JVM exited while loading the application.

JVM Restarts disabled. Shutting down.

<-- 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.

2019.07.31 15:33:27 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonar79/sonarqube-7.9.1/temp

2019.07.31 15:33:27 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001

2019.07.31 15:33:27 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonar79/sonarqube-7.9.1/elasticsearch]: /opt/sonar79/sonarqube-7.9.1/elasticsearch/bin/elasticsearch

2019.07.31 15:33:27 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running

2019.07.31 15:33:28 INFO app[][o.e.p.PluginsService] no modules loaded

2019.07.31 15:33:28 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]

OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

2019.07.31 15:33:33 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1

2019.07.31 15:33:33 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped

2019.07.31 15:33:33 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped

<-- Wrapper Stopped

Adding es.log

cat /var/log/sonarqube/es.log 
2019.08.01 13:23:58 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/xvda1)]], net usable_space [17.6gb], net total_space [19.9gb], types [xfs]
2019.08.01 13:23:58 INFO  es[][o.e.e.NodeEnvironment] heap size [503.6mb], compressed ordinary object pointers [true]
2019.08.01 13:23:58 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [BBdhW1RGRviya7qumPZjvg]
2019.08.01 13:23:58 INFO  es[][o.e.n.Node] version[6.8.0], pid[12840], build[default/tar/65b6179/2019-05-15T20:06:13.172855Z], OS[Linux/4.14.123-111.109.amzn2.x86_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/11.0.2/11.0.2+7-LTS]
2019.08.01 13:23:58 INFO  es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/usr/share/sonarqube/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -Xms512m, -Xmx512m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/usr/share/sonarqube/elasticsearch, -Des.path.conf=/usr/share/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar]
2019.08.01 13:23:59 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2019.08.01 13:23:59 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2019.08.01 13:23:59 INFO  es[][o.e.p.PluginsService] loaded module [mapper-extras]
2019.08.01 13:23:59 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2019.08.01 13:23:59 INFO  es[][o.e.p.PluginsService] loaded module [percolator]
2019.08.01 13:23:59 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2019.08.01 13:23:59 INFO  es[][o.e.p.PluginsService] loaded module [repository-url]
2019.08.01 13:23:59 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2019.08.01 13:23:59 INFO  es[][o.e.p.PluginsService] no plugins loaded
2019.08.01 13:24:03 WARN  es[][o.e.d.c.s.Settings] [http.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
2019.08.01 13:24:05 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and host providers [settings]
2019.08.01 13:24:06 INFO  es[][o.e.n.Node] initialized
2019.08.01 13:24:06 INFO  es[][o.e.n.Node] starting ...
2019.08.01 13:24:06 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2019.08.01 13:24:06 WARN  es[][o.e.b.BootstrapChecks] max number of threads [3794] for user [sonarqube] is too low, increase to at least [4096]
2019.08.01 13:24:09 INFO  es[][o.e.c.s.MasterService] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {sonarqube}{BBdhW1RGRviya7qumPZjvg}{mluwgwiLScmoy8ecLjhySQ}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}
2019.08.01 13:24:09 INFO  es[][o.e.c.s.ClusterApplierService] new_master {sonarqube}{BBdhW1RGRviya7qumPZjvg}{mluwgwiLScmoy8ecLjhySQ}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}, reason: apply cluster state (from master [master {sonarqube}{BBdhW1RGRviya7qumPZjvg}{mluwgwiLScmoy8ecLjhySQ}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
2019.08.01 13:24:09 INFO  es[][o.e.n.Node] started
2019.08.01 13:24:09 INFO  es[][o.e.g.GatewayService] recovered [0] indices into cluster_state
2019.08.01 13:24:10 INFO  es[][o.e.n.Node] stopping ...
2019.08.01 13:24:10 INFO  es[][o.e.n.Node] stopped
2019.08.01 13:24:10 INFO  es[][o.e.n.Node] closing ...
2019.08.01 13:24:10 INFO  es[][o.e.n.Node] closed
2019.08.01 13:25:34 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (/dev/xvda1)]], net usable_space [17.6gb], net total_space [19.9gb], types [xfs]
2019.08.01 13:25:34 INFO  es[][o.e.e.NodeEnvironment] heap size [503.6mb], compressed ordinary object pointers [true]
2019.08.01 13:25:34 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [BBdhW1RGRviya7qumPZjvg]
2019.08.01 13:25:34 INFO  es[][o.e.n.Node] version[6.8.0], pid[13132], build[default/tar/65b6179/2019-05-15T20:06:13.172855Z], OS[Linux/4.14.123-111.109.amzn2.x86_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/11.0.2/11.0.2+7-LTS]
2019.08.01 13:25:34 INFO  es[][o.e.n.Node] JVM arguments [-XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/usr/share/sonarqube/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -Xms512m, -Xmx512m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/usr/share/sonarqube/elasticsearch, -Des.path.conf=/usr/share/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar]
2019.08.01 13:25:35 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2019.08.01 13:25:35 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2019.08.01 13:25:35 INFO  es[][o.e.p.PluginsService] loaded module [mapper-extras]
2019.08.01 13:25:35 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2019.08.01 13:25:35 INFO  es[][o.e.p.PluginsService] loaded module [percolator]
2019.08.01 13:25:35 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2019.08.01 13:25:35 INFO  es[][o.e.p.PluginsService] loaded module [repository-url]
2019.08.01 13:25:35 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2019.08.01 13:25:35 INFO  es[][o.e.p.PluginsService] no plugins loaded
2019.08.01 13:25:39 WARN  es[][o.e.d.c.s.Settings] [http.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.
2019.08.01 13:25:41 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and host providers [settings]
2019.08.01 13:25:42 INFO  es[][o.e.n.Node] initialized
2019.08.01 13:25:42 INFO  es[][o.e.n.Node] starting ...
2019.08.01 13:25:42 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2019.08.01 13:25:42 WARN  es[][o.e.b.BootstrapChecks] max number of threads [3794] for user [sonarqube] is too low, increase to at least [4096]
2019.08.01 13:25:46 INFO  es[][o.e.c.s.MasterService] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {sonarqube}{BBdhW1RGRviya7qumPZjvg}{GCf4Zh8mQQKbQNAI-1UBkA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}
2019.08.01 13:25:46 INFO  es[][o.e.c.s.ClusterApplierService] new_master {sonarqube}{BBdhW1RGRviya7qumPZjvg}{GCf4Zh8mQQKbQNAI-1UBkA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}, reason: apply cluster state (from master [master {sonarqube}{BBdhW1RGRviya7qumPZjvg}{GCf4Zh8mQQKbQNAI-1UBkA}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
2019.08.01 13:25:46 INFO  es[][o.e.n.Node] started
2019.08.01 13:25:46 INFO  es[][o.e.g.GatewayService] recovered [0] indices into cluster_state
2019.08.01 13:25:46 INFO  es[][o.e.n.Node] stopping ...
2019.08.01 13:25:46 INFO  es[][o.e.n.Node] stopped
2019.08.01 13:25:46 INFO  es[][o.e.n.Node] closing ...
2019.08.01 13:25:46 INFO  es[][o.e.n.Node] closed

As you can read on the Requirements page , section platform notes for Linux, the user running SonarQube should be able to open at least 4096 threads. The es log

max number of threads [3794] for user [sonarqube] is too low, increase to at least [4096]

is also pointing to that. The same page also provides multiple solutions. One of them is running the following command as root:

ulimit -u 4096

But there more options and more limits to be aware of. So please read that page carefully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM