The connection stopped working again, after converting to a Replica Set following the guide here.
The database is running and I’m able to connect with Compass.
I have also allowed mongos.exe
and mongod.exe
to Firewall through 'Panel\System and Security\Windows Defender Firewall\Allowed apps'
.
When I try to connect from WSL I get MongoServerSelectionError: connect ECONNREFUSED 127.0.1.1:27017
, but, the mongod.log
has the followng lines when trying to connect from WSL:
{"ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.36.92:34488","uuid":"458b6f43-275c-4067-9b01-a39bf657cf6e","connectionId":67,"connectionCount":1}}
{"ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.36.92:34490","uuid":"8a3b9610-4bdb-424b-9dd7-5b097eaee1af","connectionId":68,"connectionCount":2}}
{"ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.36.92:34492","uuid":"0a23f7f1-be9b-47d9-bd7d-0993c1ac2628","connectionId":69,"connectionCount":3}}
{"ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.36.92:34496","uuid":"b7649e80-90ba-4f9f-a602-6314d45c13c0","connectionId":70,"connectionCount":4}}
{"ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.36.92:34494","uuid":"efdf35b6-45fe-4ebc-abbf-6ff71dbbe898","connectionId":71,"connectionCount":5}}
{"ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.36.92:34498","uuid":"c8ac80e7-4f9c-4d62-9d85-ebe86614ccc6","connectionId":72,"connectionCount":6}}
{"ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.36.92:34502","uuid":"6fbe4774-bc6f-4853-89ba-daecb7de3d6d","connectionId":73,"connectionCount":7}}
{"ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.36.92:34504","uuid":"0845ebee-8913-4aea-b25f-1b1c5b1d1f12","connectionId":74,"connectionCount":8}}
{"ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.22.36.92:34500","uuid":"4649ce63-a456-4057-8cd1-f3ae6306aa64","connectionId":75,"connectionCount":9}}
{"ctx":"conn67","msg":"client metadata","attr":{"remote":"172.22.36.92:34488","client":"conn67","doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.10.102.1-microsoft-standard-WSL2"},"platform":"Node.js v16.17.0, LE (unified)|Node.js v16.17.0, LE (unified)"}}}
{"ctx":"conn68","msg":"client metadata","attr":{"remote":"172.22.36.92:34490","client":"conn68","doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.10.102.1-microsoft-standard-WSL2"},"platform":"Node.js v16.17.0, LE (unified)|Node.js v16.17.0, LE (unified)"}}}
{"ctx":"conn69","msg":"client metadata","attr":{"remote":"172.22.36.92:34492","client":"conn69","doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.10.102.1-microsoft-standard-WSL2"},"platform":"Node.js v16.17.0, LE (unified)|Node.js v16.17.0, LE (unified)"}}}
{"ctx":"conn71","msg":"client metadata","attr":{"remote":"172.22.36.92:34494","client":"conn71","doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.10.102.1-microsoft-standard-WSL2"},"platform":"Node.js v16.17.0, LE (unified)|Node.js v16.17.0, LE (unified)"}}}
{"ctx":"conn70","msg":"client metadata","attr":{"remote":"172.22.36.92:34496","client":"conn70","doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.10.102.1-microsoft-standard-WSL2"},"platform":"Node.js v16.17.0, LE (unified)|Node.js v16.17.0, LE (unified)"}}}
{"ctx":"conn72","msg":"client metadata","attr":{"remote":"172.22.36.92:34498","client":"conn72","doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.10.102.1-microsoft-standard-WSL2"},"platform":"Node.js v16.17.0, LE (unified)|Node.js v16.17.0, LE (unified)"}}}
{"ctx":"conn75","msg":"client metadata","attr":{"remote":"172.22.36.92:34500","client":"conn75","doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.10.102.1-microsoft-standard-WSL2"},"platform":"Node.js v16.17.0, LE (unified)|Node.js v16.17.0, LE (unified)"}}}
{"ctx":"conn73","msg":"client metadata","attr":{"remote":"172.22.36.92:34502","client":"conn73","doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.10.102.1-microsoft-standard-WSL2"},"platform":"Node.js v16.17.0, LE (unified)|Node.js v16.17.0, LE (unified)"}}}
{"ctx":"conn74","msg":"client metadata","attr":{"remote":"172.22.36.92:34504","client":"conn74","doc":{"driver":{"name":"nodejs","version":"4.13.0"},"os":{"type":"Linux","name":"linux","architecture":"x64","version":"5.10.102.1-microsoft-standard-WSL2"},"platform":"Node.js v16.17.0, LE (unified)|Node.js v16.17.0, LE (unified)"}}}
{"ctx":"conn67","msg":"Connection ended","attr":{"remote":"172.22.36.92:34488","uuid":"458b6f43-275c-4067-9b01-a39bf657cf6e","connectionId":67,"connectionCount":8}}
{"ctx":"conn68","msg":"Connection ended","attr":{"remote":"172.22.36.92:34490","uuid":"8a3b9610-4bdb-424b-9dd7-5b097eaee1af","connectionId":68,"connectionCount":7}}
{"ctx":"conn69","msg":"Connection ended","attr":{"remote":"172.22.36.92:34492","uuid":"0a23f7f1-be9b-47d9-bd7d-0993c1ac2628","connectionId":69,"connectionCount":6}}
{"ctx":"conn71","msg":"Connection ended","attr":{"remote":"172.22.36.92:34494","uuid":"efdf35b6-45fe-4ebc-abbf-6ff71dbbe898","connectionId":71,"connectionCount":5}}
{"ctx":"conn70","msg":"Connection ended","attr":{"remote":"172.22.36.92:34496","uuid":"b7649e80-90ba-4f9f-a602-6314d45c13c0","connectionId":70,"connectionCount":4}}
{"ctx":"conn72","msg":"Connection ended","attr":{"remote":"172.22.36.92:34498","uuid":"c8ac80e7-4f9c-4d62-9d85-ebe86614ccc6","connectionId":72,"connectionCount":3}}
{"ctx":"conn75","msg":"Connection ended","attr":{"remote":"172.22.36.92:34500","uuid":"4649ce63-a456-4057-8cd1-f3ae6306aa64","connectionId":75,"connectionCount":2}}
{"ctx":"conn73","msg":"Connection ended","attr":{"remote":"172.22.36.92:34502","uuid":"6fbe4774-bc6f-4853-89ba-daecb7de3d6d","connectionId":73,"connectionCount":1}}
{"ctx":"conn74","msg":"Connection ended","attr":{"remote":"172.22.36.92:34504","uuid":"0845ebee-8913-4aea-b25f-1b1c5b1d1f12","connectionId":74,"connectionCount":0}}
So it seems to be a Firewall issue. I don’t know what else I have to do to fix it.