Janusgraph replication-factor not propogated to cassandra

68 Views Asked by At

My janusgraph setup has replication-factor of 1 which I want to change to 3.

I tried to change the replication-factor with Management API of janusgraph using mgmt.set("storage.cassandra.replication-factor", 3), now everytime I connect to my Janusgraph, when I print mgmt.get("storage.cassandra.replication-factor") it gives me 3.

But when I connect to my cassandra using cqlsh and print the keyspaces, it shows me that the replication factor is 1 for the specific keyspace. I also tried restarting my cassandra after modifying replication factor but still no change.

2

There are 2 best solutions below

0
Aaron On

So that property is only valid if the keyspace doesn't exist so that it knows how many replicas to create it with. It won't modify an existing keyspace, because there are other things that need to happen when you do that (ex: data movement with nodetool repair or nodetool rebuild).

You will need to modify the keyspace manually:

ALTER KEYSPACE janusgraph WITH REPLICATION={'class':'NetworkTopologyStrategy','yourDataCenterName':'3'};
0
A R K On

Yes as per Alter Keyspace the replication factor will be set correctly but for existing data there won't be any change, if you require to replicate existing data as well then creating new keyspace with the required replicaiton factor using cqlsh and then migrating data from previous keyspace to the new keyspace could help.