zoukankan      html  css  js  c++  java
  • 使用docker-compose方式部署es和kibana以及cerebro

    使用的镜像可以从这个网站查看最新的:https://hub.docker.com/

    参考极客时间上的教程转发来的

    使用步骤:安装docker和docker-compose

    运行:

    docker-compose up -d
    docker-compose ps
    docker-compose down
    docker stop/rm ContainerID
    
    # docker-compose ps                                                              
       Name                  Command               State                Ports              
    ---------------------------------------------------------------------------------------
    es7_cold      /tini -- /usr/local/bin/do ...   Up      9200/tcp, 9300/tcp              
    es7_hot       /tini -- /usr/local/bin/do ...   Up      0.0.0.0:9200->9200/tcp, 9300/tcp
    es7_warm      /tini -- /usr/local/bin/do ...   Up      9200/tcp, 9300/tcp              
    hwc_cerebro   /opt/cerebro/bin/cerebro - ...   Up      0.0.0.0:9000->9000/tcp          
    hwc_kibana7   /usr/local/bin/dumb-init - ...   Up      0.0.0.0:5601->5601/tcp 
    

    es单节点和kibana

    version: '2.2'
    services:
      kibana:
        image: docker.elastic.co/kibana/kibana:7.3.0
        container_name: kibana73
        environment:
          - I18N_LOCALE=zh-CN
          - XPACK_GRAPH_ENABLED=true
          - TIMELION_ENABLED=true
          - XPACK_MONITORING_COLLECTION_ENABLED="true"
        ports:
          - "5601:5601"
        networks:
          - es7net
      elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.1.0
        container_name: es73
        environment:
          - cluster.name=geektime
          - node.name=es73
          - bootstrap.memory_lock=true
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
          - discovery.seed_hosts=es73
          - cluster.initial_master_nodes=es73
        ulimits:
          memlock:
            soft: -1
            hard: -1
        volumes:
          - es73data1:/usr/share/elasticsearch/data
        ports:
          - 9200:9200
        networks:
          - es73net
    
    
    volumes:
      es73data1:
        driver: local
    
    networks:
      es73net:
        driver: bridge
    
    

    es两节点集群和kibana

    version: '2.2'
    services:
      cerebro:
        image: lmenezes/cerebro:0.8.3
        container_name: cerebro
        ports:
          - "9000:9000"
        command:
          - -Dhosts.0.host=http://elasticsearch:9200
        networks:
          - es72net
      kibana:
        image: docker.elastic.co/kibana/kibana:7.2.0
        container_name: kibana72
        environment:
          #- I18N_LOCALE=zh-CN
          - XPACK_GRAPH_ENABLED=true
          - TIMELION_ENABLED=true
          - XPACK_MONITORING_COLLECTION_ENABLED="true"
        ports:
          - "5601:5601"
        networks:
          - es72net
      elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0
        container_name: es72_01
        environment:
          - cluster.name=geektime
          - node.name=es72_01
          - bootstrap.memory_lock=true
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
          - discovery.seed_hosts=es72_01,es72_02
          - network.publish_host=elasticsearch
          - cluster.initial_master_nodes=es72_01,es72_02
        ulimits:
          memlock:
            soft: -1
            hard: -1
        volumes:
          - es72data1:/usr/share/elasticsearch/data
        ports:
          - 9200:9200
        networks:
          - es72net
      elasticsearch2:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0
        container_name: es72_02
        environment:
          - cluster.name=geektime
          - node.name=es72_02
          - bootstrap.memory_lock=true
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
          - discovery.seed_hosts=es72_01,es72_02
          - network.publish_host=elasticsearch
          - cluster.initial_master_nodes=es72_01,es72_02
        ulimits:
          memlock:
            soft: -1
            hard: -1
        volumes:
          - es72data2:/usr/share/elasticsearch/data
        networks:
          - es72net
    
    
    volumes:
      es72data1:
        driver: local
      es72data2:
        driver: local
    
    networks:
      es72net:
        driver: bridge
    
    

    es两节点集群,kibana和cerebro

    version: '2.2'
    services:
      cerebro:
        image: lmenezes/cerebro:0.8.3
        container_name: cerebro
        ports:
          - "9000:9000"
        command:
          - -Dhosts.0.host=http://elasticsearch:9200
        networks:
          - es7net
      kibana:
        image: docker.elastic.co/kibana/kibana:7.1.0
        container_name: kibana7
        environment:
          - I18N_LOCALE=zh-CN
          - XPACK_GRAPH_ENABLED=true
          - TIMELION_ENABLED=true
          - XPACK_MONITORING_COLLECTION_ENABLED="true"
        ports:
          - "5601:5601"
        networks:
          - es7net
      elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.1.0
        container_name: es7_01
        environment:
          - cluster.name=geektime
          - node.name=es7_01
          - bootstrap.memory_lock=true
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
          - discovery.seed_hosts=es7_01,es7_02
          - cluster.initial_master_nodes=es7_01,es7_02
        ulimits:
          memlock:
            soft: -1
            hard: -1
        volumes:
          - es7data1:/usr/share/elasticsearch/data
        ports:
          - 9200:9200
        networks:
          - es7net
      elasticsearch2:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.1.0
        container_name: es7_02
        environment:
          - cluster.name=geektime
          - node.name=es7_02
          - bootstrap.memory_lock=true
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
          - discovery.seed_hosts=es7_01,es7_02
          - cluster.initial_master_nodes=es7_01,es7_02
        ulimits:
          memlock:
            soft: -1
            hard: -1
        volumes:
          - es7data2:/usr/share/elasticsearch/data
        networks:
          - es7net
    
    
    volumes:
      es7data1:
        driver: local
      es7data2:
        driver: local
    
    networks:
      es7net:
        driver: bridge
    
    

    es三节点hot warm和cold ,kibana和cerebro

    # docker-compose.yaml
    
    version: '2.2'
    services:
      cerebro:
        image: lmenezes/cerebro:0.9.3
        container_name: hwc_cerebro
        ports:
          - "9000:9000"
        command:
          - -Dhosts.0.host=http://elasticsearch:9200
        networks:
          - hwc_es7net
      kibana:
        image: docker.elastic.co/kibana/kibana:7.10.0
        container_name: hwc_kibana7
        environment:
          - I18N_LOCALE=zh-CN
          - XPACK_GRAPH_ENABLED=true
          - TIMELION_ENABLED=true
          - XPACK_MONITORING_COLLECTION_ENABLED="true"
        ports:
          - "5601:5601"
        networks:
          - hwc_es7net
      elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0
        container_name: es7_hot
        environment:
          - cluster.name=geektime-hwc
          - node.name=es7_hot
          - node.attr.box_type=hot
          - bootstrap.memory_lock=true
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
          - discovery.seed_hosts=es7_hot,es7_warm,es7_cold
          - cluster.initial_master_nodes=es7_hot,es7_warm,es7_cold
        ulimits:
          memlock:
            soft: -1
            hard: -1
        volumes:
          - hwc_es7data_hot:/usr/share/elasticsearch/data
        ports:
          - 9200:9200
        networks:
          - hwc_es7net
      elasticsearch2:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0
        container_name: es7_warm
        environment:
          - cluster.name=geektime-hwc
          - node.name=es7_warm
          - node.attr.box_type=warm
          - bootstrap.memory_lock=true
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
          - discovery.seed_hosts=es7_hot,es7_warm,es7_cold
          - cluster.initial_master_nodes=es7_hot,es7_warm,es7_cold
        ulimits:
          memlock:
            soft: -1
            hard: -1
        volumes:
          - hwc_es7data_warm:/usr/share/elasticsearch/data
        networks:
          - hwc_es7net
      elasticsearch3:
        image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0
        container_name: es7_cold
        environment:
          - cluster.name=geektime-hwc
          - node.name=es7_cold
          - node.attr.box_type=cold
          - bootstrap.memory_lock=true
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
          - discovery.seed_hosts=es7_hot,es7_warm,es7_cold
          - cluster.initial_master_nodes=es7_hot,es7_warm,es7_cold
        ulimits:
          memlock:
            soft: -1
            hard: -1
        volumes:
          - hwc_es7data_cold:/usr/share/elasticsearch/data
        networks:
          - hwc_es7net
    
    
    volumes:
      hwc_es7data_hot:
        driver: local
      hwc_es7data_warm:
        driver: local
      hwc_es7data_cold:
        driver: local
    
    networks:
      hwc_es7net:
        driver: bridge
    
    #启动
    docker-compose up
    
    #停止容器
    docker-compose down
    
    #停止容器并且移除数据
    docker-compose down -v
    
    #一些docker 命令
    docker ps
    docker stop Name/ContainerId
    docker start Name/ContainerId
    
    #删除单个容器
    $docker rm Name/ID
    -f, –force=false; -l, –link=false Remove the specified link and not the underlying container; -v, –volumes=false Remove the volumes associated to the container
    
    #删除所有容器
    $docker rm `docker ps -a -q`  
    停止、启动、杀死、重启一个容器
    $docker stop Name/ID  
    $docker start Name/ID  
    $docker kill Name/ID  
    $docker restart name/ID
    
    

    相关阅读

  • 相关阅读:
    动态网站项目(Dynamic Web Project)CRUD(增删改查)功能的实现(mvc(五层架构)+jdbc+servlet+tomcat7.0+jdk1.8),前端使用JSP+JSTL+EL组合
    动态网站项目(Dynamic Web Project)登录功能的实现(mvc(五层架构)+jdbc+servlet+tomcat7.0+jdk1.8)(js验证+cookie)
    Oracle数据库scott用户无法导入数据的解决方法
    Win10安装Oracle 11g后解决sqldeveloper缺少快捷方式的问题
    【转载】win10系统安装oracle11g详细步骤
    WPF学习笔记(8):DataGrid单元格数字为空时避免验证问题的解决
    WPF学习笔记(7):DataGrid中数字自定义格式显示
    WPF学习笔记(6):DataSet更新后台数据库个别列失败的问题
    WPF学习笔记(5):两个DataGrid的滚动条实现同步滚动
    WPF学习笔记(4):获取DataGridTemplateColumn模板定义的内容控件
  • 原文地址:https://www.cnblogs.com/sanduzxcvbnm/p/14499258.html
Copyright © 2011-2022 走看看