ES-compose.yml
* 调整系统参数
vi /etc/security/limits.conf
soft nofile 65536
hard nofile 65536
vi /etc/sysctl.conf
vm.max_map_count=262144
version: "3"
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2
restart: always
user: root
privileged: true
hostname: es-1
container_name: es01
volumes:
- "./logs:/usr/share/elasticsearch/logs"
- "./data:/usr/share/elasticsearch/data"
- "./plugins:/usr/share/elasticsearch/plugins"
ports:
- 9200:9200
- 9300:9300
environment:
- TZ=Asia/Shanghai
- node.name=es01
- http.port=9200
- network.host=0.0.0.0
- transport.tcp.port=9300
- cluster.name=es-docker-cluster
- discovery.seed_hosts=192.168.103.47:9300,192.168.103.48:9300,192.168.103.48:9333
- cluster.initial_master_nodes=es01
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms2014m -Xmx2014m"
ulimits:
memlock:
soft: -1
hard: -1
networks:
- elastic
networks:
elastic:
* 集群验证
curl -i -v http://localhost:9200/_cat/health?v
http://192.168.103.47:9200/_cat/nodes