简体   繁体   中英

How do you test locally with Neptune?

I am trying to test our neptune db using gremlin. I have come up short with way to test locally. What are my options?

Currently just testing in real time. This is obviously not very effecient.

If this is purely for testing purposes, then what you can do is resolve the DNS of your cluster writer endpoint to obtain its IP.

// From an EC2 instance that has connectivity to your DB:
dig +short cluster-writer-endpoint-here

Then, create an ALB that has target groups that forward requests to this IP. Attach a security group to your ALB allowing it to be accessed via the internet or specifically via your local machine.

Now in your tests, point to the ALB endpoint as opposed to the DNS endpoint.

Why is this bad?

IP address of your instances are not meant to be static. In the event of a failover or a host replacement, your IP of your endpoints would change. Your usecase of running some tests should be fine though.

Other gotchas?

If you have IAM Auth enabled on the cluster, then this technique will not work. Also, if you are talking SSL, then your client would reject the request, since the cert returned by Neptune would not "trust" your ALB endpoint. You would either need to skip dns validation explicitly or set a Host header in your requests explicitly to point to the cluster endpoint itself. Something like this:

// To skip dns validation in curl
curl -k https://alb-endpoint:port/ 

// To set host head explicitly
curl -H 'Host: dns-endpoint' https://alb-endpoint:port/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM