我通过 brew 安装了 openjdk 和 cassandra。当我使用以下命令启动 cassandra 时出现此错误cassandra -f
:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x000000010df65ab8, pid=52667, tid=0x0000000000008603
#
# JRE version: OpenJDK Runtime Environment (8.0_275) (build 1.8.0_275-bre_2020_11_16_16_29-b00)
# Java VM: OpenJDK 64-Bit Server VM (25.275-b00 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V [libjvm.dylib+0x565ab8]
#
# Core dump written. Default location: /cores/core or core.52667
#
# An error report file with more information is saved as:
# /Users/my_laptop/hs_err_pid52667.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
看到后,我尝试卸载cassandra,并卸载openjdk。我从 oracle 安装了普通的 java。当我运行时java --version
,我现在看到:
java 15.0.1 2020-10-20
Java(TM) SE Runtime Environment (build 15.0.1+9-18)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)
我编译并运行了一个基本的 HelloWorld.java 文件,以确保我的命令行java
/javac
工作正常。然后我通过自制软件重新安装了 cassandra。但是阿特拉斯我看到了同样的错误。如果我用它开始,brew services start cassandra
我会收到一个错误:
? ~ brew services list
Name Status User Plist
cassandra error
和cassandra -f
,完全相同的错误:
OpenJDK 64-Bit Server VM warning: Cannot open file /usr/local/Cellar/cassandra/3.11.9_1/libexec/logs/gc.log due to No such file or directory
CompilerOracle: dontinline org/apache/cassandra/db/Columns$Serializer.deserializeLargeSubset (Lorg/apache/cassandra/io/util/DataInputPlus;Lorg/apache/cassandra/db/Columns;I)Lorg/apache/cassandra/db/Columns;
CompilerOracle: dontinline org/apache/cassandra/db/Columns$Serializer.serializeLargeSubset (Ljava/util/Collection;ILorg/apache/cassandra/db/Columns;ILorg/apache/cassandra/io/util/DataOutputPlus;)V
CompilerOracle: dontinline org/apache/cassandra/db/Columns$Serializer.serializeLargeSubsetSize (Ljava/util/Collection;ILorg/apache/cassandra/db/Columns;I)I
CompilerOracle: dontinline org/apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.advanceAllocatingFrom (Lorg/apache/cassandra/db/commitlog/CommitLogSegment;)V
CompilerOracle: dontinline org/apache/cassandra/db/transform/BaseIterator.tryGetMoreContents ()Z
CompilerOracle: dontinline org/apache/cassandra/db/transform/StoppingTransformation.stop ()V
CompilerOracle: dontinline org/apache/cassandra/db/transform/StoppingTransformation.stopInPartition ()V
CompilerOracle: dontinline org/apache/cassandra/io/util/BufferedDataOutputStreamPlus.doFlush (I)V
CompilerOracle: dontinline org/apache/cassandra/io/util/BufferedDataOutputStreamPlus.writeExcessSlow ()V
CompilerOracle: dontinline org/apache/cassandra/io/util/BufferedDataOutputStreamPlus.writeSlow (JI)V
CompilerOracle: dontinline org/apache/cassandra/io/util/RebufferingInputStream.readPrimitiveSlowly (I)J
CompilerOracle: inline org/apache/cassandra/db/rows/UnfilteredSerializer.serializeRowBody (Lorg/apache/cassandra/db/rows/Row;ILorg/apache/cassandra/db/SerializationHeader;Lorg/apache/cassandra/io/util/DataOutputPlus;)V
CompilerOracle: inline org/apache/cassandra/io/util/Memory.checkBounds (JJ)V
CompilerOracle: inline org/apache/cassandra/io/util/SafeMemory.checkBounds (JJ)V
CompilerOracle: inline org/apache/cassandra/utils/AsymmetricOrdering.selectBoundary (Lorg/apache/cassandra/utils/AsymmetricOrdering/Op;II)I
CompilerOracle: inline org/apache/cassandra/utils/AsymmetricOrdering.strictnessOfLessThan (Lorg/apache/cassandra/utils/AsymmetricOrdering/Op;)I
CompilerOracle: inline org/apache/cassandra/utils/BloomFilter.indexes (Lorg/apache/cassandra/utils/IFilter/FilterKey;)[J
CompilerOracle: inline org/apache/cassandra/utils/BloomFilter.setIndexes (JJIJ[J)V
CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare (Ljava/nio/ByteBuffer;[B)I
CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compare ([BLjava/nio/ByteBuffer;)I
CompilerOracle: inline org/apache/cassandra/utils/ByteBufferUtil.compareUnsigned (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
CompilerOracle: inline org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo (Ljava/lang/Object;JILjava/lang/Object;JI)I
CompilerOracle: inline org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo (Ljava/lang/Object;JILjava/nio/ByteBuffer;)I
CompilerOracle: inline org/apache/cassandra/utils/FastByteOperations$UnsafeOperations.compareTo (Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)I
CompilerOracle: inline org/apache/cassandra/utils/vint/VIntCoding.encodeVInt (JI)[B
INFO [main] 2020-12-29 22:29:28,063 YamlConfigurationLoader.java:92 - Configuration location: file:/usr/local/etc/cassandra/cassandra.yaml
INFO [main] 2020-12-29 22:29:28,283 Config.java:536 - Node configuration:[allocate_tokens_for_keyspace=null; authenticator=AllowAllAuthenticator; authorizer=AllowAllAuthorizer; auto_bootstrap=true; auto_snapshot=true; back_pressure_enabled=false; back_pressure_strategy=org.apache.cassandra.net.RateBasedBackPressure{high_ratio=0.9, factor=5, flow=FAST}; batch_size_fail_threshold_in_kb=50; batch_size_warn_threshold_in_kb=5; batchlog_replay_throttle_in_kb=1024; broadcast_address=null; broadcast_rpc_address=null; buffer_pool_use_heap_if_exhausted=true; cas_contention_timeout_in_ms=1000; cdc_enabled=false; cdc_free_space_check_interval_ms=250; cdc_raw_directory=null; cdc_total_space_in_mb=0; check_for_duplicate_rows_during_compaction=true; check_for_duplicate_rows_during_reads=true; client_encryption_optiOns=
INFO [main] 2020-12-29 22:29:28,284 DatabaseDescriptor.java:381 - DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap
INFO [main] 2020-12-29 22:29:28,284 DatabaseDescriptor.java:439 - Global memtable on-heap threshold is enabled at 998MB
INFO [main] 2020-12-29 22:29:28,284 DatabaseDescriptor.java:443 - Global memtable off-heap threshold is enabled at 998MB
INFO [main] 2020-12-29 22:29:28,470 RateBasedBackPressure.java:123 - Initialized back-pressure with high ratio: 0.9, factor: 5, flow: FAST, window size: 2000.
INFO [main] 2020-12-29 22:29:28,470 DatabaseDescriptor.java:773 - Back-pressure is disabled with strategy org.apache.cassandra.net.RateBasedBackPressure{high_ratio=0.9, factor=5, flow=FAST}.
INFO [main] 2020-12-29 22:29:28,669 JMXServerUtils.java:253 - Configured JMX server at: service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:7199/jmxrmi
INFO [main] 2020-12-29 22:29:28,676 CassandraDaemon.java:490 - Hostname: Peters-Mac.hsd1.ca.comcast.net
INFO [main] 2020-12-29 22:29:28,676 CassandraDaemon.java:497 - JVM vendor/version: OpenJDK 64-Bit Server VM/1.8.0_275
INFO [main] 2020-12-29 22:29:28,677 CassandraDaemon.java:498 - Heap size: 3.900GiB/3.900GiB
INFO [main] 2020-12-29 22:29:28,678 CassandraDaemon.java:503 - Code Cache Non-heap memory: init = 2555904(2496K) used = 7167616(6999K) committed = 7208960(7040K) max = 251658240(245760K)
INFO [main] 2020-12-29 22:29:28,678 CassandraDaemon.java:503 - Metaspace Non-heap memory: init = 0(0K) used = 19574984(19116K) committed = 20054016(19584K) max = -1(-1K)
INFO [main] 2020-12-29 22:29:28,678 CassandraDaemon.java:503 - Compressed Class Space Non-heap memory: init = 0(0K) used = 2344344(2289K) committed = 2490368(2432K) max = 1073741824(1048576K)
INFO [main] 2020-12-29 22:29:28,679 CassandraDaemon.java:503 - Par Eden Space Heap memory: init = 859045888(838912K) used = 240576832(234938K) committed = 859045888(838912K) max = 859045888(838912K)
INFO [main] 2020-12-29 22:29:28,679 CassandraDaemon.java:503 - Par Survivor Space Heap memory: init = 107347968(104832K) used = 0(0K) committed = 107347968(104832K) max = 107347968(104832K)
INFO [main] 2020-12-29 22:29:28,679 CassandraDaemon.java:503 - CMS Old Gen Heap memory: init = 3221225472(3145728K) used = 0(0K) committed = 3221225472(3145728K) max = 3221225472(3145728K)
INFO [main] 2020-12-29 22:29:28,679 CassandraDaemon.java:505 - Classpath: /usr/local/etc/cassandra:/usr/local/Cellar/cassandra/3.11.9_1/libexec/build/classes/main:/usr/local/Cellar/cassandra/3.11.9_1/libexec/build/classes/thrift:/usr/local/Cellar/cassandra/3.11.9_1/libexec/HdrHistogram-2.1.9.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/ST4-4.0.8.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/airline-0.6.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/antlr-runtime-3.5.2.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/apache-cassandra-3.11.9.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/apache-cassandra-thrift-3.11.9.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/asm-5.0.4.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/caffeine-2.2.6.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/cassandra-driver-core-3.0.1-shaded.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/commons-cli-1.1.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/commons-codec-1.9.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/commons-lang3-3.1.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/commons-math3-3.2.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/compress-lzf-0.8.4.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/concurrent-trees-2.4.0.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/concurrentlinkedhashmap-lru-1.4.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/disruptor-3.0.1.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/ecj-4.4.2.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/guava-18.0.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/high-scale-lib-1.0.6.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/hppc-0.5.4.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/jackson-annotations-2.9.10.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/jackson-core-2.9.10.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/jackson-databind-2.9.10.4.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/jamm-0.3.0.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/javax.inject.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/jbcrypt-0.3m.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/jcl-over-slf4j-1.7.7.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/jctools-core-1.2.1.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/jflex-1.6.0.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/jna-4.2.2.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/joda-time-2.4.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/json-simple-1.1.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/jstackjunit-0.0.1.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/libthrift-0.9.2.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/log4j-over-slf4j-1.7.7.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/logback-classic-1.1.3.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/logback-core-1.1.3.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/lz4-1.3.0.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/metrics-core-3.1.5.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/metrics-jvm-3.1.5.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/metrics-logback-3.1.5.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/netty-all-4.0.44.Final.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/ohc-core-0.4.4.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/ohc-core-j8-0.4.4.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/reporter-config-base-3.0.3.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/reporter-config3-3.0.3.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/sigar-1.6.4.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/slf4j-api-1.7.7.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/snakeyaml-1.11.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/snappy-java-1.1.1.7.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/snowball-stemmer-1.3.0.581.1.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/stream-2.5.2.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/thrift-server-0.3.7.jar:/usr/local/Cellar/cassandra/3.11.9_1/libexec/lib/jsr223/*/*.jar::/usr/local/Cellar/cassandra/3.11.9_1/libexec/jamm-0.3.0.jar
INFO [main] 2020-12-29 22:29:28,681 CassandraDaemon.java:507 - JVM Arguments: [-Xloggc:/usr/local/Cellar/cassandra/3.11.9_1/libexec/logs/gc.log, -ea, -XX:+UseThreadPriorities, -XX:ThreadPriorityPolicy=42, -XX:+HeapDumpOnOutOfMemoryError, -Xss256k, -XX:StringTableSize=1000003, -XX:+AlwaysPreTouch, -XX:-UseBiasedLocking, -XX:+UseTLAB, -XX:+ResizeTLAB, -XX:+UseNUMA, -XX:+PerfDisableSharedMem, -Djava.net.preferIPv4Stack=true, -XX:+UseParNewGC, -XX:+UseConcMarkSweepGC, -XX:+CMSParallelRemarkEnabled, -XX:SurvivorRatio=8, -XX:MaxTenuringThreshold=1, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:CMSWaitDuration=10000, -XX:+CMSParallelInitialMarkEnabled, -XX:+CMSEdenChunksRecordAlways, -XX:+CMSClassUnloadingEnabled, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintHeapAtGC, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -XX:+PrintPromotionFailure, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=10, -XX:GCLogFileSize=10M, -Xms4096M, -Xmx4096M, -Xmn1024M, -XX:+UseCondCardMark, -XX:CompileCommandFile=/usr/local/etc/cassandra/hotspot_compiler, -javaagent:/usr/local/Cellar/cassandra/3.11.9_1/libexec/jamm-0.3.0.jar, -Dcassandra.jmx.local.port=7199, -Dcom.sun.management.jmxremote.authenticate=false, -Dcom.sun.management.jmxremote.password.file=/etc/cassandra/jmxremote.password, -Djava.library.path=/usr/local/Cellar/cassandra/3.11.9_1/libexec/sigar-bin, -Dcassandra.libjemalloc=/usr/local/lib/libjemalloc.dylib, -XX:OnOutOfMemoryError=kill -9 %p, -Dlogback.cOnfigurationFile=logback.xml, -Dcassandra.logdir=/usr/local/var/log/cassandra, -Dcassandra.storagedir=/usr/local/var/lib/cassandra, -Dcassandra-foreground=yes]
INFO [main] 2020-12-29 22:29:28,786 StartupChecks.java:140 - jemalloc seems to be preloaded from /usr/local/lib/libjemalloc.dylib
WARN [main] 2020-12-29 22:29:28,787 StartupChecks.java:169 - JMX is not enabled to receive remote connections. Please see cassandra-env.sh for more info.
INFO [main] 2020-12-29 22:29:28,789 SigarLibrary.java:44 - Initializing SIGAR library
INFO [main] 2020-12-29 22:29:28,809 SigarLibrary.java:57 - Could not initialize SIGAR library org.hyperic.sigar.Sigar.getFileSystemListNative()[Lorg/hyperic/sigar/FileSystem;
INFO [main] 2020-12-29 22:29:28,809 SigarLibrary.java:185 - Sigar could not be initialized, test for checking degraded mode
我最终让它工作:
已卸载的 Cassandra
$ brew install --cask adoptopenjdk/openjdk/adoptopenjdk8
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
15.0.1, x86_64: "Java SE 15.0.1" /Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home
1.8.0_275, x86_64: "AdoptOpenJDK 8" /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
$ export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_275`
$ brew install cassandra
$ vim /usr/local/Cellar/cassandra/3.11.9_1/share/cassandra/cassandra.in.sh
将 JAVA_HOME 更改为:
JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_275`
最后,交叉手指并运行:
brew services start cassandra