Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Unable to connect MongoDB ConfigSvr through mongos

$
0
0

Folks,

Since the last couple of day's, I'm trying to setting up MongoDB clusters (3 ConfigSvr, 3 ShardSvr & 1 Query Router) to the different server hosted on Digital Ocean. I already installed and configured MongoDB on all the 7 server. All working fine except when I tried to access config server through mongos command.

Below is my configsrv configuration content:

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
#  dbPath: /var/lib/mongodb
  dbPath: /data/configdb/
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
#  port: 27017
  port: 27019
  bindIp: 127.0.0.1
  maxIncomingConnections: 5000


processManagement:
  fork: true

security:
  authorization: enabled
  keyFile: /root/secure/access.key

#operationProfiling:

replication:
  replSetName: fooReplSet
  enableMajorityReadConcern: true

sharding:
  clusterRole: configsvr

## Enterprise-Only Options:

#auditLog:

#snmp:

And I start mongod deamon using below command:

mongod --configsvr --config /etc/mongodb-configsvr.conf

Note: All config server have the same configuration and started through above command.

However, when I tried to access that config server from query router server using below command -

mongos --keyFile /root/secure/access.key --configdb fooReplSet/xxx.xxx.xxx.xxx:27019,xxx.xxx.xxx.xxx:27019,xxx.xxx.xxx.xxx:27019 --port 27020

it always thrown "No primary detected for set fooReplSet" error, even if I tried to execute the same command without mention replica set name then it was thrown couldn't "check dbhash on config server xxx.xxx.xxx.xxx:27019 :: caused by :: 71 CSRS replica set is not initialized" error.

Is there any configuration I missed for config server.

Could someone help me, what I'm doing wrong?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>