While starting cassendra we see below error.Please suggest.
INFO [main] 2015-08-20 19:15:28,762 ColumnFamilyStore.java (line 223) Initializing system.LocationInfo
ERROR [main] 2015-08-20 19:15:28,928 CassandraDaemon.java (line 464) Exception encountered during startup
java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: SnappyCompressor.create() threw an error: java.lang.NoClassDefFoundError Could not initialize class org.xerial.snappy.Snappy
at org.apache.cassandra.config.CFMetaData.fromSchemaNoColumns(CFMetaData.java:1431)
at org.apache.cassandra.config.CFMetaData.fromSchema(CFMetaData.java:1442)
at org.apache.cassandra.config.KSMetaData.deserializeColumnFamilies(KSMetaData.java:306)
at org.apache.cassandra.config.KSMetaData.fromSchema(KSMetaData.java:287)
at org.apache.cassandra.db.DefsTable.loadFromTable(DefsTable.java:154)
at org.apache.cassandra.config.DatabaseDescriptor.loadSchemas(DatabaseDescriptor.java:588)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:253)
at
org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:447)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:490)
Caused by: org.apache.cassandra.exceptions.ConfigurationException: SnappyCompressor.create() threw an error: java.lang.NoClassDefFoundError Could not initialize class org.xerial.snappy.Snappy
at org.apache.cassandra.io.compress.CompressionParameters.createCompressor(CompressionParameters.java:179)
at org.apache.cassandra.io.compress.CompressionParameters.<init>(CompressionParameters.java:71)
at org.apache.cassandra.io.compress.CompressionParameters.create(CompressionParameters.java:64)
at org.apache.cassandra.config.CFMetaData.fromSchemaNoColumns(CFMetaData.java:1415)
... 8 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.cassandra.io.compress.CompressionParameters.createCompressor(CompressionParameters.java:156)
... 11 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.xerial.snappy.Snappy
at org.apache.cassandra.io.compress.SnappyCompressor.create(SnappyCompressor.java:45)
... 16 more
Solved! Go to Solution.
Are you running RHEL 6.6. ?
Most likely your /tmp is mounted with a noexec command. in 6.6 I think that is the default configuration.
Run
mount | grep tmp
In the information you will see if it is mounted with "noexec"
cd /tmp vi testexec type in:echo hola quit vi chmod +x testexec ./testexec
and if the response is something like -bash: ./testexec: Permission denied then /tmp is mounted with noexec for sure
If so please run
mount -o remount,exec /tmp
Are you running RHEL 6.6. ?
Most likely your /tmp is mounted with a noexec command. in 6.6 I think that is the default configuration.
Run
mount | grep tmp
In the information you will see if it is mounted with "noexec"
cd /tmp vi testexec type in:echo hola quit vi chmod +x testexec ./testexec
and if the response is something like -bash: ./testexec: Permission denied then /tmp is mounted with noexec for sure
If so please run
mount -o remount,exec /tmp
Great.The solution worked.
Yes.We are runnning 6.6.You are correct we are mounted with noexec.
How do you get to know the root cause? just curious 🙂
-Vinay
Here is another option if your organization don't allow exec permission to /tmp file system due to security risk. You can use another folder and copy the lib file and add below lines to cassandra-env.sh
JVM_OPTS="$JVM_OPTS -Djava.library.path=<newpath>snappy-1.0.5-libsnappyjava.so" JVM_OPTS="$JVM_OPTS -Dorg.xerial.snappy.tempdir=<other path>"
Another option is to edit /etc/selinux/config to set:
SELINUX=disabled
Stephen
BTW, after making this change, you have to restart the server, or issue the command:
> setenforce 0
User | Count |
---|---|
7 | |
2 | |
2 | |
2 | |
1 |