2013-10-01 64 views
4

我在遠程Linux cent OS服務器上安裝了聲吶。我已經在同一臺服務器上配置了數據庫。當我啓動服務器時,在日誌中看不到任何錯誤,並且聲納似乎正在運行。 消息: [聲納] $ ./bin/linux-x86-64/sonar.sh狀態 聲納正在運行(13429)。無法在瀏覽器上打開遠程安裝的聲吶

但是,當我嘗試從我的Windows PC通過瀏覽器訪問聲納,它給我一個連接超時錯誤。 我試圖通過鉻和Firefox瀏覽器訪問以下URL。 http://:9000/sonar 這是正確的方法嗎? 還有什麼我在這裏失蹤?我還沒有設置任何其他像maven/jenkins/tomcat集成或其他任何東西。任何幫助,將不勝感激。

Following are the values I had given: 
sonar.web.host:       127.0.0.1 
sonar.web.port:       9000 
sonar.web.context:      /sonar 

日誌:

STATUS | wrapper | 2013/10/01 11:08:57 | --> Wrapper Started as Daemon 
STATUS | wrapper | 2013/10/01 11:08:58 | Launching a JVM... 
INFO | jvm 1 | 2013/10/01 11:08:58 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org 
INFO | jvm 1 | 2013/10/01 11:08:58 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved. 
INFO | jvm 1 | 2013/10/01 11:08:58 | 
INFO | jvm 1 | 2013/10/01 11:08:58 | 2013-10-01 11:08:58.578:INFO:oejs.Server:jetty-7.6.11.v20130520 
2013.10.01 11:09:01 INFO o.s.s.p.ServerImpl SonarQube Server/3.7.1/7f8f4d0f0b0044f178d587b8680032734d4fb578 
2013.10.01 11:09:01 INFO o.s.c.p.Database Create JDBC datasource for jdbc:mysql://localhost:3306/sonarqube?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatem 
ents=true 
2013.10.01 11:09:02 INFO o.s.s.p.DefaultServerFileSystem SonarQube home: /apps/sonar 
2013.10.01 11:09:02 INFO o.s.s.p.DefaultServerFileSystem Deploy dir: /apps/sonar/war/sonar-server/deploy 
2013.10.01 11:09:02 INFO org.sonar.INFO Install plugins... 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin Findbugs/1.3/4d7d78e9340e39f53bbf202ed16d1253e6507c36 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin JaCoCo/1.3/4d7d78e9340e39f53bbf202ed16d1253e6507c36 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin English Pack/3.7.1/7f8f4d0f0b0044f178d587b8680032734d4fb578 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin Maven Batch Plugin/3.7.1/7f8f4d0f0b0044f178d587b8680032734d4fb578 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin Surefire/1.3/4d7d78e9340e39f53bbf202ed16d1253e6507c36 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin Duplications/3.7.1/7f8f4d0f0b0044f178d587b8680032734d4fb578 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin Checkstyle/1.3/4d7d78e9340e39f53bbf202ed16d1253e6507c36 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin PMD/1.3/4d7d78e9340e39f53bbf202ed16d1253e6507c36 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin Java/1.3/4d7d78e9340e39f53bbf202ed16d1253e6507c36 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin Core/3.7.1/7f8f4d0f0b0044f178d587b8680032734d4fb578 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin Database Cleaner/3.7.1/7f8f4d0f0b0044f178d587b8680032734d4fb578 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin Squid for Java/1.3/4d7d78e9340e39f53bbf202ed16d1253e6507c36 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin Email notifications/3.7.1/7f8f4d0f0b0044f178d587b8680032734d4fb578 
2013.10.01 11:09:03 INFO o.s.s.p.PluginDeployer Deploy plugin Design/3.7.1/7f8f4d0f0b0044f178d587b8680032734d4fb578 
2013.10.01 11:09:03 INFO org.sonar.INFO Install plugins done: 241 ms 
2013.10.01 11:09:03 INFO o.s.s.p.ApplicationDeployer Deploy Ruby on Rails applications 
2013.10.01 11:09:03 INFO org.sonar.INFO Start components... 
2013.10.01 11:09:03 INFO o.s.j.s.AbstractDatabaseConnector Initializing Hibernate 
2013.10.01 11:09:05 INFO o.s.s.p.UpdateCenterClient Update center: http://update.sonarsource.org/update-center.properties (no proxy) 
2013.10.01 11:09:05 INFO o.s.s.n.NotificationService Notification service started (delay 60 sec.) 
2013.10.01 11:09:05 INFO org.sonar.INFO Deploy GWT plugins... 
2013.10.01 11:09:05 INFO org.sonar.INFO Deploy org.sonar.plugins.design.ui.libraries.LibrariesPage to /apps/sonar/war/sonar-server/deploy/gwt 
2013.10.01 11:09:05 INFO org.sonar.INFO Deploy org.sonar.plugins.design.ui.page.DesignPage to /apps/sonar/war/sonar-server/deploy/gwt 
2013.10.01 11:09:05 INFO org.sonar.INFO Deploy GWT plugins done: 32 ms 
2013.10.01 11:09:05 INFO org.sonar.INFO Load metrics... 
2013.10.01 11:09:06 INFO o.s.s.s.RegisterMetrics cleaning alert thresholds... 
2013.10.01 11:09:06 INFO org.sonar.INFO Load metrics done: 498 ms 
2013.10.01 11:09:06 INFO org.sonar.INFO Register rules [findbugs/java]... 
2013.10.01 11:09:07 INFO org.sonar.INFO Register rules [findbugs/java] done: 611 ms 
2013.10.01 11:09:07 INFO org.sonar.INFO Register rules [checkstyle/java]... 
2013.10.01 11:09:07 INFO org.sonar.INFO Register rules [checkstyle/java] done: 543 ms 
2013.10.01 11:09:07 INFO org.sonar.INFO Register rules [pmd/java]... 
2013.10.01 11:09:08 INFO org.sonar.INFO Register rules [pmd/java] done: 841 ms 
2013.10.01 11:09:08 INFO org.sonar.INFO Register rules [pmd-unit-tests/java]... 
2013.10.01 11:09:08 INFO org.sonar.INFO Register rules [pmd-unit-tests/java] done: 38 ms 
2013.10.01 11:09:08 INFO org.sonar.INFO Register rules [squid/java]... 
2013.10.01 11:09:08 INFO org.sonar.INFO Register rules [squid/java] done: 220 ms 
2013.10.01 11:09:08 INFO org.sonar.INFO Register rules [common-java/java]... 
2013.10.01 11:09:08 INFO org.sonar.INFO Register rules [common-java/java] done: 6 ms 
2013.10.01 11:09:08 INFO o.s.s.s.RegisterRules Removing deprecated rules 
2013.10.01 11:09:09 INFO o.s.s.s.RegisterNewProfiles Register Quality Profiles... 
2013.10.01 11:09:11 INFO o.s.s.s.RegisterNewProfiles Register Quality Profiles done: 2401 ms 
2013.10.01 11:09:11 INFO o.s.s.s.RegisterQualityModels Register Quality Models... 
2013.10.01 11:09:11 INFO o.s.s.s.RegisterQualityModels Register Quality Models done: 0 ms 
2013.10.01 11:09:12 INFO o.s.s.s.RegisterNewMeasureFilters Register measure filters... 
2013.10.01 11:09:12 INFO o.s.s.s.RegisterNewMeasureFilters Register measure filters done: 6 ms 
2013.10.01 11:09:12 INFO o.s.s.s.RegisterNewDashboards Register dashboards... 
2013.10.01 11:09:12 INFO o.s.s.s.RegisterNewDashboards Register dashboards done: 18 ms 
2013.10.01 11:09:12 INFO o.s.s.s.RegisterPermissionTemplates Register permission templates... 
2013.10.01 11:09:12 INFO o.s.s.s.RegisterPermissionTemplates Register permission templates done: 2 ms 
2013.10.01 11:09:12 INFO o.s.s.s.RenameDeprecatedPropertyKeys Rename deprecated property keys 
2013.10.01 11:09:12 INFO org.sonar.INFO Start components done: 8602 ms 
2013.10.01 11:09:12 INFO jruby.rack jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_22) [linux-amd64-java] 
2013.10.01 11:09:12 INFO jruby.rack using a shared (threadsafe!) runtime 
INFO | jvm 1 | 2013/10/01 11:09:18 | JRuby limited openssl loaded. http://jruby.org/openssl 
INFO | jvm 1 | 2013/10/01 11:09:18 | gem install jruby-openssl for full support. 
INFO | jvm 1 | 2013/10/01 11:09:26 | 2013-10-01 11:09:26.032:INFO:oejsh.ContextHandler:started o.e.j.w.WebAppContext{/sonar,file:/apps/sonar/war/sonar-server/},file:/apps/sonar/war/sonar-server 
INFO | jvm 1 | 2013/10/01 11:09:26 | 2013-10-01 11:09:26.107:INFO:oejs.AbstractConnector:Started [email protected]:9000 

