Unable to start/launch local mongo db
There is nothing wrong, you have started the server, it is running and listening on port 27017
. Now you can start to interact with the server, for example just open a new terminal tab and run mongo
,which will open mongo's interactive console and connects to the default server(localhost:27017
)
If you want to run mongod as a background process (to get back the console) you can use --fork command option. This requires you to use some sort of logging.
Eg. mongod --dbpath /path/to/my/mongodata --fork --logpath /path/to/my/mongod.log
If you want to restore a bsonexport you will probably use the mongorestore command
Add the below in the configuration file and call it using monogd
, make sure your bind_ip
is configured as per your requirement and use the below link to add few more replica sets:
https://docs.mongodb.org/manual/tutorial/deploy-replica-set/
Step 1:
vi /etc/mongod.confreplication: replSetName: rs01
Step 2:
mongod --config /etc/mongod.conf
Output:
warning: bind_ip of 0.0.0.0 is unnecessary; listens on all ips by defaultabout to fork child process, waiting until server is ready for connections.forked process: 30012child process started successfully, parent exiting