Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert mongo standalone to replicaset in docker #55

Closed
scne opened this issue Oct 2, 2015 · 2 comments
Closed

convert mongo standalone to replicaset in docker #55

scne opened this issue Oct 2, 2015 · 2 comments

Comments

@scne
Copy link

scne commented Oct 2, 2015

I've a Docker instance with mongo. This run as standalone configuration. Now I would to change entrypoint.sh to run itself as replica set following official guide standalone to replica set

Any suggestion? I've tried to manually setting up entrypoint.sh but it have crashed my container.

@yosifkit
Copy link
Member

yosifkit commented Oct 2, 2015

As far as I can tell, you shouldn't need to change the entrypoint. As long as you have the data accessible to a new container, just run it with the --replSet flag:

$ docker run -d --name some-mongo -v /path/to/my/data/dir:/data/db mongo --replSet rs0
$ # then connect to it with a mongo shell:
$ docker run -it --link some-mongo:mongo --rm mongo mongo mongo/myDatabase
> rs.initiate()

@scne
Copy link
Author

scne commented Oct 2, 2015

Great!

@scne scne closed this as completed Oct 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants