Mongos router not opening a port

R_Birtles
Sat, 30 Apr 2022 14:34:32 +0000

Hi,

I have been following this guide.

I am using Debian 11 with MongoDB v5.0.8. I was working over the Configure Query Router section, however, I am stuck as mongos doesn’t seem to open a port for communication.

Checking for the open port I get no results:

user@mongos:~$ ss -antpl | grep 27017
user@mongos:~$

I can see the process is running:

user@mongos:~$ ps aux|grep mongos
root        1797  0.0  0.1  10592  5068 pts/0    S+   15:26   0:00 sudo -u mongodb mongos --config /etc/mongod.conf
mongodb     1798  0.0  1.2 202976 49704 pts/0    Sl+  15:26   0:00 mongos --config /etc/mongod.conf
user        2021  0.0  0.0   6180   708 pts/1    S+   15:29   0:00 grep mongos

My config is binding to port 27017:

user@mongos:~$ cat /etc/mongod.conf
# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
#storage:
#  dbPath: /var/lib/mongodb
#  journal:
#    enabled: true
#  engine:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 192.168.0.40


# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

#security:

#operationProfiling:

#replication:

sharding:
  configDB: ConfigReplSet/192.168.0.37:27019

## Enterprise-Only Options:

#auditLog:

#snmp:

I can also see that the request to the config server is coming through without any issues:

{"t":{"$date":"2022-04-30T15:32:37.374+01:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"192.168.0.40:52142","uuid":"5d1c094a-301d-413d-861d-5aed5f9b7a13","connectionId":8,"connectionCount":1}}
{"t":{"$date":"2022-04-30T15:32:37.375+01:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"192.168.0.40:52144","uuid":"05e26a1a-60b5-4315-ad88-cffe0ffd221c","connectionId":9,"connectionCount":2}}
{"t":{"$date":"2022-04-30T15:32:37.375+01:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn8","msg":"client metadata","attr":{"remote":"192.168.0.40:52142","client":"conn8","doc":{"driver":{"name":"NetworkInterfaceTL","version":"5.0.8"},"os":{"type":"Linux","name":"PRETTY_NAME=\"Debian GNU/Linux 11 (bullseye)\"","architecture":"x86_64","version":"Kernel 5.10.0-13-amd64"}}}}
{"t":{"$date":"2022-04-30T15:32:37.376+01:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn9","msg":"client metadata","attr":{"remote":"192.168.0.40:52144","client":"conn9","doc":{"driver":{"name":"NetworkInterfaceTL","version":"5.0.8"},"os":{"type":"Linux","name":"PRETTY_NAME=\"Debian GNU/Linux 11 (bullseye)\"","architecture":"x86_64","version":"Kernel 5.10.0-13-amd64"}}}}
{"t":{"$date":"2022-04-30T15:32:37.377+01:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"192.168.0.40:52146","uuid":"f0bbbae7-8d6b-4ea3-9867-48d634bf67d1","connectionId":10,"connectionCount":3}}
{"t":{"$date":"2022-04-30T15:32:37.378+01:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn10","msg":"client metadata","attr":{"remote":"192.168.0.40:52146","client":"conn10","doc":{"driver":{"name":"NetworkInterfaceTL","version":"5.0.8"},"os":{"type":"Linux","name":"PRETTY_NAME=\"Debian GNU/Linux 11 (bullseye)\"","architecture":"x86_64","version":"Kernel 5.10.0-13-amd64"}}}}

Can anyone see any daft mistakes I have made or have advise on how I can get this working?