I started 3 mongodprocess each on different portwith different dbpath.
./bin/mongod
./bin/mongod
./bin/mongod
Start the connection as:
CONN = Connection("tauquir:27017", slave_okay=True)
CONN.admin.command("replSetInitiate")
CONN = Connection(["tauquir:27018", "tauquir:27019"])
Traceback I get:
CONN.admin.command("replSetInitiate")
File "/usr/local/lib/python2.6/dist-packages/pymongo-1.9-py2.6-linux-
i686.egg/pymongo/database.py", line 293, in command msg, allowable_errors)
File "/usr/local/lib/python2.6/dist-packages/pymongo-1.9-py2.6-linux-
i686.egg/pymongo/helpers.py", line 119, in _check_command_response raise
OperationFailure(msg % response["errmsg"])
pymongo.errors.OperationFailure: command SON([('replSetInitiate', 1)]) failed:
all members and seeds must be reachable to initiate set
source
share