1

此异常的解决方案可能是什么

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.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:322)
at org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:229)
at org.xerial.snappy.Snappy.<clinit>(Snappy.java:48)
at org.xerial.snappy.SnappyOutputStream.<init>(SnappyOutputStream.java:79)
at org.xerial.snappy.SnappyOutputStream.<init>(SnappyOutputStream.java:66)
at org.apache.cassandra.net.OutboundTcpConnection.connect(OutboundTcpConnection.java:359)
at org.apache.cassandra.net.OutboundTcpConnection.run(OutboundTcpConnection.java:150)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/snappy-1.0.5-libsnappyjava.so: /tmp/snappy-1.0.5-libsnappyjava.so: failed to map segment from shared object: Operation not permitted
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1843)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1061)
at org.xerial.snappy.SnappyNativeLoader.load(SnappyNativeLoader.java:39)
... 11 more
ERROR 11:46:22,430 Exception in thread Thread[WRITE-/172.20.6.138,5,main]
org.xerial.snappy.SnappyError: [FAILED_TO_LOAD_NATIVE_LIBRARY] null
at org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:239)
at org.xerial.snappy.Snappy.<clinit>(Snappy.java:48)
at org.xerial.snappy.SnappyOutputStream.<init>(SnappyOutputStream.java:79)
at org.xerial.snappy.SnappyOutputStream.<init>(SnappyOutputStream.java:66)
at org.apache.cassandra.net.OutboundTcpConnection.connect(OutboundTcpConnection.java:359)
at org.apache.cassandra.net.OutboundTcpConnection.run(OutboundTcpConnection.java:150)

但 cassandra 启动执行仍在继续。最后我得到了例外

java.lang.IllegalStateException: Unable to contact any seeds!
at org.apache.cassandra.service.StorageService.bootstrap(StorageService.java:947)
at org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:716)
at org.apache.cassandra.service.StorageService.initServer(StorageService.java:554)
at org.apache.cassandra.service.StorageService.initServer(StorageService.java:451)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:347)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:446)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:489)
Exception encountered during startup: Unable to contact any seeds!

错误 11:55:11,732 线程线程中的异常 [StorageServiceShutdownHook,5,main]

java.lang.NullPointerException
at org.apache.cassandra.service.StorageService.stopRPCServer(StorageService.java:321)
at org.apache.cassandra.service.StorageService.shutdownClientServers(StorageService.java:370)
at org.apache.cassandra.service.StorageService.access$000(StorageService.java:88)
at org.apache.cassandra.service.StorageService$1.runMayThrow(StorageService.java:519)
at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28)
at java.lang.Thread.run(Thread.java:724)

但种子节点正在运行。

机器防火墙被禁用。

我还尝试更改默认 tmp 目录。我尝试将 JVM_OPTS=-Dorg.xerial.snappy.tempdir=/tmp 包含到 cassandra.in.sh 文件中,但问题仍然存在。

Linux 版本 2.6.32-358.6.1.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc 版本 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)) #1 SMP Tue 2013 年 4 月 23 日 19:29:00 UTC

请帮助我..提前谢谢。

4

2 回答 2

2

他们在 Cassandra JIRA 中提到了这个错误: https ://issues.apache.org/jira/browse/CASSANDRA-4400

我在使用 Cassandra 1.2 时遇到了类似的错误,我通过将 snappy 1.0.5 库替换为snappy 1.0.4.1来修复它。如果该链接不起作用,您应该能够从早期版本的 Cassandra(如 1.1.x)中获取该链接。

基本上,从您的$CASSANDRA_HOME/lib目录中删除 snappy-java.1.0.5.jar,并将其替换为 snappy-java-1.0.4.1.jar

于 2013-10-23T16:41:17.433 回答
2

我在http://mail-archives.apache.org/mod_mbox/cassandra-user/201312.mbox/%3C52C1DEC4.2080904@cj.com%3E中找到了 Erik 写的答案

您可以将这样的内容添加到 cassandra-env.sh :

JVM_OPTS="$JVM_OPTS -Dorg.xerial.snappy.tempdir=/path/that/allows/executables"

我在 /var/lib/cassandra/ 中创建了一个 tmp 文件夹

所以我加了

JVM_OPTS="$JVM_OPTS -Dorg.xerial.snappy.tempdir=/var/lib/cassandra/tmp/"

希望这对某人有帮助

于 2016-02-04T14:50:10.023 回答