Elasticsearch가 모든 인터페이스의 포트 9200에서 수신 대기하도록 하는 포트 지시문을 사용하여 Docker Compose 파일을 실행합니다.
version: "3.7"
services:
elasticsearch:
container_name: elasticsearch_1
image: elasticsearch:7.1.1
ports:
- "9200:9200"
networks:
- elastic_network
environment:
- discovery.type=single-node
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
volumes:
- /usr/share/elasticsearch/
Elasticsearch가 localhost:9200에서만 수신 대기하도록 Docker 파일을 업데이트했습니다.
version: "3.7"
services:
elasticsearch:
container_name: elasticsearch_1
image: elasticsearch:7.1.1
ports:
- "127.0.0.1:9200:9200"
networks:
- elastic_network
environment:
- discovery.type=single-node
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
volumes:
- /usr/share/elasticsearch/
이미 실행 중인 Elasticsearch 서비스에 대해 업데이트된 docker-compose 파일을 어떻게 실행합니까?
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4832a2df50e1 elasticsearch:7.1.1 "/usr/local/bin/dock…" 6 days ago Up 10 minutes 0.0.0.0:9200->9200/tcp, 9300/tcp elasticsearch_1