Could not find host matching read preference { mode: “primary” } for set m103-repl

yes it’s the mongos log file.

Run cat on the mongos log file.

And don’t forget the screenshot :camera_flash:

here’s it is

I had done that also and could not find any useful information there.

The below should work:
sh.addShard("m103-repl/192.168.103.100:27001")

So instead of m103, use the IP address. 27001 must also be the port number for the Primary.

tried this also but still didn’t work

Screenshot please :camera_flash:

please help me get rid of this error

Also screenshot of my shard server (0n port 27001) is

Your last addshard command looks different?
Correct syntax
sh.addShard("<replica_set>/<:port>")

Is config servers running on port 27001?
Please check your lab requirements

no they are running on port 26001-3

output of rs.conf() on shardserver is

MongoDB Enterprise m103-csrs:OTHER> conf=rs.config()
{
“_id” : “m103-csrs”,
“version” : 3,
“protocolVersion” : NumberLong(1),
“members” : [
{
“_id” : 0,
“host” : “192.168.103.100:28001”,
“arbiterOnly” : false,
“buildIndexes” : true,
“hidden” : false,
“priority” : 1,
“tags” : {

                    },
                    "slaveDelay" : NumberLong(0),
                    "votes" : 1
            },
            {
                    "_id" : 1,
                    "host" : "192.168.103.100:28002",
                    "arbiterOnly" : false,
                    "buildIndexes" : true,
                    "hidden" : false,
                    "priority" : 1,
                    "tags" : {

                    },
                    "slaveDelay" : NumberLong(0),
                    "votes" : 1
            },
            {
                    "_id" : 2,
                    "host" : "192.168.103.100:28003",
                    "arbiterOnly" : false,
                    "buildIndexes" : true,
                    "hidden" : false,
                    "priority" : 1,
                    "tags" : {

                    },
                    "slaveDelay" : NumberLong(0),
                    "votes" : 1
            }
    ],
    "settings" : {
            "chainingAllowed" : true,
            "heartbeatIntervalMillis" : 2000,
            "heartbeatTimeoutSecs" : 10,
            "electionTimeoutMillis" : 10000,
            "catchUpTimeoutMillis" : -1,
            "catchUpTakeoverDelayMillis" : 30000,
            "getLastErrorModes" : {

            },
            "getLastErrorDefaults" : {
                    "w" : 1,
                    "wtimeout" : 0
            },
            "replicaSetId" : ObjectId("5df39030ca35b69d743cd0b9")
    }

}

In my configuration files i had mentions port 27001,27001,27001 but here showing 28001,28002,28003

also replSetName is m103-repl but it is showing m103-csrs

Please help in resolving this issue also

Yes i noticed that
Please check your config files again and the commands you used to bring up config servers
sh.status() gives shard status
rs.status() gives replicaset status
You config servers replica status clearly says wrong configuration
Please check again all your steps
It will be confusing as you have bring up 9 mongods

I had sent my config file and shardsvr file please have a look to point out mistake

Please check ps -ef|grep mongo and identify what config files are used to bring up your mongod instances and investigate if they are using correct ports or not
Also check mongod.logs/csrs.logs/mongos.log

mongos.log file showing following error

Sessions collection is not set up; waiting until next sessions refresh interval: Collection config.system.sessions is not sharded.

What about replica and config server status
From where it picked up 2800x ports?Did you check ps -ef|grep mongo
Best thing is to repeat the steps from scratch

no i mentioned 2700x ports but its not showing that