elasticsearch - Gitlab Elasticsearch Service 在管道运行期间未连接

标签 elasticsearch gitlab-ci

我们已经设法让 Mongo 和 PostgreSql 使用 Gitab 服务正常工作,但是我们面临着 Elasticsearch 的实际问题。

每当我们尝试运行管道时,与弹性的连接都会失败。

我在这个线程中尝试了以下步骤:
https://gitlab.com/gitlab-org/gitlab-ce/issues/42214
但仍然没有运气。

即两者

image: maven:latest

test:
  stage: test
services:
  - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4
  alias: elasticsearch
  command: [ "bin/elasticsearch", "-Ediscovery.type=single-node" ]

  stage: test
  script:
  - ps aux
  - ss -plantu
  - curl -v "http://elasticsearch:9200/_settings?pretty"

和:
image: maven:latest

test:
  stage: test
  services:
    - elasticsearch:6.5.4
  script:
  - curl -v "http://127.0.0.1:9200/"

导致连接错误。

有没有人为elasticsearch工作:6.5.4?

最佳答案

这是通过 15 秒的 sleep 线解决的。
ci 文件现在看起来像:

test:
  stage: test
  services:
  - name: docker.elastic.co/elasticsearch/elasticsearch:6.5.4
    command: ["bin/elasticsearch", "-Expack.security.enabled=false", "-Ediscovery.type=single-node"]
  script:
  - echo "Sleeping for 15 seconds.."; sleep 15;

关于elasticsearch - Gitlab Elasticsearch Service 在管道运行期间未连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54426637/

相关文章:

elasticsearch - 如何在 Elasticsearch 中使用 Java API 将响应按月份划分并添加计数器

search - 弹性(搜索): Get docs with max and min timestamp values

docker - 为什么Gitlab-CI在下一阶段会删除工件?

docker - Gitlab CI - 在开发服务器上部署 docker-compose.yml,测试并部署到 PD

ruby - 使用ElasticSearch ruby​​ gem按名称获取索引

python-3.x - 如何在Elasticsearch中计算每个 token 的总数

elasticsearch - Kibana将哪种持久性数据存储在path.data中?

docker - 如何在 GitLab CI 作业中使用 docker 构建缓存

gitlab - 如何在 gitlab-ci.yml 中指定图像平台

gitlab - 如何使用预制的 config.toml 注册/重新注册 Gitlab Runner?