I am not able to create replica set on localhost

please help me resolve this

Just chande mongosh by mongod

1 Like

sorry, you are already inside the instance so you can use the command rs.initiate(), and then add the necessary members with rs.add()

1 Like

you’ re trying to start a replica set inside the mongoshell, with the mongosh command and is wrong!
You need to do something like that (for example in linux):

[root@com ~]# mongod --logpath "path_for_log" --dbpath "path_for_data" --replSet "name" --bind_ip --fork  etc...

I hope is useful!


1 Like