Hi i am trying to create mongodb replicaset with ‘luamas/docker-mongo-local-replicaset’ container. But i am getting error –
mkdir: cannot create directory ‘/data/db1’: File exists
I tried removing all the volumes, removing running container, removing folders generated for mount. compose up again n again. nothing worked.
how should i solve this problem?
services:
mongo:
container_name: mongo-replicas
image: luamas/docker-mongo-local-replicaset
volumes:
- ./data/mongodb/db1:/data/db1
- ./data/mongodb/db2:/data/db2
- ./data/mongodb/db3:/data/db3
ports:
- "27001:27001"
- "27002:27002"
- "27003:27003"
restart: always