Not able to connect Cassandra cluster after modifying the replication factor
I started using Cassandra as backend storage with default replication factor 1. Now I need to change the replication factor from 1 to 2. But after altering the keyspace with replication 2, My java application failed to start and producing the following exception. I can not drop the keyspace So any quick help will be grateful.
Caused by: org.janusgraph.core.JanusGraphException: Could not execute operation due to backend exception
at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:57) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:159) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.diskstorage.configuration.backend.KCVSConfiguration.get(KCVSConfiguration.java:100) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.diskstorage.configuration.BasicConfiguration.isFrozen(BasicConfiguration.java:106) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1394) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:164) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:133) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:80) ~[janusgraph-core-0.2.0.jar:na]
at in.wynk.graph.services.GraphService.postConstruct(GraphService.java:39) ~[graph-core-0.0.3.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:354) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:305) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE]
... 42 common frames omitted
Caused by: org.janusgraph.diskstorage.PermanentBackendException: Permanent failure in storage backend
at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftKeyColumnValueStore.convertException(CassandraThriftKeyColumnValueStore.java:263) ~[janusgraph-cassandra-0.2.0.jar:na]
at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftKeyColumnValueStore.getNamesSlice(CassandraThriftKeyColumnValueStore.java:162) ~[janusgraph-cassandra-0.2.0.jar:na]
at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftKeyColumnValueStore.getNamesSlice(CassandraThriftKeyColumnValueStore.java:105) ~[janusgraph-cassandra-0.2.0.jar:na]
at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftKeyColumnValueStore.getSlice(CassandraThriftKeyColumnValueStore.java:94) ~[janusgraph-cassandra-0.2.0.jar:na]
at org.janusgraph.diskstorage.configuration.backend.KCVSConfiguration$1.call(KCVSConfiguration.java:103) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.diskstorage.configuration.backend.KCVSConfiguration$1.call(KCVSConfiguration.java:100) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:148) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.diskstorage.util.BackendOperation$1.call(BackendOperation.java:162) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.diskstorage.util.BackendOperation.executeDirect(BackendOperation.java:69) ~[janusgraph-core-0.2.0.jar:na]
at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:55) ~[janusgraph-core-0.2.0.jar:na]
... 57 common frames omitted
Caused by: org.apache.cassandra.thrift.UnavailableException: null
at org.apache.cassandra.thrift.Cassandra$multiget_slice_result$multiget_slice_resultStandardScheme.read(Cassandra.java:14687) ~[cassandra-thrift-2.1.18.jar:2.1.18]
at org.apache.cassandra.thrift.Cassandra$multiget_slice_result$multiget_slice_resultStandardScheme.read(Cassandra.java:14633) ~[cassandra-thrift-2.1.18.jar:2.1.18]
at org.apache.cassandra.thrift.Cassandra$multiget_slice_result.read(Cassandra.java:14559) ~[cassandra-thrift-2.1.18.jar:2.1.18]
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78) ~[libthrift-0.9.2.jar:0.9.2]
at org.apache.cassandra.thrift.Cassandra$Client.recv_multiget_slice(Cassandra.java:741) ~[cassandra-thrift-2.1.18.jar:2.1.18]
at org.apache.cassandra.thrift.Cassandra$Client.multiget_slice(Cassandra.java:725) ~[cassandra-thrift-2.1.18.jar:2.1.18]
at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftKeyColumnValueStore.getNamesSlice(CassandraThriftKeyColumnValueStore.java:143) ~[janusgraph-cassandra-0.2.0.jar
Did you run a full node repair?
nodetool repair -full
Yes I tried nodetool repair -full and also tried with restarting the cassandra.
Apart from the above I tried with new keyspace with intial replication factor 2
storage.backend=cassandrathrift
storage.cassandra.keyspace=jadu_graph
storage.cassandra.replication-factor=2
But still getting the same exception
What is the Cassandra version? How many Cassandra nodes are in your cluster? Did you run the repair on each Cassandra node?
apache-cassandra-3.11.1 There is only one node in the cluster. Cassandra node and janusgraph application both are on local machine.
That's the crux of your problem. From the DataStax docs:
A replication factor of 2 means two copies of each row, where each copy is on a different node. All replicas are equally important; there is no primary or master replica. As a general rule, the replication factor should not exceed the number of nodes in the cluster.
If you add another Cassandra node to the cluster and run the full node repair on both nodes, then you'll be able to make quorum.