Closed sunnykrGupta closed 6 years ago
It could be typos while configuring DNS of stateful pods. Followed : https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-network-id to understand more into static hostname.
Unfortunately only MongoDB version 3.2 and greater are supported, due to the scripts assuming the use of of the more modern way to manage the config servers as a "proper" replica sets. A.k.a. "Config Servers Replica Set" (CSRS)
That's part I ignored and used whole script to setup sharding in mongo 2.6. Initially i was unsure about replica set in config server. That's for pointing docs.
I am getting error while initiating a replicaset. Here, i am trying to setup standalone (only one member) replicaset.
rs.initiate({_id: "Shard1RepSet", version: 1, members: [ {_id: 0, host: "mongodb-shard1-0.mongodb-shard1-service:27017"} ]}) { "ok" : 0, "errmsg" : "couldn't initiate : can't find self in the replset config" }
Instead of this if i do
rs.initiate()
it assign perfectly and make it PRIMARY.Then after this init, proceeding to adding shard from mongos, it throws following
sh.addShard("Shard1RepSet/mongodb-shard1-0.mongodb-shard1-headless-service:27017") { "ok" : 0, "errmsg" : "couldn't connect to new shard socket exception [CONNECT_ERROR] for Shard1RepSet/mongodb-shard1-0.mongodb-shard1-headless-service:27017" }
I thought of network issue, then from same mongos container i did tried to connect to replicaset member its connecting perfectly. Can you help me with this? what could be possible reason? I am running mongo:2.6
root@mongos-567bcbb45d-lx47x:/# mongo --host mongodb-shard1-0.mongodb-shard1-headless-service --port 27017