简体   繁体   中英

How to connect to a Grakn Server running on a GCP VM instance

I'm trying to connect to a Grakn Server running on a GCP VM instance. I have read the related post in the discussion forum. One of the replies suggests to do the following on the server side:

Edit ./conf/main/grakn.properties:

storage.hostname=EXTERNAL.ip.v4.address

Edit ./conf/cassandra/cassandra.yaml:

seeds: "EXTERNAL.ip.v4.address"
broadcast_address: EXTERNAL.ip.v4.address
listen_address: INTERNAL.ip.v4.address
rpc_address: INTERNAL.ip.v4.address

Access it from the Java API: GraknSession session = Grakn.session(“EXTERNAL.ip.v4.address”, keySpaceName);

What i have interpreted from this, for my specific case, is the following: -Replace EXTERNAL.ip.v4.address with the External IP of my VM instance -Replace INTERNAL.ip.v4.address with the Internal IP of my VM instance

When i start the server i get this exception cause (I think this is the root cause):

Caused by:

com.netflix.astyanax.connectionpool.exceptions.PoolTimeoutException: 
PoolTimeoutException: [host=104.197.131.17(104.197.131.17):9160, 
latency=10000(10000), attempts=1]Timed out waiting for connection         
at com.netflix.astyanax.connectionpool.impl.SimpleHostConnectionPool.waitForConnection(SimpleHostConnectionPool.java:231)

What am i missing? Do i have to add firewall rules?

Thanks for the help.

To access Grakn remotely using the Java API, you need to open the following ports on the GCP and Linux VM firewall (eg. iptables):

  • 4567
  • 9160

Make sure you are able to access those from the client machine.

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