So, I was configuring mongodb sharding cluster on multiple servers. I’ve configured a config server and two shard servers. When I try configure mongos router on mongos server with command:
mongos --configdb config/<config-sevrer-ip>:27017 --bind_ip localhost,<mongos-server-ip>
I get an output like this:
{"t":{"$date":"2023-02-27T08:25:41.419Z"},"s":"W", "c":"SHARDING", "id":24132, "ctx":"-","msg":"Running a sharded cluster with fewer than 3 config servers should only be done for testing purposes and is not recommended for production."}
{"t":{"$date":"2023-02-27T08:25:41.422+00:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2023-02-27T08:25:41.423+00:00"},"s":"I", "c":"NETWORK", "id":4915701, "ctx":"main","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":17},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":17},"outgoing":{"minWireVersion":17,"maxWireVersion":17},"isInternalClient":true}}}
{"t":{"$date":"2023-02-27T08:25:41.423+00:00"},"s":"I", "c":"NETWORK", "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
{"t":{"$date":"2023-02-27T08:25:41.424+00:00"},"s":"I", "c":"HEALTH", "id":5936503, "ctx":"main","msg":"Fault manager changed state ","attr":{"state":"StartupCheck"}}
{"t":{"$date":"2023-02-27T08:25:41.426+00:00"},"s":"W", "c":"CONTROL", "id":22120, "ctx":"main","msg":"Access control is not enabled for the database. Read and write access to data and configuration is unrestricted","tags":["startupWarnings"]}
{"t":{"$date":"2023-02-27T08:25:41.426+00:00"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"mongosMain","msg":"Build Info","attr":{"buildInfo":{"version":"6.0.4","gitVersion":"44ff59461c1353638a71e710f385a566bcd2f547","openSSLVersion":"OpenSSL 3.0.2 15 Mar 2022","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2204","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2023-02-27T08:25:41.427+00:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"mongosMain","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"22.04"}}}
{"t":{"$date":"2023-02-27T08:25:41.428+00:00"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"mongosMain","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"localhost,100.25.159.201"},"sharding":{"configDB":"config/54.157.187.130:27017"}}}}
{"t":{"$date":"2023-02-27T08:25:41.429+00:00"},"s":"E", "c":"SHARDING", "id":22856, "ctx":"mongosMain","msg":"Error setting up listener","attr":{"error":{"code":9001,"codeName":"SocketException","errmsg":"Cannot assign requested address"}}}
{"t":{"$date":"2023-02-27T08:25:41.429+00:00"},"s":"I", "c":"COMMAND", "id":4695701, "ctx":"main","msg":"Entering quiesce mode for mongos shutdown","attr":{"quiesceTimeMillis":15000}}
{"t":{"$date":"2023-02-27T08:25:56.429+00:00"},"s":"I", "c":"COMMAND", "id":4695702, "ctx":"main","msg":"Exiting quiesce mode for mongos shutdown"}
{"t":{"$date":"2023-02-27T08:25:56.429+00:00"},"s":"I", "c":"-", "id":4695300, "ctx":"main","msg":"Interrupted all currently running operations","attr":{"opsKilled":1}}
{"t":{"$date":"2023-02-27T08:25:59.429+00:00"},"s":"I", "c":"CONTROL", "id":23138, "ctx":"main","msg":"Shutting down","attr":{"exitCode":48}}
I’ve understood that my mongos router can’t assign requested address but I don’t know what I’m doing wrong. I’d be grateful if anyone can help me. I’ve configured the security groups so there is no issue regarding firewall and ports. But still it can’t establish a connection and connection is refused.HELP ME!!!