Deploy a replica set step 5 failure

i get these 2 different errors in 2 different windows.

1st user from mongod_1.conf was created all right

not seeing the mistake !! thanks for your help !!

Hello @Leo_Aramburu , please post the content from the mongod_2.conf configuration file.


storage:
dbPath: /var/mongodb/db/1
net:
bindIp: localhost
port: 27002
security:
keyFile: /var/mongodb/pki/m103-keyfile
systemLog:
destination: file
path: /var/mongodb/logs/mongod2.log
logAppend: true
processManagement:
fork: true
replication:
replSetName: m103-repl

there you go… thanks !!!

Hello @Leo_Aramburu,

the dbPath needs to be /var/mongodb/db/2. Note each configuration connects to a new server and so you need a new db path. Also, make sure the dbpath directory is created before you start the mongod.

1 Like

it worked thanks !!!

1- i connected to primary here

bash-4.4# mongo --port 27001 -p “m103-pass” --authenticationDatabase “admin”
MongoDB shell version v4.0.5
connecting to: mongodb://127.0.0.1:27001/?authSource=admin&gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“e31e7e01-3efd-4619-b8d2-12a5d2b1fa8b”) }
MongoDB server version: 4.0.5
m103-repl:PRIMARY> rs.status()
{
“operationTime” : Timestamp(1618831368, 1),
“ok” : 0,
“errmsg” : “command replSetGetStatus requires authentication”,
“code” : 13,
“codeName” : “Unauthorized”,
“$clusterTime” : {
“clusterTime” : Timestamp(1618831368, 1),
“signature” : {
“hash” : BinData(0,“qRlmdbsSjNN5MkB9MY5BL8DgGBk=”),
“keyId” : NumberLong(“6952820438904864769”)
}
}
}
m103-repl:PRIMARY>

2- how do i check my ip? or host name? to add the other 2 nodes…

this is the example:
mongo --host My-Example-Associated-Hostname
mongo --host 198.51.100.1

Host name
rs.add( “mongodbd4.example.net:27017” )

thanks !!!

Hello @Leo_Aramburu,

1- i connected to primary here
bash-4.4# mongo --port 27001 -p “m103-pass” --authenticationDatabase “admin”

You need to specify the -u (the user name) option with the mongo,

2- how do i check my ip? or host name? to add the other 2 nodes…

I think it is provided with the course notes. Or, view the data in the file: /etc/hosts

1 Like

thanks so much !!!
i will check it out.
cheers

You do not need that. The lab description tells you to use localhost. That is what you have to use.

1 Like

thanks for the help !!!