sonarqube系列一、安装部署
docker 安装
docker pull postgres
docker pull sonarqube
[[email protected] ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/postgres latest b97bae343e06 9 days ago 313 MB
docker.io/sonarqube latest d05d6af6a6b7 5 weeks ago 457 MB
docker run --name db --restart=always -e POSTGRES_USER=sonar -e POSTGRES_PASSWORD=sonar -p 5432:5432 -d postgres
docker run --name sq --restart=always -e "SONARQUBE_JDBC_URL=jdbc:postgresql://192.168.1.75:5432/sonar" -e "SONARQUBE_JDBC_USERNAME=sonar" -e "SONARQUBE_JDBC_PASSWORD=sonar" -p 8082:9000 -d sonarqube
[[email protected] ~]# docker logs sq
2020.06.19 02:40:24 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2020.06.19 02:40:24 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.06.19 02:40:25 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2020.06.19 02:40:25 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2020.06.19 02:40:25 INFO app[][o.e.p.PluginsService] no modules loaded
2020.06.19 02:40:25 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.
2020.06.19 02:40:28 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [29.6gb], net total_space [39.2gb], types [rootfs]
2020.06.19 02:40:28 INFO es[][o.e.e.NodeEnvironment] heap size [495.3mb], compressed ordinary object pointers [true]
2020.06.19 02:40:28 INFO es[][o.e.n.Node] node name [sonarqube], node ID [gpbgDSi-SlKpMGzoG7gadw]
2020.06.19 02:40:28 INFO es[][o.e.n.Node] version[6.8.4], pid[36], build[default/tar/bca0c8d/2019-10-16T06:19:49.319352Z], OS[Linux/3.10.0-693.11.6.el7.x86_64/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/11.0.6/11.0.6+10]
2020.06.19 02:40:28 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/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -Des.enforce.bootstrap.checks=true, -Xmx512m,-Xms512m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar]
2020.06.19 02:40:29 INFO es[][o.e.p.PluginsService] loaded module [analysis-common]
2020.06.19 02:40:29 INFO es[][o.e.p.PluginsService] loaded module [lang-painless]
2020.06.19 02:40:29 INFO es[][o.e.p.PluginsService] loaded module [mapper-extras]
2020.06.19 02:40:29 INFO es[][o.e.p.PluginsService] loaded module [parent-join]
2020.06.19 02:40:29 INFO es[][o.e.p.PluginsService] loaded module [percolator]
2020.06.19 02:40:29 INFO es[][o.e.p.PluginsService] loaded module [reindex]
2020.06.19 02:40:29 INFO es[][o.e.p.PluginsService] loaded module [repository-url]
2020.06.19 02:40:29 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4]
2020.06.19 02:40:29 INFO es[][o.e.p.PluginsService] no plugins loaded
2020.06.19 02:40:31 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.
2020.06.19 02:40:32 INFO es[][o.e.d.DiscoveryModule] using discovery type [zen] and host providers [settings]
2020.06.19 02:40:33 INFO es[][o.e.n.Node] initialized
2020.06.19 02:40:33 INFO es[][o.e.n.Node] starting ...
2020.06.19 02:40:33 INFO es[][o.e.t.TransportService] publish_address {127.0.0.1:9001}, bound_addresses {127.0.0.1:9001}
2020.06.19 02:40:33 INFO es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
增加最大虚拟内存
[[email protected] ~]# vim /etc/sysctl.conf
vm.max_map_count=262144
sysctl -p
登录
http://192.168.1.75:8082/projects
admin/admin
汉化
页面上扎到 Administration > Marketplace ,在搜索框中输入 chinese ,出现一个 Chinese Pack ,点击右侧的 install 按钮。
安装成功后,会提示重启 SonarQube 服务器。
稍等一会,再看页面上已经显示中文了。
参考:
https://www.cnblogs.com/7tiny/p/11269774.html
https://docs.sonarqube.org/latest/setup/install-server/