Apache Cassandra 无法启动 - 使用非默认 tmp 目录时出现 SIGSEGV 错误

问题描述 投票:0回答:1

我正在托管 RHEL8 实例上部署 Apache Cassandra。如果我在没有 noexec 标志的情况下重新挂载 /tmp,我可以成功安装并启动 Cassandra。一夜之间,公司安全策略恢复了 noexec 标志。

如果存在 noexec 标志,Cassandra 无法启动并出现错误

ERROR [main] 2024-06-24 10:19:18,156 NativeLibraryLinux.java:65 - Failed to link the C library  against JNA. Native methods will be unavailable.
java.lang.UnsatisfiedLinkError: /tmp/jna8661137960014770832.tmp: /tmp/jna8661137960014770832.tmp: failed to map segment from shared object

解决方案应该是更改 Cassandra 的 tmp 目录。我在 cassandra-env.sh 中设置了以下内容:

JVM_OPTS="$JVM_OPTS -Djna.tmpdir=/var/lib/cassandra/tmp"
JVM_OPTS="$JVM_OPTS -Djava.io.tmpdir=/var/lib/cassandra/tmp"`

我在 Cassandra 启动的早期阶段遇到了另一个错误:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f80d11e5152, pid=2277605, tid=2277607
#
# JRE version: OpenJDK Runtime Environment (Red_Hat-11.0.23.0.9-2) (11.0.23+9) (build     11.0.23+9-LTS)
# Java VM: OpenJDK 64-Bit Server VM (Red_Hat-11.0.23.0.9-2) (11.0.23+9-LTS, mixed mode, sharing, tiered, compressed oops, concurrent mark sweep gc, linux-amd64)
# Problematic frame:
# C  [jna10993927332404549884.tmp+0x13152]  ffi_prep_closure_loc+0x32`

从上面可以看到,致命错误发生在jna库中。

检查错误报告文件,看起来像是链接错误:

Internal exceptions (20 events):
Event: 2.449 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x00000006082a84f0}: 'long java.lang.invoke.DirectMethodHandle$Holder.invokeVirtual(java.lang.Object, java.lang.Object)'> (0x00000006082a84f0) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.456 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x000000060831f288}: 'void java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object)'> (0x000000060831f288) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.485 Thread 0x00007f810002e050 Exception <a 'java/lang/reflect/InvocationTargetException'{0x00000006085bb768}> (0x00000006085bb768) thrown at [src/hotspot/share/runtime/reflection.cpp, line 1245]
Event: 2.487 Thread 0x00007f810002e050 Exception <a 'java/lang/reflect/InvocationTargetException'{0x00000006085d34f8}> (0x00000006085d34f8) thrown at [src/hotspot/share/runtime/reflection.cpp, line 1245]
Event: 2.545 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x00000006087476a0}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)'> (0x00000006087476a0) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.546 Thread 0x00007f810002e050 Exception <a 'java/lang/IncompatibleClassChangeError'{0x00000006087504d0}: Found class java.lang.Object, but interface was expected> (0x00000006087504d0) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 839]
Event: 2.546 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x0000000608755740}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object)'> (0x0000000608755740) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.717 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x0000000609606ba8}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeSpecial(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)'> (0x0000000609606ba8) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.726 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x00000006096ee610}: 'void java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, java.lang.Object)'> (0x00000006096ee610) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.817 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x000000060b8ed080}: 'void java.lang.invoke.DirectMethodHandle$Holder.invokeVirtual(java.lang.Object, java.lang.Object)'> (0x000000060b8ed080) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.817 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x000000060b8f57e0}: 'void java.lang.invoke.DirectMethodHandle$Holder.invokeSpecial(java.lang.Object, java.lang.Object)'> (0x000000060b8f57e0) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.817 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x000000060b8f81a0}: 'void java.lang.invoke.Invokers$Holder.invoke_MT(java.lang.Object, java.lang.Object)'> (0x000000060b8f81a0) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.839 Thread 0x00007f810002e050 Exception <a 'java/lang/ClassNotFoundException'{0x000000060b968f90}: javax/management/remote/rmi/RMIServerImpl_Skel> (0x000000060b968f90) thrown at [src/hotspot/share/classfile/systemDictionary.cpp, line 230]
Event: 2.855 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x000000060ba07d50}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.lang.Object, int, long)'> (0x000000060ba07d50) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.888 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x000000060bbf30c0}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, long, java.lang.Object)'> (0x000000060bbf30c0) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.889 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x000000060bbfefc0}: 'java.lang.Object java.lang.invoke.Invokers$Holder.linkToTargetMethod(java.lang.Object, long, java.lang.Object)'> (0x000000060bbfefc0) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.890 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x000000060bc05498}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.lang.Object, java.lang.Object, java.lang.Object, int)'> (0x000000060bc05498) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.890 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x000000060bc08db0}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeSpecial(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, int)'> (0x000000060bc08db0) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.890 Thread 0x00007f810002e050 Exception <a 'java/lang/NoSuchMethodError'{0x000000060bc0be18}: 'java.lang.Object java.lang.invoke.Invokers$Holder.linkToTargetMethod(java.lang.Object, java.lang.Object, int, java.lang.Object)'> (0x000000060bc0be18) thrown at [src/hotspot/share/interpreter/linkResolver.cpp, line 773]
Event: 2.895 Thread 0x00007f810002e050 Implicit null exception at 0x00007f80f02ad984 to 0x00007f80f02addec

我正在使用 Apache Cassandra 4.1.5-1 中捆绑的 jna JAR(jna JAR:jna-5.9.0.jar)。

我尝试卸载并重新安装 Cassandra 和 Java。 安装的Java版本是yum确定的依赖: java-1.8.0-openjdk-headless.x86_64 1:1.8.0.412.b08-2.el8 @rhel-8-for-x86_64-appstream-rpms

java-8 cassandra redhat jna
1个回答
0
投票

这看起来与此处描述的问题相同:https://issues.apache.org/jira/browse/CASSANDRA-19565

尝试升级到4.1.6。

© www.soinside.com 2019 - 2024. All rights reserved.