问题
I am trying to install sonarqube-5.1 on Linux x86_64 and I did below steps
1: sudo wget http://downloads.sonarsource.com/sonarqube/sonarqube-5.1.zip
2: unzip sonarqube-5.1.zip
3: sudo mv sonarqube-5.1 /usr/local/
4: sudo /usr/local/sonar/bin/linux-x86-64/sonar.sh start
output
Starting SonarQube...
Started SonarQube.
But when I am trying to open http://my_local_IP:9000 Then It is giving below error
Unable to connect
Firefox can't establish a connection to the server at my_local_IP:9000.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
Had I missed anything in above steps, please help with correct/missed steps.
Below is the 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.
2015.09.29 05:58:22 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[search]: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/bin/java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/home/cadmin/software/sonarqube-5.1/temp -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /tmp/sq-process7829107144547289706properties
2015.09.29 05:58:22 INFO es[o.s.p.ProcessEntryPoint] Starting search
2015.09.29 05:58:22 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[search]: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/bin/java -Djava.awt.headless=true -Xmx1G -Xms256m -Xss256k -Djava.net.preferIPv4Stack=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Djava.io.tmpdir=/home/cadmin/software/sonarqube-5.1/temp -cp ./lib/common/*:./lib/search/* org.sonar.search.SearchServer /tmp/sq-process7829107144547289706properties
2015.09.29 05:58:22 INFO es[o.s.p.ProcessEntryPoint] Starting search
2015.09.29 05:58:22 INFO es[o.s.s.SearchServer] Starting Elasticsearch[sonarqube] on port 9001
2015.09.29 05:58:23 INFO es[o.elasticsearch.node] [sonar-1443520701614] version[1.4.4], pid[31840], build[c88f77f/2015-02-19T13:05:36Z]
2015.09.29 05:58:23 INFO es[o.elasticsearch.node] [sonar-1443520701614] initializing ...
2015.09.29 05:58:23 INFO es[o.e.plugins] [sonar-1443520701614] loaded [], sites []
2015.09.29 05:58:26 INFO es[o.elasticsearch.node] [sonar-1443520701614] initialized
2015.09.29 05:58:26 INFO es[o.elasticsearch.node] [sonar-1443520701614] starting ...
2015.09.29 05:58:26 WARN es[o.e.common.network] failed to resolve local host, fallback to loopback
java.net.UnknownHostException: ip-my_private_IP.ec2.internal: ip-my_private_IP.ec2.internal: unknown error
at java.net.InetAddress.getLocalHost(InetAddress.java:1484) ~[na:1.8.0_45]
at org.elasticsearch.common.network.NetworkUtils.<clinit>(NetworkUtils.java:55) ~[elasticsearch-1.4.4.jar:na]
at org.elasticsearch.transport.netty.NettyTransport.createClientBootstrap(NettyTransport.java:350) [elasticsearch-1.4.4.jar:na]
at org.elasticsearch.transport.netty.NettyTransport.doStart(NettyTransport.java:250) [elasticsearch-1.4.4.jar:na]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85) [elasticsearch-1.4.4.jar:na]
at org.elasticsearch.transport.TransportService.doStart(TransportService.java:91) [elasticsearch-1.4.4.jar:na]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:85) [elasticsearch-1.4.4.jar:na]
at org.elasticsearch.node.internal.InternalNode.start(InternalNode.java:242) [elasticsearch-1.4.4.jar:na]
at org.sonar.search.SearchServer.start(SearchServer.java:46) [sonar-search-5.1.jar:na]
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:77) [sonar-process-5.1.jar:na]
at org.sonar.search.SearchServer.start(SearchServer.java:46) [sonar-search-5.1.jar:na]
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:77) [sonar-process-5.1.jar:na]
at org.sonar.search.SearchServer.main(SearchServer.java:80) [sonar-search-5.1.jar:na]
Caused by: java.net.UnknownHostException: ip-my_private_IP.ec2.internal: unknown error
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_45]
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:907) ~[na:1.8.0_45]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1302) ~[na:1.8.0_45]
at java.net.InetAddress.getLocalHost(InetAddress.java:1479) ~[na:1.8.0_45]
... 10 common frames omitted
2015.09.29 05:58:26 INFO es[o.e.transport] [sonar-1443520701614] bound_address {inet[/0.0.0.0:9001]}, publish_address {inet[/my_private_IP:9001]}
2015.09.29 05:58:26 INFO es[o.e.discovery] [sonar-1443520701614] sonarqube/LmpMNIoNRo6GxkSamD74sQ
2015.09.29 05:58:29 INFO es[o.e.cluster.service] [sonar-1443520701614] new_master [sonar-1443520701614][LmpMNIoNRo6GxkSamD74sQ][localhost][inet[/my_private_IP:9001]]{rack_id=sonar-1443520701614}, reason: zen-disco-join (elected_as_master)
2015.09.29 05:58:29 INFO es[o.elasticsearch.node] [sonar-1443520701614] started
2015.09.29 05:58:29 INFO es[o.e.gateway] [sonar-1443520701614] recovered [0] indices into cluster_state
2015.09.29 05:58:29 INFO app[o.s.p.m.Monitor] Process[search] is up
2015.09.29 05:58:30 INFO app[o.s.p.m.JavaProcessLauncher] Launch process[web]: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djruby.management.enabled=false -Djruby.compile.invokedynamic=false -Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=/home/cadmin/software/sonarqube-5.1/temp -cp ./lib/common/*:./lib/server/*:/home/cadmin/software/sonarqube-5.1/lib/jdbc/mysql/mysql-connector-java-5.1.34.jar org.sonar.server.app.WebServer /tmp/sq-process1305181292822442579properties
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=160m; support was removed in 8.0
2015.09.29 05:58:31 INFO web[o.s.p.ProcessEntryPoint] Starting web
2015.09.29 05:58:31 INFO web[o.s.s.app.Webapp] Webapp directory: /home/cadmin/software/sonarqube-5.1/web
2015.09.29 05:58:31 INFO web[o.s.p.ProcessEntryPoint] Starting web
2015.09.29 05:58:31 INFO web[o.s.s.app.Webapp] Webapp directory: /home/cadmin/software/sonarqube-5.1/web
2015.09.29 05:58:32 INFO web[o.a.c.h.Http11NioProtocol] Initializing ProtocolHandler ["http-nio-my_public_IP-38099"]
2015.09.29 05:58:32 ERROR web[o.a.c.h.Http11NioProtocol] Failed to initialize end point associated with ProtocolHandler ["http-nio-my_public_IP-38099"]
java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_45]
at sun.nio.ch.Net.bind(Net.java:437) ~[na:1.8.0_45]
at sun.nio.ch.Net.bind(Net.java:429) ~[na:1.8.0_45]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[na:1.8.0_45]
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_45]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:343) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:730) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:457) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:120) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.connector.Connector.initInternal(Connector.java:960) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:567) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:851) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:340) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:62) [sonar-server-5.1.jar:na]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:340) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:62) [sonar-server-5.1.jar:na]
at org.sonar.server.app.WebServer.start(WebServer.java:40) [sonar-server-5.1.jar:na]
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:77) [sonar-process-5.1.jar:na]
at org.sonar.server.app.WebServer.main(WebServer.java:66) [sonar-server-5.1.jar:na]
2015.09.29 05:58:32 ERROR web[o.a.c.c.StandardService] Failed to initialize connector [Connector[HTTP/1.1-38099]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-38099]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:567) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:851) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:340) [tomcat-embed-core-8.0.18.jar:8.0.18]
at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:62) [sonar-server-5.1.jar:na]
at org.sonar.server.app.WebServer.start(WebServer.java:40) [sonar-server-5.1.jar:na]
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:77) [sonar-process-5.1.jar:na]
at org.sonar.server.app.WebServer.main(WebServer.java:66) [sonar-server-5.1.jar:na]
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
at org.apache.catalina.connector.Connector.initInternal(Connector.java:962) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) [tomcat-embed-core-8.0.18.jar:8.0.18]
... 10 common frames omitted
Caused by: java.net.BindException: Cannot assign requested address
... 10 common frames omitted
Caused by: java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_45]
at sun.nio.ch.Net.bind(Net.java:437) ~[na:1.8.0_45]
at sun.nio.ch.Net.bind(Net.java:429) ~[na:1.8.0_45]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[na:1.8.0_45]
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[na:1.8.0_45]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:343) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:730) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:457) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:120) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.connector.Connector.initInternal(Connector.java:960) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
... 11 common frames omitted
2015.09.29 05:58:32 WARN web[o.s.p.ProcessEntryPoint] Fail to start web
java.lang.RuntimeException: org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]]
at com.google.common.base.Throwables.propagate(Throwables.java:156) ~[guava-10.0.1.jar:na]
at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:65) ~[sonar-server-5.1.jar:na]
at org.sonar.server.app.WebServer.start(WebServer.java:40) [sonar-server-5.1.jar:na]
at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:77) ~[sonar-process-5.1.jar:na]
at org.sonar.server.app.WebServer.main(WebServer.java:66) [sonar-server-5.1.jar:na]
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[-1]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:340) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.sonar.server.app.EmbeddedTomcat.start(EmbeddedTomcat.java:62) ~[sonar-server-5.1.jar:na]
... 3 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [StandardService[Tomcat]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:851) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
... 6 common frames omitted
Caused by: org.apache.catalina.LifecycleException: Failed to initialize connector [Connector[HTTP/1.1-38099]]
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:574) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) ~[tomcat-embed-core-8.0.18.jar:8.0.18]
... 8 common frames omitted
2015.09.29 05:58:32 INFO app[o.s.p.m.TerminatorThread] Process[search] is stopping
2015.09.29 05:58:32 INFO es[o.s.p.StopWatcher] Stopping process
2015.09.29 05:58:32 INFO es[o.elasticsearch.node] [sonar-1443520701614] stopping ...
2015.09.29 05:58:32 INFO es[o.elasticsearch.node] [sonar-1443520701614] stopped
2015.09.29 05:58:32 INFO es[o.elasticsearch.node] [sonar-1443520701614] closing ...
2015.09.29 05:58:32 INFO es[o.elasticsearch.node] [sonar-1443520701614] closed
2015.09.29 05:58:32 INFO app[o.s.p.m.TerminatorThread] Process[search] is stopped
<-- Wrapper Stopped
回答1:
We had this same issue and were able to resolve it by adding the hostname into /etc/hosts.
回答2:
"java.net.BindException: Cannot assign requested address"
it is mostly due to port conflicts. some other services on host might have used port 9000. change the default sonar port from 9000 to 9080 or any random port which is open.
sonar.web.port=9080
in sonar.properties file
and restart the sonar service.
to check logs on continuous basis , run
tailf <sonarqube-installation-directory>/logs/sonar.log
command.
To check whether 9000 port is occupied by any process or not, stop sonar service, kill sonar process if it is present and fire following command:
netstat -anp | grep 9000
来源:https://stackoverflow.com/questions/32842165/trying-to-install-sonarqube-on-linux-machine-but-getting-error