美文网首页dockerIT技术篇
【4.9.4】服务器安装 Docker Swarm中搭建 ELK

【4.9.4】服务器安装 Docker Swarm中搭建 ELK

作者: 王滕辉 | 来源:发表于2021-08-24 15:41 被阅读0次

    这里es 没办法修改,需要docker run 单机模式启动测试没问题,修改好参数,在用docker stack 启动

    version: '3.6'
    services:
      elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
        environment:
          - cluster.name=docker-cluster
          - bootstrap.memory_lock=false
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        volumes:
          - /home/elasticsearch/data:/usr/share/elasticsearch/data
          #- /home/elasticsearch/etc/sysctl.conf:/etc/sysctl.conf:rw
        ports:
          - 9200:9200
        networks:
          - esnet
        deploy:
          placement:
            constraints:
              - node.role == manager
      elasticsearch2:
        image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
        environment:
          - cluster.name=docker-cluster
          - bootstrap.memory_lock=false
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
          - "discovery.zen.ping.unicast.hosts=elasticsearch"
        volumes:
          - /home/elasticsearch/data:/usr/share/elasticsearch/data
         # - /home/elasticsearch/etc/sysctl.conf:/etc/sysctl.conf:rw
        networks:
          - esnet
        deploy:
          placement:
            constraints:
              - node.role == worker
      logstash:
        image: docker.elastic.co/logstash/logstash:6.2.4
        environment:
          - "LS_JAVA_OPTS=-Xms256m -Xmx256m"
        networks:
          - esnet
        deploy:
          replicas: 2
          placement:
            constraints:
              - node.role == worker
      logstash2:
        image: docker.elastic.co/logstash/logstash:6.2.4
        environment:
          - "LS_JAVA_OPTS=-Xms256m -Xmx256m"
        networks:
          - esnet
        deploy:
          replicas: 2
          placement:
            constraints:
              - node.role == manager     
      kibana:
        image: docker.elastic.co/kibana/kibana:6.2.4
        ports:
          - "5601:5601"
        networks:
          - esnet
        deploy:
          placement:
            constraints:
              - node.role == worker
    
    
    networks:
      esnet:
        driver: "overlay"
    
    
    

    点波关注 系统搭建(docker)

    相关文章

      网友评论

        本文标题:【4.9.4】服务器安装 Docker Swarm中搭建 ELK

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