Percona mongodb sharding not conected

When Mongo.conf is replicaset, pbm-agent works. when mongo.conf set: clusterRole: shardsvr. Pbm-agent error:

Error: connect to mongodb: get config server connetion URI: mongo: no documents in result

what should i do?

Hi, I’ve seen this happen if you have a server running with clusterRole: shardsvr but it hasn’t been added to the cluster yet with sh.addShard() command. Can you validate from a mongos router that you see this shard when you run sh.status() ?

sh.status() is ok on mongos.

this error only occurs in shard servers. Configserver is ok.
ConfigReplSet:

  • ConfigReplSet/xxxxxx:27017 [P]: pbm-agent v2.0.2 OK
  • ConfigReplSet/xxxxxx:27017 [S]: pbm-agent v2.0.2 OK
  • ConfigReplSet/xxxxxx:27017 [S]: pbm-agent v2.0.2 OK
    ShardReplSet_B:
  • ShardReplSet_B/xxxxxx:27017 [S]: pbm-agent NOT FOUND FAILED status:
  • ShardReplSet_B/xxxxxx:27017 [S]: pbm-agent NOT FOUND FAILED status:
  • ShardReplSet_B/xxxxxx:27017 [P]: pbm-agent NOT FOUND FAILED status:
    ShardReplSet_A:
  • ShardReplSet_A/xxxxxx:27017 [P]: pbm-agent NOT FOUND FAILED status:
  • ShardReplSet_A/xxxxxx:27017 [S]: pbm-agent NOT FOUND FAILED status:
  • ShardReplSet_A/xxxxxx:27017 [S]: pbm-agent NOT FOUND FAILED status:

Example on shard server:

pbm config
Error: connect to mongodb: get config server connetion URI: mongo: no documents in result

observation:
if i change mongo.conf clusterRole to configsvr pbm-agent works but when i change the clusterRole to shardsvr the problem occurs

[direct: mongos] admin> sh.status()
shardingVersion
{
_id: 1,
minCompatibleVersion: 5,
currentVersion: 6,
clusterId: ObjectId(“645cd1d0b42d128a38c4a089”)
}

shards
[
{
_id: ‘ShardReplSet_A’,
host: ‘ShardReplSet_A/xxxxx:27017,xxxxx:27017,xxxxx:27017’,
state: 1,
topologyTime: Timestamp({ t: 1683900303, i: 4 })
},
{
_id: ‘ShardReplSet_B’,
host: ‘ShardReplSet_B/xxxxx:27017,xxxxx:27017,xxxxx
:27017’,
state: 1,
topologyTime: Timestamp({ t: 1683900968, i: 2 })
}
]

active mongoses
[ { ‘6.0.5’: 2 } ]

autosplit
{ ‘Currently enabled’: ‘yes’ }

balancer
{
‘Currently enabled’: ‘yes’,
‘Currently running’: ‘no’,
‘Failed balancer rounds in last 5 attempts’: 0,
‘Migration Results for the last 24 hours’: ‘No recent migrations’
}

databases
[
{
database: { _id: ‘config’, primary: ‘config’, partitioned: true },
collections: {
‘config.system.sessions’: {
shardKey: { _id: 1 },
unique: false,
balancing: true,
chunkMetadata: [ { shard: ‘ShardReplSet_A’, nChunks: 1024 } ],
chunks: [
‘too many chunks to print, use verbose if you want to force print’
],
tags:
}
}
}
]

Can you share the PBM_MONGODB_URI you are using? the agents should always point to localhost as per Set up and configure - Percona Backup for MongoDB

PBM_MONGODB_URI=“mongodb://usr_pbmuser_pro:pwd@localhost:27017/?authSource=admin&replicaSet=ShardReplSet_A”

That kind of URI is ok for the CLI but not for the agent. Try using something like:

PBM_MONGODB_URI=“mongodb://usr_pbmuser_pro:pwd@localhost:27017/?authSource=admin

taking out the replset part.

[root@spcdsrvv6968 72250518149]# pbm status --mongodb-uri=mongodb://usr_pbmuser_pro
:pwd@localhost:27017/?authSource=admin
Error: connect to mongodb: get config server connetion URI: mongo: no documents in result

Thanks for your help @Ivan_Groenewold but i’m still stuck. Do you know someone who could help me ?

I instaled the new version and work