问题一:
INFO app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
could not find java in ES_JAVA_HOME at /opt/java/openjdk/bin/java
解决方案:
出现此问题的原因是权限不足,需要以root权限启动
docker-compose.yml 文件里添加 :
privileged: true
问题二:
ERROR:[1] bootstrap checks failed.You must address the points described in the following [1]lines before starting Elasticsearchbootstrap check failure [1] of [1]: max virtual memory areas vm.max map_count [65530] is too liow, increase to at least [262144]
EROR:Elasticsearch did not exit normally - check the logs at /opt/sonarqube/logs/sonarqube.log
解决方案
在宿主机上修改
vim /etc/sysctl.conf
#在底部插入
vm.max_map_count=262144
#保存后执行以下命令生效
sysctl -p