JanusGraph with remote Cassandra cluster connection problem

2,386 views
Skip to first unread message

cong1...@gmail.com

unread,
Dec 12, 2017, 11:19:10 AM12/12/17
to JanusGraph users
Hey Guys,

I am having a problem of Cassandra cluster connection. It seems the configuration does not work out. 

The configurations that I have from my property file are like these: 

storage.backend=cassandra
storage.hostname=0.0.0.0
storage.username=test_owner
storage.password=123
storage.cassandra.keyspace=store_test
storage.cassandra.astyanax.cluster-name=LLDS



And when I was trying to execute the code  JanusGraph graph = JanusGraphFactory.open("resources/janusgraph.properties");

I got the message like this: 

3:26:38.751 [main] DEBUG org.janusgraph.diskstorage.cassandra.astyanax.AstyanaxStoreManager - Custom RetryBackoffStrategy com.netflix.astyanax.connectionpool.impl.FixedRetryBackoffStrategy@3aeaafa6
13:26:38.895 [main] INFO com.netflix.astyanax.connectionpool.impl.ConnectionPoolMBeanManager - Registering mbean: com.netflix.MonitoredResources:type=ASTYANAX,name=ClusterJanusGraphConnectionPool,ServiceType=connectionpool
13:26:38.942 [main] INFO com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor - AddHost: 
13:26:38.942 [main] INFO com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor - AddHost: 
13:26:38.942 [main] INFO com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor - AddHost: 
13:26:38.942 [main] INFO com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor - AddHost: 
13:26:38.942 [main] INFO com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor - AddHost: 
13:26:38.942 [main] INFO com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor - AddHost: 
13:26:40.021 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:26:50.005 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:26:59.970 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:27:09.993 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:27:20.021 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:27:30.042 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:27:39.022 [main] DEBUG org.janusgraph.diskstorage.cassandra.astyanax.AstyanaxStoreManager - Failed to describe keyspace store_test
13:27:39.022 [main] DEBUG org.janusgraph.diskstorage.cassandra.astyanax.AstyanaxStoreManager - Creating keyspace store_test...
13:27:40.052 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:27:50.069 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:28:00.024 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:28:10.071 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:28:20.106 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:28:30.088 [pool-4-thread-1] DEBUG com.netflix.astyanax.thrift.ThriftConverter - java.net.ConnectException: Connection refused: connect
13:28:39.075 [main] DEBUG org.janusgraph.diskstorage.cassandra.astyanax.AstyanaxStoreManager - Failed to create keyspace store_test
Exception in thread "main" java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cassandra.astyanax.AstyanaxStoreManager

Anyone has idea about what should I do next?

Thanks for the help,

Cong


Daniel Kuppitz

