docker-compose安装Elasticsearch,Kibana

安装docker
wget -qO- https://get.docker.com/ | sh
安装docker-compose
 sudo curl -L https://github.com/docker/compose/releases/download/1.17.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
新建docker-compose.yml

参考:极客时间

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:
      - quyue-net
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.3.0
    container_name: quyue-es1
    environment:
      - cluster.name=quyue-es
      - node.name=quyue-es1
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - discovery.seed_hosts=quyue-es1,quyue-es2
      - cluster.initial_master_nodes=quyue-es1,quyue-es2
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - quyue-data1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - quyue-net
  elasticsearch2:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.3.0
    container_name: quyue-es2
    environment:
      - cluster.name=quyue-es
      - node.name=quyue-es2
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - discovery.seed_hosts=quyue-es1,quyue-es2
      - cluster.initial_master_nodes=quyue-es1,quyue-es2
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - quyue-data2:/usr/share/elasticsearch/data
    networks:
      - quyue-net
volumes:
  quyue-data1:
    driver: local
  quyue-data2:
    driver: local
networks:
  quyue-net:
    driver: bridge
错误解决:

虚拟内存错误

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决办法:
在 /etc/sysctl.conf文件最后添加一行

vm.max_map_count=2621440

执行

sysctl -p
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值