$ > mongod --port 27017 --dbpath /Users/sjcbsolo/.mongodb/data/test --logpath /Users/sjcbsolo/.mongodb/logs/test.log --logappend --logRotate rename --replSet test0 --journal --smallfiles --bind_ip 127.0.0.1 --fork
.mongodb $ > mongo localhost:27017
MongoDB shell version v3.5.12-93-g2d7aef7
connecting to: localhost:27017
MongoDB server version: 3.5.12-93-g2d7aef7
Server has startup warnings:
2017-10-06T15:38:11.864-0700 I CONTROL [initandlisten]
2017-10-06T15:38:11.864-0700 I CONTROL [initandlisten] ** NOTE: This is a development version (3.5.12-93-g2d7aef7) of MongoDB.
2017-10-06T15:38:11.864-0700 I CONTROL [initandlisten] ** Not recommended for production.
2017-10-06T15:38:11.864-0700 I CONTROL [initandlisten]
2017-10-06T15:38:11.864-0700 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-10-06T15:38:11.864-0700 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-10-06T15:38:11.864-0700 I CONTROL [initandlisten]
MongoDB Enterprise > rs.initiate({})
{
"info2" : "no configuration specified. Using a default configuration for the set",
"me" : "sjca0bsolopro:27017",
"ok" : 0,
"errmsg" : "No host described in new configuration 1 for replica set test0 maps to this node",
"code" : 93,
"codeName" : "InvalidReplicaSetConfig"
}
MongoDB Enterprise > rs.initiate({
... _id: "test0",
... configsvr: false,
... members: [
... { _id: 0, host: "localhost:27017", priority: 2 }
... ]})
{ "ok" : 1, "operationTime" : Timestamp(1507329694, 1) }
MongoDB Enterprise test0:SECONDARY>
MongoDB Enterprise test0:PRIMARY>