I am a newbie so please bear with me.
I have used this command $ sudo mongod --config /etc/mongod2.conf
in terminal to start a mongodb service instance. In another terminal I ran $ mongo --port XXXX
where XXXX is the port number I configure in mongod.conf file. rs.initiate() in mongo shell is giving the error "errmsg" : "assertion src/mongo/db/repl/replset_commands.cpp:275",
"code" : 8
why ?
edit:
**mongodb version v3.2.12**
mongod2.conf file consist of:
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: /var/lib/mongodb2
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb2/mongod.log
# network interfaces
net:
port: 27019
bindIp: 127.0.0.1
processManagement:
fork: true
#security:
#operationProfiling:
replication:
replSetName: myDevReplSet
mongod.conf
namingmongod1.conf
,mongod2.conf
and so on in which I specifieddbpath
as/var/lib/mongodb1
,/var/lib/mongodb2
and so on (as you can see in the edit section of mongod2.conf) and it works fine. Apology if there is something naive.