美文网首页
Docker搭建Elasticsearch 7.x集群

Docker搭建Elasticsearch 7.x集群

作者: 哦呵呵_3579 | 来源:发表于2019-10-08 19:26 被阅读0次

    记录通过Docker-Compose搭建es7集群遇到的坑,鉴于百度到的基本是es6的集群,直接复制黏贴基本无效,使用的docker-compose.yml如下:

    ```

    version: '3'

    services:

      elasticsearch:

        image: elasticsearch:7.3.1

        container_name: elasticsearch

        restart: always

        environment:

          - node.name=235

          - network.publish_host=10.100.103.235

          - network.host=0.0.0.0

          - discovery.seed_hosts=10.100.103.233,10.100.103.234,10.100.103.235

          - cluster.initial_master_nodes=10.100.103.233,10.100.103.234,10.100.103.235

          - cluster.name=es-cluster

          - bootstrap.memory_lock=true

          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"

        ports:

          - 9200:9200

          - 9300:9300

        ulimits:

          memlock:

            soft: -1

            hard: -1

    ```

    搭建完成之后调用http://10.100.103.233:9200/_cluster/health?pretty,检查集群是否运行正常

    相关文章

      网友评论

          本文标题:Docker搭建Elasticsearch 7.x集群

          本文链接:https://www.haomeiwen.com/subject/anwbkftx.html