在聲納目錄中的文件夾的權限:

drwxrwxrwx 13 usr grp  4096 Sep 30 15:53 bin 
drwxrwxrwx 2 usr grp  4096 Oct 1 12:36 conf 
-rwxrwxrwx 1 usr grp  7651 Sep 30 15:53 COPYING 
drwxrwxrwx 2 usr grp  4096 Sep 30 15:53 data 
drwxrwxrwx 7 usr grp  4096 Sep 30 16:02 extensions 
drwxrwxrwx 3 usr grp  4096 Sep 30 15:53 lib 
drwxrwxrwx 2 usr grp  4096 Oct 1 10:23 logs 
-rwxrwxrwx 1 usr grp 74135040 Sep 30 15:17 sonar.tar 
drwxrwxrwx 3 usr grp  4096 Oct 1 12:58 temp 
drwxrwxrwx 4 usr grp  4096 Sep 30 15:53 war 

感謝, ñ

回答

6

在您的服務器的sonar.properties文件,你需要設置的主機信息爲了遠程訪問服務器。

具體而言,您需要設置以下值:

sonar.web.host: 192.168.1.1 #use your server IP here 
sonar.web.port: 80 #set this if you want a different port than 9000 

此外,在網絡界面的設置區域,在「常規」部分下,設置「服務器基本URL」值,以便在鏈接生成電子郵件等,指向正確的位置。這也可以在sonar.properties文件中設置爲sonar.core.serverBaseURL

