部署了docker、ansible和authentication的elasticsearch群集

kkih6yb8  于 2021-06-10  发布在  ElasticSearch
关注(0)|答案(1)|浏览(399)

这将是一个奇怪的职位如何基本,但我卡住了。我已将此docker compose文件转换为一个可扩展的作业,以加速集群:

version: '2.2'
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.9.2
    container_name: es01
    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data01:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - elastic
  es02:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.9.2
    container_name: es02
    environment:
      - node.name=es02
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data02:/usr/share/elasticsearch/data
    networks:
      - elastic
  es03:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.9.2
    container_name: es03
    environment:
      - node.name=es03
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es02
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data03:/usr/share/elasticsearch/data
    networks:
      - elastic

volumes:
  data01:
    driver: local
  data02:
    driver: local
  data03:
    driver: local

networks:
  elastic:
    driver: bridge

问题是,当我向集群添加安全性时,集群返回一个master\u not\u discovered\u异常。我给es01增加的额外功能是 xpack.security.enabled: true , ELASTIC_PASSWORD: "password" 以及 xpack.security.transport.ssl.enabled: true 你知道接下来该怎么办吗?

xmakbtuz

xmakbtuz1#

添加

xpack.security.transport.ssl.enabled: true

要求您首先生成证书并将其添加到服务中,以便加密节点间通信。有几个步骤要做:
获取一些证书,至少自己生成ssl证书
通过卷将证书分发到所有节点
通过密钥库配置证书和密码
请先看一下加密通信的一般文档,然后再看一下docker的相关步骤。
如果您不想加密节点间通信,而是要加密http端点(restapi),那么´那是什么

xpack.security.http.ssl.enabled: true

是为你而生的。完成这项工作的程序与前一项非常相似,并包含在上述文件中。

相关问题