Cassandra Startup java.lang.reflect.InvocationTargetException

时间:2013-10-23 06:54:40

标签: cassandra

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

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!

ERROR 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 Apr 23 19:29:00 UTC 2013

请帮助我..提前谢谢。

2 个答案:

答案 0 :(得分:2)

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

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

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

答案 1 :(得分:2)

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

你可以在cassandra-env.sh中添加这样的东西:

JVM_OPTS =&#34; $ JVM_OPTS -Dorg.xerial.snappy.tempdir = /路径/该/允许/可执行&#34;

我在/ var / lib / cassandra /

中创建了一个tmp文件夹

所以我添加了

JVM_OPTS =&#34; $ JVM_OPTS -Dorg.xerial.snappy.tempdir = / var / lib / cassandra / tmp /&#34;

希望这有帮助的人