首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >设置用户密码时发生Master_not_discovered_exception错误

设置用户密码时发生Master_not_discovered_exception错误
EN

Stack Overflow用户
提问于 2022-11-03 07:54:32
回答 1查看 78关注 0票数 0

在为内置ES帐户设置密码时,登录到新安装的3节点集群docker exec -it es01 sh,然后运行bin/elasticsearch-setup-passwords interactive --url https://localhost:9200

获取错误: sh-5.0# bin/elasticsearch-设置-密码交互--url https://localhost:9200

代码语言:javascript
复制
Failed to determine the health of the cluster running at https://localhost:9200
Unexpected response code [503] from calling GET https://localhost:9200/_cluster/health?pretty
Cause: master_not_discovered_exception

还会在错误下面抛出卷曲:

代码语言:javascript
复制
sudo curl -X GET 'https://localhost:9200'
curl: (7) Failed connect to localhost:9200; Connection refused

sudo curl -X GET 'https://localhost:9216'
curl: (35) Encountered end of file

各个节点的.P12证书已被传输。低于elasticsearch.yml

代码语言:javascript
复制
cluster.name: "docker-cluster"
network.host: 0.0.0.0

已经设置了一个3节点弹力搜索集群使用坞-合成。遵循以下步骤:

  1. 初始化一个码头群。在ES11上运行码头群。按照指示将12和13连接到蜂群中。
  2. 创建覆盖网络对接器网络创建-d覆盖-可附加弹性
  3. 如果有必要,请关闭当前集群,并通过运行docker-compose -v删除所有相关卷。
  4. 为ES创建SSL证书并编写-f -create-certs.ymlrun-rm create_certs
  5. 将es02和03的证书复制到各自的服务器上
  6. 使用此busybox在02和03 sudo运行-itd -名称containerX -net网络名称busybox上创建覆盖网络。
  7. 使用docker配置02和03证书-组合-f配置-certs.yml运行-rm config_certs
  8. 使用docker启动集群-在每个服务器上组合-d
  9. 通过登录到集群停靠程序exec -it es11 sh,为内置的ES帐户设置密码,然后运行bin/elasticsearch--设置-密码交互-url localhost:9200

获取步骤9中提到的错误。我遗漏了什么?

下面是docker-compose.yml文件

代码语言:javascript
复制
version: '2.2'

services:
  es11:
    image: docker.elastic.co/elasticsearch/elasticsearch:${VERSION}
    container_name: es11
    environment:
      - node.name=es11
      - transport.port=9316
      - cluster.name=uat-lands
      - discovery.seed_hosts=es12,es13
      - cluster.initial_master_nodes=es11,es12,es13
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms4096m -Xmx4096m"
      - xpack.security.enabled=true
      - xpack.security.http.ssl.enabled=true
      - xpack.security.http.ssl.verification_mode=certificate
      - xpack.security.http.ssl.keystore.path=${CERTS_DIR}/es11/es11.p12
      - xpack.security.http.ssl.truststore.path=${CERTS_DIR}/es11/es11.p12
      - xpack.security.transport.ssl.enabled=true
      - xpack.security.transport.ssl.verification_mode=certificate
      - xpack.security.transport.ssl.keystore.path=${CERTS_DIR}/es11/es11.p12
      - xpack.security.transport.ssl.truststore.path=${CERTS_DIR}/es11/es11.p12
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data:/usr/share/elasticsearch/data
      - config:/usr/share/elasticsearch/config
      - log:/usr/share/elasticsearch/logs
    ports:
      - 9216:9200
      - 9316:9316
    networks:
      - elastic
    dns:
      - es11

    healthcheck:
      test: curl -k -s https://localhost:9200 >/dev/null; if [[ $$? == 52 ]]; then echo 0; else echo 1; fi
      interval: 30s
      timeout: 10s
      retries: 5

volumes:
  data:
    driver: local
    driver_opts:
  config:
    driver: local
    driver_opts:
      type: none
      device: '/mnt/elasticmount/es11/config'
      o: bind
  log:
    driver: local
    driver_opts:
      type: none
      device: '/mnt/elasticmount/es11/log'
      o: bind

networks:
  elastic:
    driver: overlay
EN

回答 1

Stack Overflow用户

发布于 2022-11-03 09:20:11

未配置群集。我不知道你是怎么创造出来的。使用弹性文档启动停靠库中的集群。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74299644

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档