Hi @Shubham_Ranjan,
This is the result of ping m103 -
vagrant@m103:~ ps -ef | grep [m]ongod
vagrant@m103:~ ping m103
PING m103.mongodb.university (127.0.1.1) 56(84) bytes of data.
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=1 ttl=64 time=0.022 ms
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=2 ttl=64 time=0.073 ms
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=3 ttl=64 time=0.064 ms
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=4 ttl=64 time=0.085 ms
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=5 ttl=64 time=0.070 ms
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=6 ttl=64 time=0.069 ms
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=7 ttl=64 time=0.068 ms
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=8 ttl=64 time=0.069 ms
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=9 ttl=64 time=0.024 ms
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=10 ttl=64 time=0.068 ms…
…
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=522 ttl=64 time=0.063 ms
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=523 ttl=64 time=0.081 ms
64 bytes from m103.mongodb.university (127.0.1.1): icmp_seq=524 ttl=64 time=0.033 ms
— m103.mongodb.university ping statistics —
524 packets transmitted, 524 received, 0% packet loss, time 523043ms
rtt min/avg/max/mdev = 0.000/0.050/0.683/0.048 ms
I stopped as it seemed to be going on indefinitely.
I also removed all the csrs1/2/3 directories and re-created -
vagrant@m103:~ cd /var/mongodb/db/
vagrant@m103:/var/mongodb/db dir
csrs1 csrs2 csrs3 mongod1.log mongos.log
vagrant@m103:/var/mongodb/db$ rm -r csrs1
vagrant@m103:/var/mongodb/db$ dir
csrs2 csrs3 mongod1.log mongos.log
vagrant@m103:/var/mongodb/db$ rm -r csrs2
vagrant@m103:/var/mongodb/db$ rm -r csrs3
vagrant@m103:/var/mongodb/db$ dir
mongod1.log mongos.log
vagrant@m103:/var/mongodb/db$ mkdir csrs1
vagrant@m103:/var/mongodb/db$ mkdir csrs2
vagrant@m103:/var/mongodb/db$ mkdir csrs3
vagrant@m103:/var/mongodb/db$ dir
csrs1 csrs2 csrs3 mongod1.log mongos.log
I was then able to start the mongod-csrs-1.cfg/mongod-csrs-2.cfg and mongod-csrs-3.cfg without any issue but when I attempt to start mongos I am getting this -
vagrant@m103:/var/mongodb/db$ mongos -config /shared/mongos.cfg
about to fork child process, waiting until server is ready for connections.
forked process: 26673
ERROR: child process failed, exited with error number 48
To see additional information in this output, start without the “–fork” option.
I have amended the config file and removed the --fork option and when I try to run this nothing happens -
vagrant@m103:/var/mongodb/db$ mongos -config /shared/mongos.cfg
I have checked the log file and this is what I am seeing -
2020-01-10T10:09:29.714+0000 I CONTROL [mongosMain] options: { config: “/shared/mongos.cfg”, net: { bindIp: “localhost,192.168.103.100”, port: 26000 }, security: { keyFile: “/var/mongodb/pki/m103-keyfile” }, sharding: { configDB: “m103-csrs/192.168.103.100:26001,192.168.103.100:26002,192.168.103.100:26003” }, systemLog: { destination: “file”, logAppend: true, path: “/var/mongodb/db/mongos.log” } }
2020-01-10T10:09:29.715+0000 E SHARDING [mongosMain] Failed to set up listener: SocketException: Address already in use
2020-01-10T10:09:29.715+0000 I CONTROL [mongosMain] shutting down with code:48
Many thanks,
Nicole