Failed to connect to 127.0.1.1:27002, in(checking socket for error after poll), reason: Connection refused

This is my config file:

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

I am launching mongodb with: mongo --host “m103-repl/192.168.103.100:27001” -u “m103-admin” -p “m103-pass” --authenticationDatabase “admin”
rs.status()

Are the quotes around admin a problem?

Do have to authenticate separately for replica? (Although, this is not working any better :frowning:
mongo --host “m103-repl/m103:27001,192.168.103.100:27002,192.168.103.100:27003” --username “m103-admin” –password “m103-pass” --authenticationDatabase “admin

Check the /etc/hosts file and remove the double entry for m103 or comment it out. Check your config file if you have the right replica name.

A lot of us got the name wrong, me include :slight_smile:

Access your VM and Type:
sudo service mongodb restart, then enter the mongod command. He’d been on standby.

Open a second terminal and type the command: mongo

You will access the mongoDB.

Hug …