c:\Program Files\MongoDB\Server\4.0\bin> mongod --replSet myReplSet --logpath c:\temp\replSet_0\rs_0.log --dbpath c:\temp\replSet_0\ --port 27017 –smallfiles c:\Program Files\MongoDB\Server\4.0\bin> mongod --replSet myReplSet --logpath c:\temp\replSet_1\rs_0.log --dbpath c:\temp\replSet_0\ --port 27018 –smallfiles c:\Program Files\MongoDB\Server\4.0\bin> mongod --replSet myReplSet --logpath c:\temp\replSet_2\rs_0.log --dbpath c:\temp\replSet_0\ --port 27019 –smallfiles c:\Program Files\MongoDB\Server\4.0\bin>mongo --port 27017config = {_id: "myReplSet", members:[{_id:0, host:"localhost:27017"},{_id:1, host:"localhost:27018"},{_id:0, host:"localhost:27019"}]};
Ele retornou isso aqui (acredito q tenha ido tudo bem tmb):
{
"_id" : "myReplSet",
"members" : [
{
"_id" : 0,
"host" : "localhost:27017"
},
{
"_id" : 1,
"host" : "localhost:27018"
},
{
"_id" : 0,
"host" : "localhost:27019"
}
]
}
4) Inicializei, e foi onde apareceu o erro:
rs.initiate(config)