Meghana Kb
Meghana Kb

Reputation: 63

Problem connecting from Neptune Database to Notebook

I was able to connect to the Notebook for my Database cluster earlier but now I am getting error when I do %status.

I have created cluster and notebook with new VPC connection and also added the roles. I have also verified that the VPC connection is same for both notebook and DB Cluster

Please find the error message below.(I have removed the host name)

{'error': ConnectionError(MaxRetryError("HTTPSConnectionPool(host='mic.us-east-1.neptune.amazonaws.com', port=8182): Max retries exceeded with url: /status/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff16b264080>: Failed to establish a new connection: [Errno 110] Connection timed out',))",),)}

Upvotes: 5

Views: 4041

Answers (3)

Bharathwaj
Bharathwaj

Reputation: 33

I faced the same issue.
I solved it by adding inbound rules that match my VPC CIDR.

Upvotes: 0

Shantanu Tripathi
Shantanu Tripathi

Reputation: 383

By looking at the message:

{'error': ConnectionError(MaxRetryError("HTTPSConnectionPool(host='mic.us-east-1.neptune.amazonaws.com', port=8182):

my thinking is that the call from the notebook to the db is unable to connect at Port 8182.

One of the reasons could be that the security group attached with the database might not have an inbound policy that allows inbound requests to 8182 port.

You could try the following:

  1. Find the security group associated with your database. This could be done as follows:
    a. Open the neptune database in the AWS console.
    b. Choose the correct instance and then select Connectivity & security tab.
    c. This would allow you to see the attached security group. Click and open it.
  2. Once the security group is opened, look at the tab called Inbound Rules
  3. Within this, see if a Security group rule exists that has 8182 in the port range.
  4. If not, do Edit Inbound Rules > Add rule and then add a rule with port number 8182 and protocol type Custom TCP. Give any description.

Try using the %status in the notebook once again and check if it works.

Thanks!!

Upvotes: 1

Taylor Riggan
Taylor Riggan

Reputation: 2769

That error message typically only occurs when there's something blocking network connectivity between the notebook instance and your Neptune cluster.

  1. Make sure the security group for your Neptune cluster is allowing traffic from your notebook instance.

  2. Validate that DNS is resolving to your Neptune cluster. From a %%bash cell or from a Jupyter terminal window:

    nslookup <cluster_endpoint>

  3. Validate that you can connect to your Neptune cluster's status endpoint. From a %%bash cell or Jupyter terminal window:

    curl -s https://<cluster_endpoint>:8182/status

UPDATE:

It also appears that you're attempting to connect using 'mic.us-east-1.neptune.amazonaws.com'. That's not a valid Neptune endpoint. Neptune endpoints are in the form of:

<cluster-name>.cluster-abcdefghijkl.<region>.neptune.amazonaws.com

(where abcdefghijkl is some random 12 letter string)

Upvotes: 3

Related Questions