My port 27017 doesn't seems to be open is there any workaround for this?

Continuing the discussion from About the Chapter 1: Compass Connection [Solution]:

Hi Quazi_31756,

For connecting to our Atlas cluster: “cluster0-shard-00-00-jxeqq.mongodb.net”, you need to use the port 27017.

There is no workaround unfortunately.

Kanika

now i am able to use the port 27017, But still i am facing the issue “Could not connect to MongoDB on the provided host and port” and i followed your solution About the Chapter 1: Compass Connection [Solution].
i am able to ping : ping [cluster0-shard-00-00-jxeqq.mongodb.net](http://cluster0-shard-00-00-jxeqq.mongodb.net
but again i am not able to tracert the same.
this also doesn’t work: telnet cluster0-shard-00-00-jxeqq.mongodb.net 27017

1 Like

Hi Quazi_31756,

Please share the output of the command:

 mongo "mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics

If you are able to connect from shell, then make sure you are using latest version of Compass i.e. 1.16.1 and all parameters are correctly pasted. Please share the screenshot.

Kanika

MongoDB shell version v4.1.7
connecting to: mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0
2019-02-11T12:12:36.684-0500 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017
2019-02-11T12:12:36.685-0500 I ASIO [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-jxeqq.mongodb.net:27017
2019-02-11T12:12:36.685-0500 I ASIO [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-jxeqq.mongodb.net:27017
2019-02-11T12:12:36.685-0500 I ASIO [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-jxeqq.mongodb.net:27017
2019-02-11T12:12:37.707-0500 I ASIO [ReplicaSetMonitor-TaskExecutor] Failed to connect to cluster0-shard-00-00-jxeqq.mongodb.net:27017 - HostUnreachable: Error connecting to cluster0-shard-00-00-jxeqq.mongodb.net:27017 (34.195.121.130:27017) :: caused by :: No connection could be made because the target machine actively refused it.

It is a development release. Please install 4.0.6 which is the current version. and then try connecting again. Let me know how it works.

Kanika

1 Like

I can connect it now. The reason is the security of the office network, switching to home network works fine.