Good day, a problem arose when requesting the following address: curl -X GET "http://localhost:9200" an error occurs curl: (52) Empty reply from server. The code for connecting to the elasticsearch service is launched from the Docker container:
elasticsearch:
container_name: elasticsearch_container
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.3
restart: always
environment:
ES_JAVA_OPTS: -Xmx2g -Xms2g
bootstrap.memory_lock: "true"
discovery.type: single-node
xpack.security.enabled: "false"
xpack.security.authc.api_key.enabled: "true"
xpack.monitoring.collection.enabled: "true"
xpack.security.enrollment.enabled: "true"
xpack.security.authc.token.enabled: "true"
ports:
- 9300:9300
- 9200:9200
volumes:
- ./docker-volumes/elasticsearch-data:/usr/share/elasticsearch/data
networks:
- elastic
kibana:
container_name: kibana_container
image: docker.elastic.co/kibana/kibana:8.15.3
restart: always
environment:
- ELASTICSEARCH_HOSTS=["http://elasticsearch_container:9200"]
ports:
- 5601:5601
networks:
- elastic
volumes:
- ./kibana.yml/:/usr/share/kibana/config/kibana.yml:ro
depends_on:
- elasticsearch
For some reason, the elasticsearch-data directory is empty and the console displays errors:
failed to obtain node locks, tried [/usr/share/elasticsearch/data]; maybe these locations are not writable or multiple nodes were started on the same data path?
...
Caused by: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/data/node.lock
...
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/node.lock