SonarQube 7.7 无法在 CentOS Linux 上启动

SonarQube 7.7 无法在 CentOS Linux 上启动

标题说明了一切。SonarQube 6.7.7 LTS 也出现了同样的错误,但我在这里只写了 7.7 的问题。我没有应该使用哪个版本的限制。

我从您的网站下载了 SonarQube 7.7。配置的限制如下:

# cat /etc/security/limits.conf | grep sonar
sonarqube   -   nofile   65536
sonarqube   -   nproc    4096

在 sysctl.conf 中我为以下事物设置了适当的值:

vm.max_map_count=262144
fs.file-max=65536

配置后我也应用了这些值。

将 zip 解压到 /opt/sonarqube/sonarqube-7.7 后,我将整个目录的所有权移交给新创建的用户 sonarqube:

chown -R sonarqube:sonarqube /opt/sonarqube

之后,我配置了 sonar.properties 如下(为了便于阅读,从配置中删除了注释):

sonar.jdbc.username=sonarq
sonar.jdbc.url=jdbc:postgresql://localhost/sonarq_production
http.proxyHost=aproxy.some.where
http.proxyUser=proxyuser
http.proxyPassword=proxypass

PostgreSQL 具有指定的 SQL 用户和数据库,并经过三重检查,它可以使用这些详细信息登录。

尝试使用以下方式启动 sonarqube 后

sudo -Hu sonarqube ./bin/linux-x86-64/sonar.sh console 

我得到了以下输出

Running SonarQube...
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    |
jvm 1    | 2019.06.12 16:51:43 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/sonarqube-7.7/temp
jvm 1    | 2019.06.12 16:51:43 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1    | 2019.06.12 16:51:43 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/sonarqube-7.7/elasticsearch]: /opt/sonarqube/sonarqube-7.7/elasticsearch/bin/elasticsearch
jvm 1    | 2019.06.12 16:51:44 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | 2019.06.12 16:51:44 INFO  app[][o.e.p.PluginsService] no modules loaded
jvm 1    | 2019.06.12 16:51:44 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1    | 2019.06.12 16:51:58 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
jvm 1    | 2019.06.12 16:51:58 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube/sonarqube-7.7]: /usr/java/jdk1.8.0_212-amd64/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/sonarqube-7.7/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.proxyHost=aproxy.some.where -Dhttps.proxyHost=aproxy.some.where -cp ./lib/common/*:/opt/sonarqube/sonarqube-7.7/lib/jdbc/postgresql/postgresql-42.2.5.jar org.sonar.server.app.WebServer /opt/sonarqube/sonarqube-7.7/temp/sq-process5107517876487134023properties
jvm 1    | 2019.06.12 16:52:03 INFO  app[][o.s.a.SchedulerImpl] Process [web] is stopped
jvm 1    | 2019.06.12 16:52:03 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
jvm 1    | 2019.06.12 16:52:03 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
jvm 1    | 2019.06.12 16:52:03 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
wrapper  | <-- Wrapper Stopped

es.log 说

2019.06.12 16:51:47 INFO  es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [44gb], net total_space [50.5gb], types [rootfs]
2019.06.12 16:51:47 INFO  es[][o.e.e.NodeEnvironment] heap size [495.3mb], compressed ordinary object pointers [true]
2019.06.12 16:51:47 INFO  es[][o.e.n.Node] node name [sonarqube], node ID [qT3jesniTNOvQuFTc150Lg]
2019.06.12 16:51:47 INFO  es[][o.e.n.Node] version[6.6.2], pid[10153], build[default/tar/3bd3e59/2019-03-06T15:16:26.864148Z], OS[Linux/3.10.0-957.5.1.el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_212/25.212-b10]
2019.06.12 16:51:47 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=/opt/sonarqube/sonarqube-7.7/temp/es6, -XX:ErrorFile=/opt/sonarqube/sonarqube-7.7/logs/es_hs_err_pid%p.log, -Xms512m, -Xmx512m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonarqube/sonarqube-7.7/elasticsearch, -Des.path.conf=/opt/sonarqube/sonarqube-7.7/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar]
2019.06.12 16:51:48 INFO  es[][o.e.p.PluginsService] loaded module [analysis-common]
2019.06.12 16:51:48 INFO  es[][o.e.p.PluginsService] loaded module [lang-painless]
2019.06.12 16:51:48 INFO  es[][o.e.p.PluginsService] loaded module [mapper-extras]
2019.06.12 16:51:48 INFO  es[][o.e.p.PluginsService] loaded module [parent-join]
2019.06.12 16:51:48 INFO  es[][o.e.p.PluginsService] loaded module [percolator]
2019.06.12 16:51:48 INFO  es[][o.e.p.PluginsService] loaded module [reindex]
2019.06.12 16:51:48 INFO  es[][o.e.p.PluginsService] loaded module [repository-url]
2019.06.12 16:51:48 INFO  es[][o.e.p.PluginsService] loaded module [transport-netty4]
2019.06.12 16:51:48 INFO  es[][o.e.p.PluginsService] no plugins loaded
2019.06.12 16:51:52 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.06.12 16:51:53 INFO  es[][o.e.d.DiscoveryModule] using discovery type [zen] and host providers [settings]
2019.06.12 16:51:54 INFO  es[][o.e.n.Node] initialized
2019.06.12 16:51:54 INFO  es[][o.e.n.Node] starting ...
2019.06.12 16:51:54 INFO  es[][o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2019.06.12 16:51:57 INFO  es[][o.e.c.s.MasterService] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {sonarqube}{qT3jesniTNOvQuFTc150Lg}{5wBh0CdCRxqzg0TXK1029Q}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}
2019.06.12 16:51:57 INFO  es[][o.e.c.s.ClusterApplierService] new_master {sonarqube}{qT3jesniTNOvQuFTc150Lg}{5wBh0CdCRxqzg0TXK1029Q}{127.0.0.1}{127.0.0.1:9001}{rack_id=sonarqube}, reason: apply cluster state (from master [master {sonarqube}{qT3jesniTNOvQuFTc150Lg}{5wBh0CdCRxqzg0TXK1029Q}{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.06.12 16:51:57 INFO  es[][o.e.n.Node] started
2019.06.12 16:51:57 INFO  es[][o.e.g.GatewayService] recovered [0] indices into cluster_state
2019.06.12 16:52:03 INFO  es[][o.e.n.Node] stopping ...
2019.06.12 16:52:03 INFO  es[][o.e.n.Node] stopped
2019.06.12 16:52:03 INFO  es[][o.e.n.Node] closing ...
2019.06.12 16:52:03 INFO  es[][o.e.n.Node] closed

说我瞎子也行,但我看不出 ES 无法继续运行的原因。我尝试将 ES JVM 参数设置为更大的内存(1G、2G),但没有成功。我检查了系统日志,其中没有关于 ES 或任何其他基于 Java 的进程的任何信息。

笔记:我尝试阅读有关如何安装 SonarQube 的所有文档,并按照不同的指南正确重新启动,但均未成功。请不要问我是否尝试过重新安装它或重建整个机器。我是 SonarQube 新手,但不是 Linux 管理新手。如果我需要做某事,请解释为什么您认为我需要这样做,因为最终我必须编写有关此的系统文档,并且我必须完全了解发生了什么。

相关内容