2023-04-20
version: '2' networks: es-net: driver: bridge services: esnode1: image: elasticsearch:8.4.3 //镜像名称 container_name: es-node1 //容器名称 ports: //端口映射 - "9201:9200" - "9301:9300" volumes: //磁盘映射 - c:/docker/elasticsearch/config/node1.yml:/usr/share/elasticsearch/config/elasticsearch.yml - c:/docker/elasticsearch/data/node1:/usr/share/elasticsearch/data networks: //网络 - es-net esnode2: image: elasticsearch:8.4.3 container_name: es-node2 ports: - "9202:9200" - "9302:9300" volumes: - c:/docker/elasticsearch/config/node2.yml:/usr/share/elasticsearch/config/elasticsearch.yml - c:/docker/elasticsearch/data/node2:/usr/share/elasticsearch/data networks:
- es-net