Restart VM and run all thing again [ Solved ]

When I restart my virtual machine, Do I config the replica set and config server and mongos again?
after restart my system ,I try this process again but I can’t !
There is no error but mongod doesn’t start

vagrant@m103:~$ mongod -f mongod-repl-1.conf
about to fork child process, waiting until server is ready for connections.
forked process: 1969

this is error log file

2018-12-17T10:11:11.102+0000 W NETWORK  [monitoring keys for HMAC] Failed to connect to 192.168.103.100:26001, in(check$2018-12-17T10:11:11.104+0000 W NETWORK  [monitoring keys for HMAC] Failed to connect to 192.168.103.100:26003, in(check$2018-12-17T10:11:11.105+0000 W NETWORK  [monitoring keys for HMAC] Failed to connect to 192.168.103.100:26002, in(check$2018-12-17T10:11:11.106+0000 W NETWORK  [monitoring keys for HMAC] Unable to reach primary for set m103-csrs
2018-12-17T10:11:11.152+0000 W NETWORK  [initandlisten] Failed to connect to 192.168.103.100:26002, in(checking socket $2018-12-17T10:11:11.154+0000 W NETWORK  [initandlisten] Failed to connect to 192.168.103.100:26001, in(checking socket $2018-12-17T10:11:11.155+0000 W NETWORK  [initandlisten] Failed to connect to 192.168.103.100:26003, in(checking socket $2018-12-17T10:11:11.156+0000 W NETWORK  [initandlisten] Unable to reach primary for set m103-csrs
2018-12-17T10:11:11.304+0000 W NETWORK  [shard registry reload] Failed to connect to 192.168.103.100:26001, in(checking$2018-12-17T10:11:11.304+0000 W NETWORK  [replSetDistLockPinger] Failed to connect to 192.168.103.100:26003, in(checking$2018-12-17T10:11:11.305+0000 W NETWORK  [shard registry reload] Failed to connect to 192.168.103.100:26002, in(checking$2018-12-17T10:11:11.307+0000 W NETWORK  [shard registry reload] Unable to reach primary for set m103-csrs
2018-12-17T10:11:11.607+0000 W NETWORK  [monitoring keys for HMAC] Failed to connect to 192.168.103.100:26001, in(check$2018-12-17T10:11:11.608+0000 W NETWORK  [monitoring keys for HMAC] Failed to connect to 192.168.103.100:26002, in(check$2018-12-17T10:11:11.610+0000 W NETWORK  [monitoring keys for HMAC] Failed to connect to 192.168.103.100:26003, in(check$2018-12-17T10:11:11.611+0000 W NETWORK  [monitoring keys for HMAC] Unable to reach primary for set m103-csrs
2018-12-17T10:11:11.658+0000 W NETWORK  [initandlisten] Failed to connect to 192.168.103.100:26002, in(checking socket $2018-12-17T10:11:11.659+0000 W NETWORK  [initandlisten] Failed to connect to 192.168.103.100:26001, in(checking socket $2018-12-17T10:11:11.661+0000 W NETWORK  [initandlisten] Failed to connect to 192.168.103.100:26003, in(checking socket $2018-12-17T10:11:11.662+0000 W NETWORK  [initandlisten] Unable to reach primary for set m103-csrs
2018-12-17T10:11:11.808+0000 W NETWORK  [shard registry reload] Failed to connect to 192.168.103.100:26002, in(checking$2018-12-17T10:11:11.808+0000 W NETWORK  [replSetDistLockPinger] Failed to connect to 192.168.103.100:26003, in(checking$2018-12-17T10:11:11.810+0000 W NETWORK  [shard registry reload] Failed to connect to 192.168.103.100:26001, in(checking$2018-12-17T10:11:11.811+0000 W NETWORK  [shard registry reload] Unable to reach primary for set m103-csrs

I fixed this problem
At first I ran csrs server and mongos then shards.
It work ok

1 Like

This is why it’s a good idea to make a startup script for the later parts of M103 :slight_smile:

Just make a small script that first starts the CSRS, then wait a few seconds, then start the MongoS and a few seconds later start the data replica sets.

Saves you a lot of typing too! :wink:

1 Like