Connecting to Aiven Cassandra cluster

120 views
Skip to first unread message

Magnus Haxen

unread,
Jan 24, 2022, 10:15:39 AM1/24/22
to Gremlin-users
Hi, I'm working on a project that requires a knowledge graph. I'm trying to configure a janusgraph server, such that It connects to a cassandra cluster hosted by Aiven: https://aiven.io/

... but I've had no luck with it. I followed the guide from: 

... but when I try to connect throught the gremlin console I get the following error message:
"gremlin-groovy is not an available GremlinScriptEngine"

Here's a censored version of how my .properties file looks like:

--file start--
storage.backend=cql

storage.hostname=cassandra-[name & project].aivencloud.com
storage.port=15522
storage.username=[my username]
storage.password=[my password]

storage.cql.ssl.enabled=true
storage.cql.ssl.truststore.location=/opt/janusgraph-0.6.0/store/sstableloader.truststore.jks
storage.cql.ssl.keystore.location=/opt/janusgraph-0.6.0/store/sstableloader.keystore.p12
storage.cql.ssl.truststore.password=[password]
storage.cql.ssl.keystore.password=[password]

storage.cql.keyspace=janusgraph

storage.cql.local-datacenter=aws-eu-west-1

storage.cql.read-consistency-level=LOCAL_QUORUM
storage.cql.write-consistency-level=LOCAL_QUORUM
log.janusgraph.key-consistent=true
log.tx.key-consistent=true

storage.cql.metadata-schema-enabled=false
storage.cql.metadata-token-map-enabled=false
storage.cql.partitioner-name=DefaultPartitioner

graph.assign-timestamp=false

cache.db-cache = true
cache.db-cache-clean-wait = 20
cache.db-cache-time = 180000
cache.db-cache-size = 0.5
--file end--

Is there anything that I'm missing here?

All the best,
Magnus from AeroGuest

Florian Hockmann

unread,
Jan 25, 2022, 8:10:26 AM1/25/22
to Gremlin-users
Hi Magnus,

so you're starting JanusGraph Server which uses this .properties file and then you're trying to connect to that server from the Gremlin Console, right? In that case, JanusGraph Server probably had a problem to connect to Cassandra during startup. You should be able to get more information from the logs of JanusGraph Server. We would need to see these logs to help you further.

BTW: if you have another JanusGraph question in the future, then you might want to use one of JanusGraph's community channels directly as more people familiar with JanusGraph will probably see it there.

Regards,
Florian

Magnus Haxen

unread,
Feb 3, 2022, 5:59:28 AM2/3/22
to gremli...@googlegroups.com
Hi Florian,

Thank you for your message. You're right, I'm having problems with connecting to Cassandra via the Gremlin console. I can see on the janusgraph.log file that "no node was available to execute the query", which is also shown on the gremlin-console. You can see the full log message on the file of this email: 'log from gremlin-console.txt'. I'm very new to this, so I really appreciate all the help I can get.



--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/114aca75-c43d-44a5-88b2-e37b5efa89ebn%40googlegroups.com.
log from gremlin-console.txt

Florian Hockmann

unread,
Feb 4, 2022, 2:03:38 AM2/4/22
to Gremlin-users
Can you reach the Cassandra cluster in general from the host where Gremlin Console is running? I would check that first, maybe with netcat, to first rule out network / firewall problems.

If that works, then you could try connecting to the Cassandra cluster without using JanusGraph first, like with the CQL shell as described in this article from Aiven.

When that also works, then you need to check your storage.* settings in the .properties file. But when it doesn't work through the CQL shell, then you know that the problem is independent of JanusGraph. Then it makes sense to solve it first for the simple case with the CQL shell, maybe with help from Aiven, and when you get that working you can come back to JanusGraph and hopefully also get that working.

Magnus Haxen

unread,
Feb 4, 2022, 4:20:00 AM2/4/22
to gremli...@googlegroups.com
I have succesfully connected with the Cassandra with cqlsh just now. I can also do read and write operations. So I think it has to do the the .properties file. I have no idea how to configure it, I can't find a guide that shows the requires properties. I have sent you the state of the janusgraph-cql.properties file called "cql-properties.txt". Is there something important that I'm missing? It seems so simple in the janusgraph configuration guide from docs.janusgraph.org.

cql-properties.txt

Magnus Haxen

unread,
Feb 4, 2022, 4:46:21 AM2/4/22
to gremli...@googlegroups.com
UPDATE

I figured out that the cql.local-datacenter property had to be set to 'aiven' and not 'datacenter1'. However, now I have a new issue. When I try to connect to the cassandra with their console, I get a timeout error: 

gremlin> graph = JanusGraphFactory.open("conf/janusgraph-cql.properties")
Timeout connecting to [/100.100.101.1:9200]
Type ':help' or ':h' for help.
Display stack trace? [yN]y
java.net.ConnectException: Timeout connecting to [/100.100.101.1:9200]
        at org.apache.http.nio.pool.RouteSpecificPool.timeout(RouteSpecificPool.java:169)
        at org.apache.http.nio.pool.AbstractNIOConnPool.requestTimeout(AbstractNIOConnPool.java:632)
        at org.apache.http.nio.pool.AbstractNIOConnPool$InternalSessionRequestCallback.timeout(AbstractNIOConnPool.java:898)
        at org.apache.http.impl.nio.reactor.SessionRequestImpl.timeout(SessionRequestImpl.java:198)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processTimeouts(DefaultConnectingIOReactor.java:213)
        at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:158)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351)
        at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
        at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
        at java.lang.Thread.run(Thread.java:748)
gremlin>

Have you seen this issue before? ... or do I have to contact Aiven?

Florian Hockmann

unread,
Feb 7, 2022, 9:35:17 AM2/7/22
to Gremlin-users
Looks like JanusGraph now cannot connect to your Elasticsearch cluster as the IP mentioned in the stack trace is one of the IPs you've configured for Elasticsearch in your .properties file. So, I would next check whether you can reach ES from the host and whether the config there looks correct.
The good side however is that JanusGraph is now apparently able to connect to your Cassandra cluster.

Magnus Haxen

unread,
Feb 8, 2022, 3:52:26 AM2/8/22
to gremli...@googlegroups.com
Thanks for your reply,

Is it necessary to have an index backend like ES installed on my local machine in order for me to connect to the Cassandra? I'm not sure how to install elasticsearch and configure it properly w.r.t JanusGraph. I've tried to install and run it on port 9200, but I still get the same error. I've tried the configurations shown in https://docs.janusgraph.org/index-backend/elasticsearch/

Florian Hockmann

unread,
Feb 8, 2022, 5:34:22 AM2/8/22
to Gremlin-users
No, an index backend is optional. You only need it if you want to execute "advanced" index queries like full-text, geo, or numeric range searches. If you don't need this functionality, then you can use JanusGraph without an index backend.

Note that if now remove the "index.*" properties from your *.properties file, then it might not immediately work as JanusGraph could have saved some of these properties as global config it your Cassandra cluster. The easiest option if you don't have already inserted important data (I assume you don't as you had problems starting JanusGraph) that you cannot lose, is probably to just delete all data in Cassandra and then start JanusGraph again with an updated *.properties file.

Magnus Haxen

unread,
Feb 8, 2022, 6:36:29 AM2/8/22
to gremli...@googlegroups.com
I works now! Thanks for the help :) 

Reply all
Reply to author
Forward
0 new messages