Reputation: 452
I have a VM and inside it, I am running an Elasticsearch Docker container built through docker-compose
. It was working pretty well. Then after the power suddenly went out, I tried running the container back again but discovered an error that wasn't present before:
Then the container kept on restarting. And when I checked the file permissions (within the small window of time before the container restarts), I found this:
Here's my docker-compose.yml
:
version: '2.3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.0
hostname: elasticsearch
restart: always
user: root
ports:
- "9200:9200"
- "9300:9300"
volumes:
- ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
env_file:
- devopsfw-elk.env
What is actually happening here? I'm fairly new to Docker and Elasticsearch and I'm very confused as to the errors that are occuring.
Upvotes: 0
Views: 1638
Reputation: 32376
Looks like the file was owned by the root user and has been corrupted, in order to delete the file, you have to use the super user access aka sudo
, so correct command would be
sudo rm -i ./*elasticsearch.yml*
And after that, create a file and restart the conatainer.
Upvotes: 0
Reputation: 116
The problem is that the file has been corrupted, delete it and restart the container.
rm -i ./*elasticsearch.yml*
If you have problems to delete this, read this: https://superuser.com/questions/197605/delete-a-corrupt-file-in-linux
Upvotes: 2