For the users facing the following error, please look at the below given possible solutions that have worked for users.
Error: Client experienced a timeout when connecting to ‘m103-repl’
You need to check if your replica sets and config servers are configured correctly as below:
Mongos - 26000
Config server: 26001, 26002, 26003
Shard1: m103-repl - 27001, 27002, 27003
Shard2: m103-repl-2 - 27004, 27005, 27006
Check if all your nodes are up and running and also check that sharding is enabled for m103-repl replica set.
Check if you are using the replica set name (m103-repl) and the hostnames being used are correctly mapped to the IP addresses in /etc/hosts file.
If you are using hostname and the mapping is correct too, try replacing the hostname with IP address to make it work.
Check if replica set is initiated and all nodes are added in the replica set.
Check for authentication in mongos configuration file and also take a look at mongos log file for debugging.
There are another few probable causes for this error, please check as below:
You cannot contact the replica set, because there is no primary.
There is no primary because 2/3 replicas are down.
The last remaining host is and stays a secondary.
To connect to a secondary you have to adjust your connection string.
If nothing works, then please share the configuration or post your issue in the forum so that I can help more.
Curriculum Support Engineer