Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MacOS [rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)

Tags:

mongodb

I want to try mongodb replica set. I follow the steps of《MongoDB: The Definitive Guide》.

$ mongo --nodb

then in the mongo shell:

replicaSet = new ReplicaSet({nodes: 3})
replicaSet.startSet()

then terminal repeat to output this:

[rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)

what' the problem?

like image 375
lutaoact Avatar asked Sep 19 '14 08:09

lutaoact


1 Answers

You need to do

rs.initiate()

You could also try like this

replicaSet.startSet();replicaSet.initiate()

http://docs.mongodb.org/manual/reference/method/rs.initiate/

Initiates a replica set. Optionally takes a configuration argument in the form of a document that holds the configuration of a replica set.

like image 175
Lalit Agarwal Avatar answered Oct 21 '22 12:10

Lalit Agarwal