Following the MongoDB Sharding Documentation, I start a mongos using a configuration file with the specifics of my config server.
It seems rather straightforward, yet I am running into an issue. I start mongos on one machine (lets say its ip address is "some_ip"):
$ sudo mongos --config /etc/some_config.conf
And I try connecting to its shell from another machine, but I get connection refused error.
$ mongos some_ip:xxxxx
Here's part of my some_config.conf file:
net: port: xxxxx bindIp: 0.0.0.0 sharding: configDB: <configReplSet>/<ip_of_config>:27019
I'm using 0.0.0.0 for testing purposes. I made sure that the ip_addr and port I'm connecting to matches the ip of the host for the mongos and the port I specified in the
net.port param. I also opened up this port in my firewall for ingress/ egress connections.
Did I miss anything ? (NOTE: ** I edited post for further clarification)
(note: i replaced the actual ip addr with "ip_of_config") This is what my log file for my mongos says when I start mongos.
2018-05-02T05:57:48.533+0000 W NETWORK [monitoring keys for HMAC] Failed to connect to <ip_of_config>:27019, in(checking socket for error after poll), reason: Connection refused 2018-05-02T05:57:48.533+0000 W NETWORK [monitoring keys for HMAC] Unable to reach primary for set crs0
Now my config server is up and running fine, but its log file shows that it accepts multiple connections from my mongos server, but these connections close almost immediately. Also there are a few warning logs:
W SHARDING [Balancer] Balancer settings could not be loaded and will be retried in 10 seconds :: caused by :: ReadConcernMajorityNotAvailableYet: Failed to refresh the balancer settings due to ReadConcernMajorityNotAvailableYet: Read concern majority reads are currently not possible. W SHARDING [shard registry reload] cant reload ShardRegistry :: caused by :: CallbackCanceled: Callback canceled