I created a new Replica Set on Rocky Linux 8.5
I installed mongo v5.0.7
I want to make 3 node replica set
when I run the other members on same server my 3 node replica set running with no problem
whereas when I try to use different hosts in replica set it shows the other nodes are passive not secondary
I have 3 nodes
mongo 192.168.56.25
mongo2 192.168.56.26
mongo3 192.168.56.27
Here is the rs.isMaster() output
MongoDB Enterprise mongo-cls:PRIMARY> rs.isMaster()
{
“topologyVersion” : {
“processId” : ObjectId(“62da62dc92ae9bb1a1331415”),
“counter” : NumberLong(8)
},
“hosts” : [
“mongo.localdomain:27000”
],
“passives” : [
“mongo2:27000”,
“mongo3:27000”
],
“setName” : “mongo-cls”,
“setVersion” : 3,
“ismaster” : true,
“secondary” : false,
“primary” : “mongo.localdomain:27000”,
“me” : “mongo.localdomain:27000”,
my mongod configuration files are like :
[root@mongo ~]# cat /etc/mongod.conf
mongod.conf
for documentation of all options, see:
http://docs.mongodb.org/manual/reference/configuration-options/
where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/mongodb/log/mongod.log
Where and how to store data.
storage:
dbPath: /var/mongodb/db/data
engine:
wiredTiger:
how the process runs
processManagement:
fork: true # fork and run in background
timeZoneInfo: /usr/share/zoneinfo
network interfaces
net:
port: 27000
bindIp: 0.0.0.0
security:
authorization: enabled
keyFile: /var/mongodb/pki/cls_key
#operationProfiling:
replication:
replSetName: mongo-cls
#sharding:
Enterprise-Only Options
#auditLog:
#snmp:
[root@mongo ~]#
on the other nodes configuration files are same