Sonarqube lts-Community与Docker不起作用
我一直试图与Docker合作很长一段时间。数据库正在运行,但Sonarqube没有运行。我将Portainer用于实施。 我使用以下Docker-Compose文件进行启动Sonarqube:
version: "3"
services:
sonarqube:
image: sonarqube:lts-community
container_name: sonarqube
restart: unless-stopped
environment:
- SONARQUBE_JDBC_USERNAME=admin
- SONARQUBE_JDBC_PASSWORD=admin
- SONARQUBE_JDBC_URL=jdbc:postgresql://sonar_db:5432/sonarqube
networks:
- sonarnet
ports:
- "9901:9000"
- "9092:9092"
volumes:
- sonarqube_conf:/opt/sonarqube/conf
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins
sonar_db:
image: postgres:latest
container_name: sonar_db
restart: unless-stopped
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=sonarqube
volumes:
- sonarqube_db:/var/lib/postgresql10
- postgresql_data:/var/lib/postgresql10/data
networks:
- sonarnet
volumes:
postgresql_data:
sonarqube_bundled-plugins:
sonarqube_conf:
sonarqube_data:
sonarqube_db:
sonarqube_extensions:
networks:
sonarnet:
我会收到以下错误:
2022.07.03 12:32:22 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2022.07.03 12:32:22 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:46345]
2022.07.03 12:32:22 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2022.07.03 12:32:22 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
2022.07.03 12:32:25 INFO es[][o.e.n.Node] version[7.16.2], pid[37], build[default/tar/2b937c44140b6559905130a8650c64dbd0879cfb/2021-12-18T19:42:46.604893745Z], OS[Linux/5.15.0-40-generic/amd64], JVM[Eclipse Adoptium/OpenJDK 64-Bit Server VM/11.0.13/11.0.13+8]
2022.07.03 12:32:25 INFO es[][o.e.n.Node] JVM home [/opt/java/openjdk]
2022.07.03 12:32:25 INFO es[][o.e.n.Node] JVM arguments [-XX:+UseG1GC, -Djava.io.tmpdir=/opt/sonarqube/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -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, -Djna.tmpdir=/opt/sonarqube/temp, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=COMPAT, -Des.enforce.bootstrap.checks=true, -Xmx512m, -Xms512m, -XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=false]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [analysis-common]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [lang-painless]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [parent-join]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [reindex]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] no plugins loaded
2022.07.03 12:32:25 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/opt/sonarqube/data (/dev/mapper/vg00-lv01)]], net usable_space [205.6gb], net total_space [237.2gb], types [ext4]
2022.07.03 12:32:25 INFO es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2022.07.03 12:32:25 INFO es[][o.e.n.Node] node name [sonarqube], node ID [WAGp0sgmR0GCiwR4b935Hw], cluster name [sonarqube], roles [data_frozen, master, remote_cluster_client, data, data_content, data_hot, data_warm, data_cold, ingest]
2022.07.03 12:32:30 INFO es[][o.e.t.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=256kb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=1mb, heap_size=512mb}]
2022.07.03 12:32:30 INFO es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2022.07.03 12:32:31 INFO es[][o.e.g.DanglingIndicesState] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
2022.07.03 12:32:31 INFO es[][o.e.n.Node] initialized
2022.07.03 12:32:31 INFO es[][o.e.n.Node] starting ...
2022.07.03 12:32:31 INFO es[][o.e.t.TransportService] publish_address {127.0.0.1:46345}, bound_addresses {127.0.0.1:46345}
2022.07.03 12:32:32 INFO es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /opt/sonarqube/logs/sonarqube.log
2022.07.03 12:32:32 INFO es[][o.e.n.Node] stopping ...
2022.07.03 12:32:32 INFO es[][o.e.n.Node] stopped
2022.07.03 12:32:32 INFO es[][o.e.n.Node] closing ...
2022.07.03 12:32:32 INFO es[][o.e.n.Node] closed
2022.07.03 12:32:32 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 78
2022.07.03 12:32:32 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2022.07.03 12:32:32 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
Sonarqube图片:Sonarqube:LTS-Community(版本8.9.9.56886) Docker-Compose版本:1.27.4 Postgres图像:14.4-1
有人可以帮助我吗?
I've been trying to run sonarqube with docker compose for a long time. The database is running but sonarqube is not running. I use portainer for the implementation.
I use the following docker-compose file to start-up sonarqube:
version: "3"
services:
sonarqube:
image: sonarqube:lts-community
container_name: sonarqube
restart: unless-stopped
environment:
- SONARQUBE_JDBC_USERNAME=admin
- SONARQUBE_JDBC_PASSWORD=admin
- SONARQUBE_JDBC_URL=jdbc:postgresql://sonar_db:5432/sonarqube
networks:
- sonarnet
ports:
- "9901:9000"
- "9092:9092"
volumes:
- sonarqube_conf:/opt/sonarqube/conf
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins
sonar_db:
image: postgres:latest
container_name: sonar_db
restart: unless-stopped
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=sonarqube
volumes:
- sonarqube_db:/var/lib/postgresql10
- postgresql_data:/var/lib/postgresql10/data
networks:
- sonarnet
volumes:
postgresql_data:
sonarqube_bundled-plugins:
sonarqube_conf:
sonarqube_data:
sonarqube_db:
sonarqube_extensions:
networks:
sonarnet:
I get the following error:
2022.07.03 12:32:22 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
2022.07.03 12:32:22 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:46345]
2022.07.03 12:32:22 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
2022.07.03 12:32:22 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
2022.07.03 12:32:25 INFO es[][o.e.n.Node] version[7.16.2], pid[37], build[default/tar/2b937c44140b6559905130a8650c64dbd0879cfb/2021-12-18T19:42:46.604893745Z], OS[Linux/5.15.0-40-generic/amd64], JVM[Eclipse Adoptium/OpenJDK 64-Bit Server VM/11.0.13/11.0.13+8]
2022.07.03 12:32:25 INFO es[][o.e.n.Node] JVM home [/opt/java/openjdk]
2022.07.03 12:32:25 INFO es[][o.e.n.Node] JVM arguments [-XX:+UseG1GC, -Djava.io.tmpdir=/opt/sonarqube/temp, -XX:ErrorFile=../logs/es_hs_err_pid%p.log, -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, -Djna.tmpdir=/opt/sonarqube/temp, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=COMPAT, -Des.enforce.bootstrap.checks=true, -Xmx512m, -Xms512m, -XX:MaxDirectMemorySize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/opt/sonarqube/elasticsearch, -Des.path.conf=/opt/sonarqube/temp/conf/es, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=false]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [analysis-common]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [lang-painless]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [parent-join]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [reindex]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] loaded module [transport-netty4]
2022.07.03 12:32:25 INFO es[][o.e.p.PluginsService] no plugins loaded
2022.07.03 12:32:25 INFO es[][o.e.e.NodeEnvironment] using [1] data paths, mounts [[/opt/sonarqube/data (/dev/mapper/vg00-lv01)]], net usable_space [205.6gb], net total_space [237.2gb], types [ext4]
2022.07.03 12:32:25 INFO es[][o.e.e.NodeEnvironment] heap size [512mb], compressed ordinary object pointers [true]
2022.07.03 12:32:25 INFO es[][o.e.n.Node] node name [sonarqube], node ID [WAGp0sgmR0GCiwR4b935Hw], cluster name [sonarqube], roles [data_frozen, master, remote_cluster_client, data, data_content, data_hot, data_warm, data_cold, ingest]
2022.07.03 12:32:30 INFO es[][o.e.t.NettyAllocator] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=256kb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=true, g1gc_region_size=1mb, heap_size=512mb}]
2022.07.03 12:32:30 INFO es[][o.e.d.DiscoveryModule] using discovery type [zen] and seed hosts providers [settings]
2022.07.03 12:32:31 INFO es[][o.e.g.DanglingIndicesState] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
2022.07.03 12:32:31 INFO es[][o.e.n.Node] initialized
2022.07.03 12:32:31 INFO es[][o.e.n.Node] starting ...
2022.07.03 12:32:31 INFO es[][o.e.t.TransportService] publish_address {127.0.0.1:46345}, bound_addresses {127.0.0.1:46345}
2022.07.03 12:32:32 INFO es[][o.e.b.BootstrapChecks] explicitly enforcing bootstrap checks
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /opt/sonarqube/logs/sonarqube.log
2022.07.03 12:32:32 INFO es[][o.e.n.Node] stopping ...
2022.07.03 12:32:32 INFO es[][o.e.n.Node] stopped
2022.07.03 12:32:32 INFO es[][o.e.n.Node] closing ...
2022.07.03 12:32:32 INFO es[][o.e.n.Node] closed
2022.07.03 12:32:32 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 78
2022.07.03 12:32:32 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2022.07.03 12:32:32 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
sonarqube image: sonarqube:lts-community (version 8.9.9.56886 )
docker-compose version: 1.27.4
postgres image: 14.4-1
Can anyone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我用
:
I fixed with:
and