unread,
Dec 12, 2017, 11:52:17 AM12/12/17
to JanusGraph users
I don't think 0.0.0.0 can be a valid IP address. If Cassandra is running on the same instance, use 127.0.0.1. If it's running on the same network, use the private IP address. Otherwise the public IP address (but you most likely don't want to do that).

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/9b0e23cf-5692-4e33-8d45-ae059a37c8b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cong Chen

unread,
Dec 13, 2017, 4:19:57 AM12/13/17
to JanusGraph users
Hi Daniel, 

I have a valid a IP address and I just made them anonymous. I tested the Cassandra cluster on the DevCenter and all the IP address, credentials and keyspace names are correct and worked. 

Do you have any further suggestions about it?

Thanks,

Cong 

But thanks for replying. 
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-use...@googlegroups.com.

Robert Dale

unread,
Dec 13, 2017, 7:13:25 AM12/13/17
to Cong Chen, JanusGraph users
Any reason why you need to use the astyanax driver?

I believe 'cassandrathrift' is preferred - it's what's configured in the default set of property files (although the docs prefer 'cassandra' so I can see the confusion). You may even want to use 'cql'. 



Robert Dale

To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/6f36748a-b44b-49e4-8d8b-e907f040cdbc%40googlegroups.com.

Cong Chen

unread,
Dec 13, 2017, 8:27:55 AM12/13/17
to JanusGraph users
Hi Robert, 

The one I am trying is Cassandra and when I changed to astyanax I got the same error. So I did not pay attention to it. I also tried cassandrashrift then I will get the following error message: 

Exception in thread "main" java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager
at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:69)
at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:477)
at org.janusgraph.diskstorage.Backend.getStorageManager(Backend.java:409)
at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1376)
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:164)
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:133)
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:80)
at com.ing.istore.ApplicationStarter.main(ApplicationStarter.java:21)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:58)
... 7 more
Caused by: org.janusgraph.diskstorage.TemporaryBackendException: Temporary failure in storage backend
at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager.getCassandraPartitioner(CassandraThriftStoreManager.java:219)
at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager.<init>(CassandraThriftStoreManager.java:198)
... 12 more
Caused by: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused: connect
at org.apache.thrift.transport.TSocket.open(TSocket.java:187)
at org.apache.thrift.transport.TFramedTransport.open(TFramedTransport.java:81)
at org.janusgraph.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory.makeRawConnection(CTConnectionFactory.java:110)
at org.janusgraph.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory.makeObject(CTConnectionFactory.java:74)
at org.janusgraph.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory.makeObject(CTConnectionFactory.java:43)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager.getCassandraPartitioner(CassandraThriftStoreManager.java:216)
... 13 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.thrift.transport.TSocket.open(TSocket.java:182)
... 19 more

Do you have any idea about it?

Thanks,

Cong

Robert Dale

Robert Dale

unread,
Dec 13, 2017, 9:08:15 AM12/13/17
to Cong Chen, JanusGraph users
`cassandra` == `astyanax`

Clearly, JanusGraph cannot connect to Cassandra from where it is.  Check your dns/ip, ports, firewalls. When you can successfully run `nodetool statusthrift` from where your JanusGraph instance lives, then JanusGraph should also be able to connect.

Robert Dale

To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/52754bef-59ce-45b2-9d63-69a41ed74062%40googlegroups.com.

Jason Plurad

unread,
Dec 13, 2017, 4:47:52 PM12/13/17
to JanusGraph users
Most likely Thrift is not enabled on your Cassandra cluster.

> The cassandra and cassandrathrift backend uses Thrift, which is not enabled by default in Cassandra 3.11.1. You can enable Thrift either in the cassandra.yaml by setting start_rpc: true or on the command line with nodetool enablethrift.

https://stackoverflow.com/questions/47367086/can-not-connect-janusgraph-to-local-cassandra-on-mac/47370799#47370799


On Thursday, December 14, 2017 at 1:08:15 AM UTC+11, Robert Dale wrote:
`cassandra` == `astyanax`

Clearly, JanusGraph cannot connect to Cassandra from where it is.  Check your dns/ip, ports, firewalls. When you can successfully run `nodetool statusthrift` from where your JanusGraph instance lives, then JanusGraph should also be able to connect.

Robert Dale

Cong Chen

unread,
Dec 14, 2017, 9:19:32 AM12/14/17
to JanusGraph users
Hi Jason, 

Thanks for your information. 

Just told the team who provides us Cassandra cluster to see if it is the problem of Thrift. 

Regards,

Cong

Robert Dale

Jason Plurad

unread,
Dec 14, 2017, 10:07:56 AM12/14/17
to JanusGraph users
If you're using JanusGraph 0.2.0, you can use the cql storage adapter (storage.backend=cql) which uses CQL instead of Thrift.

http://docs.janusgraph.org/latest/config-ref.html#_storage_cql

Cong Chen

unread,
Dec 18, 2017, 4:11:20 AM12/18/17
to JanusGraph users
Hi Jason, 

Thanks for your reply and the CQL works for me now. ;)

Cong

Cong Chen