不要忘記重新啓動Sonar服務以使更改生效。

+0

謝謝約翰。已經做出了改變。但是,我沒有到達UI屏幕。儘管聲納目錄中的文件具有完全許可,但還是有另一種類型的許可問題 – NixRam

4

默認情況下聲納監聽本地主機上,因此您可以通過只有本地主機訪問聲納,你必須讓它在遠程主機上監聽在sonar-runner.properties中更改參數url。你必須保持Linux服務器,而不是127.0.0.1的本地IP

感謝&問候,
阿洛克Thaker

+1

似乎有一個與端口的問題。它不是由服務器管理員打開的。該端口現在打開,我已將sonar.web.host的值更改爲遠程計算機的IP地址。現在我收到了一個權限錯誤:java.lang.IllegalStateException:無法創建以下目錄:/ apps/sonar/war/sonar-server/deploy at org.sonar.server.platform.DefaultServerFileSystem.start(DefaultServerFileSystem。 java:89)〜[classes /:na] – NixRam

+0

我已經在sonar中添加了目錄的權限。 – NixRam

1

我的問題是,我不得不允許在iptables中添加端口,並且不添加(默認)它,而是將其添加到規則「drop all」之前,否則後面的所有內容都將被否定。

命令:

iptables -I INPUT 1 -p tcp --dport 9000 -j ACCEPT 

,其中1 - 定義在其中的iptable的規則(第一)位置,以將其添加