我已经在 aws ecs 中设置了一个 sonarqube,与 ec2 兼容。我将声纳扩展和 elasticsearch 数据文件夹安装到 efs 接入点。它运行得很顺利,直到另一个 ecs sonarqube 任务扩大规模,但因以下问题而失败,我认为这是一个 elasticsearch efs 问题。
java.lang.IllegalStateException: failed to obtain node locks, tried [/opt/sonarqube/data/es8]; maybe these locations are not writable or multiple nodes were started on the same data path?
我已设置我的 efs 接入点 Posix 用户=1000:1000 创建信息=1000:1000(0750)
对此可以做什么?预先感谢。
SonarQube 的免费开源版本不支持一次运行多个实例。此外,运行嵌入式 Elasticsearch 服务器一次只能运行一个实例。因此,要将 SonarQube 扩展到单个节点之外,您必须使用 SonarQube 的付费版本之一,并且还需要在容器外部运行 Elasticsearch。 SonarQube 的数据中心版本实际上是唯一将“水平可扩展性”列为受支持功能的版本。
如果您只想在 ECS 中运行单个实例,并且能够进行部署而不会遇到此错误,那么您可以将 Desired Count 设置为1
,禁用自动扩展,并将 ECS 部署最大百分比设置为
100
,部署最低健康百分比为
0
。这将导致部署期间出现一些停机时间,但这是避免运行 SonarQube 的多个实例时发生锁定问题的唯一方法。