-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TTL Remover not working in Cassandra 4. #13
Comments
To reproduce the issue , below are the Steps.
Getting the Below Error after Run: root@:/opt/cassandra-ttl-remover# sh run.sh ............ Kindly suggest if something is missed. |
Hi @kmrmanish23 , it seems like you are not propagating $CLASSPATH like here: https://github.com/instaclustr/cassandra-ttl-remover/blob/master/run.sh#L72 You have only this:
where is $CLASSPATH? |
Thanks for the quick response . I modified the run.sh file .PFA the same . While running the run.sh now , A new directory is created as below with system & debug.log file. Below is the content of the debug & system.log file .However no action is taken on the STABLES. Kindly suggest if I missed something. root@:/opt/cassandra-ttl-remover# cd cassandra.logdir_IS_UNDEFINED/ |
You are the most probably hitting this issue, I can not do anything about it. https://issues.apache.org/jira/browse/CASSANDRA-17773 What is ".PFA the same" ? What you mean by no action is taken? What is in |
Really sorry for asking the basic Question regaridng the CLASSPATH. After running the command " mvn clean install -DskipTests" , All the related jars are generated in the respective "target" folder under "impl", "buddy-agent" and Cassandra- X " folders. root@localhost:/opt/cassandra-ttl-remover# pwd My CASSANDRA_HOME=/home/manish/cassandra/apache-cassandra-4.0.7 What should be my "$CLASSPATH" value? Currently it set to echo $CLASSPATH |
You are the most probably hitting this issue, I can not do anything about it. https://issues.apache.org/jira/browse/CASSANDRA-17773 What is ".PFA the same" ? Please find attached . I have attached the modified run.sh . What you mean by no action is taken? What is in /var/lib/cassandra/data/cycling/stripped ? |
Based on the issue reported in I changed the CASSANDRA_LOG_DIR to point to "/var/log/cassandra" .Rest looks fine . getting below error now : root@0:/var/log/cassandra# cd /opt/cassandra-ttl-remover/ |
Hi @kmrmanish23 , why do not you use the run.sh script and modify only what you need? All you need to change is this: https://github.com/instaclustr/cassandra-ttl-remover/blob/master/run.sh#L61 and this https://github.com/instaclustr/cassandra-ttl-remover/blob/master/run.sh#L63 Why do you care what is CLASSPATH set to? That is taken care of automatically based on your CASSANDRA_HOME. You need to set CASSANDRA_HOME and CLASSPATH will be set automatically. I tried the script on the local installation of Cassandra, my Cassandra is in So the command looks like this (BUT YOU NEED TO EXECUTE WHOLE
Notice I am using Cassandra 4.2-SNAPSHOT (4.1 is compatible with that). If you use Cassandra 4.0.7, you need to comment java command for 4.1 and you need to uncomment this https://github.com/instaclustr/cassandra-ttl-remover/blob/master/run.sh#L69-L81 Then you need to change --stables and --output-path as I showed above. If you run Cassandra 4, then you need to modify this https://github.com/instaclustr/cassandra-ttl-remover/blob/master/run.sh#L72 to reflect Cassandra 4, so change jars instead of 3 to 4. |
Thanks For the Update . For the Cassandra 3 & 4 , there is no option to set CASSANDRA_HOME inside the run.sh. the same is there for version 4.1 and 2. see the below code from run.sh. if [ -z "$CLASSPATH" ]; then Let me try out this again. |
I re-installed the entire cassandra with version 4.1 and used the same run.sh file now . the script existed now after reading the cassandra.yaml file .Please find below the logs. INFO [main] 2023-02-01 11:06:20,430 DatabaseDescriptor.java:460 - DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap Please note that there is no error message in the Log .It simply existed without creating any files in the "/tmp/stripped" folder. |
Please note that listen_address: localhost Do i need to change it ? |
I run My modified run.sh is here https://gist.github.com/smiklosovic/358bc53ed7de6b6599f5a336228e93e8
The script is meant to be run from the repository's root directory. |
Hi Štefan Miklošovič, Thanks a lot for your guidance. The tool is finally working for me. Coming to the tool functionality, I have a single Table in Cassandra spread across 10 nodes. Thanks, |
👍 Yes, obviously. |
Run.sh for Cassandra 4:
For Cassandra 3 and 4.0
CLASSPATH=$CLASSPATH./impl/target/ttl-remover.jar:./cassandra-4/target/ttl-remover-cassandra-4.jar
change versions of jars on classpath to target 3 or 4
change --cassandra-version if necessary
java -javaagent:/opt/cassandra-ttl-remover/buddy-agent/target/byte-buddy-agent.jar
-cp "/opt/cassandra-ttl-remover/impl/target/ttl-remover.jar:/opt/cassandra-ttl-remover/cassandra-4/target/ttl-remover-cassandra-4.jar"
$JVM_OPTS
com.instaclustr.cassandra.ttl.cli.TTLRemoverCLI
--cassandra-version=4
--sstables
/var/lib/cassandra/data/cycling
--output-path
/var/lib/cassandra/data/cycling/stripped
--cql
'CREATE TABLE IF NOT EXISTS test.test (id uuid, name text, surname text, PRIMARY KEY (id)) WITH default_time_to_live = 10;'
=============================================================================
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.0.0 | Cassandra 4.0.7 | CQL spec 3.4.5 | Native protocol v5]
Use HELP for help.
cqlsh> show version;
[cqlsh 6.0.0 | Cassandra 4.0.7 | CQL spec 3.4.5 | Native protocol v5]
cqlsh>
Below is the error Log while running run.sh.
root@:/opt/cassandra-ttl-remover# sh run.sh
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.util.ServiceConfigurationError: com.instaclustr.cassandra.ttl.SSTableTTLRemover: com.instaclustr.cassandra.ttl.Cassandra4TTLRemover Unable to get public no-arg constructor
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:582)
at java.base/java.util.ServiceLoader.getConstructor(ServiceLoader.java:673)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1233)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1265)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1300)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1385)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:132)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at com.instaclustr.cassandra.ttl.cli.TTLRemoverCLI.getTTLRemover(TTLRemoverCLI.java:134)
at com.instaclustr.cassandra.ttl.cli.TTLRemoverCLI.run(TTLRemoverCLI.java:100)
at picocli.CommandLine.executeUserObject(CommandLine.java:1919)
at picocli.CommandLine.access$1100(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
at picocli.CommandLine.execute(CommandLine.java:2058)
at com.instaclustr.cassandra.ttl.cli.TTLRemoverCLI.execute(TTLRemoverCLI.java:119)
at com.instaclustr.cassandra.ttl.cli.TTLRemoverCLI.main(TTLRemoverCLI.java:77)
at com.instaclustr.cassandra.ttl.cli.TTLRemoverCLI.main(TTLRemoverCLI.java:73)
Caused by: java.lang.NoClassDefFoundError: org/apache/cassandra/db/lifecycle/ILifecycleTransaction
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
at java.base/java.lang.Class.getConstructor0(Class.java:3342)
at java.base/java.lang.Class.getConstructor(Class.java:2151)
at java.base/java.util.ServiceLoader$1.run(ServiceLoader.java:660)
at java.base/java.util.ServiceLoader$1.run(ServiceLoader.java:657)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.ServiceLoader.getConstructor(ServiceLoader.java:668)
... 23 more
Caused by: java.lang.ClassNotFoundException: org.apache.cassandra.db.lifecycle.ILifecycleTransaction
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
=================================================================
echo $JAVA_HOME
/opt/zulu11.60.19-ca-jdk11.0.17-linux_x64
root@# echo $CASSANDRA_HOME
root@:/opt/cassandra-ttl-remover# echo $CLASSPATH
/opt/cassandra-ttl-remover-1.1.2/impl/target/ttl-remover.jar:/opt/cassandra-ttl-remover-1.1.2/cassandra-4/target/ttl-remover-cassandra-4.jar
The text was updated successfully, but these errors were encountered: