DataStax Help Center

Using JMX to switch a single node at a time to LeveledCompactionStrategy

To switch just a single node to using LCS, you do it over JMX.

You want to set:

org.apache.cassandra.db:columnfamily=<CFNAME>,keyspace=<KSNAME>,type=ColumnFamilies CompactionStrategyClass='org.apache.cassandra.db.compaction.LeveledCompactionStrategy'

It should currently be set to:


You can use jconsole to make the change, or a command line jmx client such as cmdline-jmxclient

Using the JMX client, you would issue the following commands:

1.To check the current value:

java -jar cmdline-jmxclient-0.10.3.jar - localhost:7199 org.apache.cassandra.db:columnfamily=<CF NAME>,keyspace=<KS NAME>,type=ColumnFamilies CompactionStrategyClass

2.To change it:

 java -jar cmdline-jmxclient-0.10.3.jar - localhost:7199 org.apache.cassandra.db:columnfamily=<CFNAME>,keyspace=<KSNAME>,type=ColumnFamilies CompactionStrategyClass='org.apache.cassandra.db.compaction.LeveledCompactionStrategy'

3.If you want to make sure of the naming of beans, you can issue just:

java -jar cmdline-jmxclient-0.10.3.jar - localhost:7199

And it will list all the beans.

Then you can:

java -jar cmdline-jmxclient-0.10.3.jar - localhost:7199 | grep <CFNAME>

To find all the beans for a given CF. 

4.Once you have completed this process on each node, you will then want to go back and issue the ALTER TABLE queries for each CF to make the changes permanent.

Was this article helpful?
2 out of 2 found this helpful
Have more questions? Submit a request


Powered by Zendesk