unread,
Dec 18, 2017, 9:06:21 AM12/18/17
to JanusGraph users
Hi Jason, 

I have encountered another error of the keyspace configuration. 

It seems like the connection of cassandra cluster was set up successfully but it cannot identify the correct keyspace to use. So it is trying to read all the keyspaces on this cluster. 

In the configuration file I have the storage.cql.keyspace=store_test.But I don't think it works. 

The error message that I got is like this:

Exception in thread "main" java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cql.CQLStoreManager
at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:69)
at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:477)
at org.janusgraph.diskstorage.Backend.getStorageManager(Backend.java:409)
at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1376)
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:164)
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:133)
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:80)
at com.ing.istore.ApplicationStarter.main(ApplicationStarter.java:12)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:58)
... 7 more
Caused by: com.datastax.driver.core.exceptions.UnauthorizedException: User istore_test_owner has no CREATE permission on <all keyspaces> or any of its parents
at com.datastax.driver.core.exceptions.UnauthorizedException.copy(UnauthorizedException.java:59)
at com.datastax.driver.core.exceptions.UnauthorizedException.copy(UnauthorizedException.java:25)
at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245)
at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:68)
at org.janusgraph.diskstorage.cql.CQLStoreManager.initializeSession(CQLStoreManager.java:266)
at org.janusgraph.diskstorage.cql.CQLStoreManager.<init>(CQLStoreManager.java:149)
... 12 more
Caused by: com.datastax.driver.core.exceptions.UnauthorizedException: User istore_test_owner has no CREATE permission on <all keyspaces> or any of its parents
at com.datastax.driver.core.Responses$Error.asException(Responses.java:146)
at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179)
at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:186)
at com.datastax.driver.core.RequestHandler.access$2500(RequestHandler.java:50)
at com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:817)
at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:651)
at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1077)
at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1000)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:312)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at java.lang.Thread.run(Thread.java:745)

Together with the tracing message of keyspaces:

15:04:13.589 [main] DEBUG com.datastax.driver.core.ControlConnection - [Control connection] Refreshing node list and token map
15:04:13.651 [main] DEBUG com.datastax.driver.core.ControlConnection - [Control connection] Refreshing schema
15:04:13.981 [main] DEBUG com.datastax.driver.core.ReplicationStrategy$NetworkTopologyStrategy - Computing token to replica map for keyspace: asdf.
15:04:14.012 [main] DEBUG com.datastax.driver.core.ReplicationStrategy$NetworkTopologyStrategy - Token to replica map computation for keyspace asdfcompleted in 31 milliseconds
15:04:14.028 [main] DEBUG com.datastax.driver.core.ReplicationStrategy$NetworkTopologyStrategy - Computing token to replica map for keyspace: sdf.
15:04:14.028 [main] WARN com.datastax.driver.core.ReplicationStrategy$NetworkTopologyStrategy - Error while computing token map for keyspace sdf with datacenter fake2: could not achieve replication factor 3 (found 0 replicas only), check your keyspace replication settings. 


Could you please help me with it please? 

Many thanks in advance,

Cong

XIAYANG LEE

unread,
Mar 2, 2018, 2:33:04 AM3/2/18
to JanusGraph users
Hmmm, I am having the same issue where the ""storage.cql.keyspace" does not seem working when I set the backend to "cql".
@Robert, I did prefer the thrift way but for some reasons it cannot connect to my remote staging Cassandra(works with a local Cassandra instance). I post the exception in another post, but seems no one look at that yet.

Thanks,
Alex

Ankur Goel

unread,
Mar 19, 2018, 3:28:29 AM3/19/18
to JanusGraph users
We are also facing this issue any heads up on this.

~

Jason Plurad

unread,
Mar 19, 2018, 11:20:28 AM3/19/18
to JanusGraph users
Issue 933 is open for tracking this https://github.com/JanusGraph/janusgraph/issues/933
Reply all
Reply to author
Forward
0 new messages