linux 使用docker-compose安装部署 elasticsearch ik

linux 使用docker-compose安装部署 elasticsearch ik,第1张

linux 使用docker-compose安装部署 elasticsearch ik

1.安装docker 20.10.8

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum list docker-ce --showduplicates
sudo yum install docker-ce
docker -v

2.安装docker-compose 1.28.5

curl -L https://github.com.cnpmjs.org/docker/compose/releases/download/1.28.5/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version

3.更改系统vm最大值

vim /etc/sysctl.conf
# 添加以下内容
vm.max_map_count=262144
# 更新系统配置
sysctl -p

4.编写docker-compose

version: '2.2'
services:
  elasticsearch:
    image: bolingcavalry/elasticsearch-with-ik:6.5.0
    container_name: elasticsearch
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - http.cors.enabled=true
      - http.cors.allow-origin=*
      - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - default
  elasticsearch2:
    image: bolingcavalry/elasticsearch-with-ik:6.5.0
    container_name: elasticsearch2
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - http.cors.enabled=true
      - http.cors.allow-origin=*
      - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
      - "discovery.zen.ping.unicast.hosts=elasticsearch"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata2:/usr/share/elasticsearch/data
    networks:
      - default
  head:
    image: bolingcavalry/elasticsearch-head:6
    container_name: head
    ports:
      - 9100:9100
    networks:
      - default
volumes:
  esdata1:
    driver: local
  esdata2:
    driver: local

networks:
  default:

5.启动elasticsearch

# 启动docker
systemctl start docker
# 开机自启动docker
systemctl enable docker
# 运行elasticsearch docker-compose
docker-compose up -d

 

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5117168.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-17
下一篇 2022-11-17

发表评论

登录后才能评论

评论列表(0条)

保存