Es Kibana 单节点 docker compose 启动

Windows Docker ToolBox es单节点与kibana docker compose 启动

1.设置环境变量MACHINE_STORAGE_PATH改变VirtualBox数据默认存储位置
2.打开VirtualBox增加default机器的内存和CPU资源
3.在VirtualBox的共享文件夹中增加需要共享的目录
4.修改Linux内存映射文件的最大值参数(默认65536,改为默认的4倍)
    docker-machine ssh
    sudo sysctl -w vm.max_map_count=262144
5.编写docker-compose.yml
version: '3'
services:
  elasticsearch-single:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.3.1
    container_name: elasticsearch-single
    environment:
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - discovery.type=single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      esnet:
        ipv4_address: 172.233.233.10
  kibana:
    image: docker.elastic.co/kibana/kibana:7.3.1
    container_name: kibana
    environment:
      - ELASTICSEARCH_URL=http://172.233.233.10:9200
      - ELASTICSEARCH_HOSTS=http://172.233.233.10:9200
    ports:
      - "5601:5601"
    networks:
      esnet:
        ipv4_address: 172.233.233.11
networks:
  esnet:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.233.233.0/24
5.1.查看docker网络情况(docker network)
6.Windows10下无法对docker容器进行端口访问
    docker是运行在Linux上的
    在Windows中运行docker
    实际上还是在Windows下先安装了一个Linux环境
    然后在这个Linux环境中运行docker
    也就是说服务中使用的localhost指的是这个Linux环境的地址(默认是192.168.99.100)
    而不是我们的宿主环境Windows10
7.启动单节点的ES服务和Kibana
docker-compose up -d

 

Centos7 es单节点与kibana docker compose 启动

version: '3'
services:
  elasticsearch-single:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.1.0
    container_name: elasticsearch-single
    environment:
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - discovery.type=single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - esnet
  kibana:
    image: docker.elastic.co/kibana/kibana:7.1.0
    container_name: kibana
    environment:
      - ELASTICSEARCH_URL=http://elasticsearch-single:9200
      - ELASTICSEARCH_HOSTS=http://elasticsearch-single:9200
    ports:
      - "5601:5601"    
    networks:
      - esnet
networks:
  esnet:

  

posted @ 2019-09-08 22:17  多彩泰坦  阅读(1062)  评论(0编辑  收藏  举报