簡體   English   中英

Cassandra 不是從 cassandra -f 開始的

[英]Cassandra is not starting with cassandra -f

盡管我的環境變量是正確的,但我無法使用 'cassandra -f' 啟動 cassandra。 我正在使用 Windows 10 機器。

我收到以下錯誤!

PS C:\WINDOWS\system32> cassandra -f                                                                                                                                                                            

*---------------------------------------------------------------------* *---------------------------------------------------------------------* WARNING! Automatic page file configuration detected. It is recommended that you disable swap when running Cassandra for performance and stability reasons. *---------------------------------------------------------------------* *---------------------------------------------------------------------* Exception calling "Start" with "0" argument(s): "The system cannot find the file specified" At C:\\cassandra\\conf\\cassandra-env.ps1:212 char:5 + $p.Start() | Out-Null + ~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : Win32Exception Exception calling "WaitForExit" with "0" argument(s): "No process is associated with this object." At C:\\cassandra\\conf\\cassandra-env.ps1:213 char:5 + $p.WaitForExit() + ~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : InvalidOperationException You cannot call a method on a null-valued expression. At C:\\cassandra\\conf\\cassandra-env.ps1:214 char:5 + $stderr = $p.StandardError.ReadToEnd() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\\cassandra\\conf\\cassandra-env.ps1:218 char:9 + if ($stderr.Contains("Error")) + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\\cassandra\\conf\\cassandra-env.ps1:231 char:5 + $sa = $stderr.Split("""") + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Cannot index into a null array. At C:\\cassandra\\conf\\cassandra-env.ps1:232 char:5 + $env:JVM_VERSION = $sa[1] + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : NullArray You cannot call a method on a null-valued expression. At C:\\cassandra\\conf\\cassandra-env.ps1:234 char:9 + if ($stderr.Contains("OpenJDK")) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Cannot index into a null array. At C:\\cassandra\\conf\\cassandra-env.ps1:247 char:5 + $pa = $sa[1].Split("_") + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : NullArray Cannot index into a null array. At C:\\cassandra\\conf\\cassandra-env.ps1:248 char:5 + $subVersion = $pa[1] + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : NullArray *---------------------------------------------------------------------* *---------------------------------------------------------------------* WARNING! Detected a power profile other than High Performance. Performance of this node will suffer. Modify conf\\cassandra.env.ps1 to suppress this warning. *---------------------------------------------------------------------* *---------------------------------------------------------------------* You cannot call a method on a null-valued expression. At C:\\cassandra\\conf\\cassandra-env.ps1:406 char:9 + if ($env:JVM_VERSION.CompareTo("1.8.0") -eq -1 -or [convert]::ToI ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Exception calling "Start" with "0" argument(s): "The system cannot find the file specified" At C:\\cassandra\\bin\\cassandra.ps1:251 char:9 + $p.Start() | Out-Null + ~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : Win32Exception Exception calling "WaitForExit" with "0" argument(s): "No process is associated with this object." At C:\\cassandra\\bin\\cassandra.ps1:253 char:9 + $p.WaitForExit() + ~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : InvalidOperationException

所以這是它看起來失敗的那一行:

 if ($env:JVM_VERSION.CompareTo("1.8.0") -eq -1

當我在 CentOS (Linux) 機器上運行java -version ,我看到以下輸出:

$ java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

如您所見,第一行的那個版本以某種格式“1.8.0_191”返回。

所以有幾點:

  1. 我不知道java -version的輸出為 Java 12 顯示了什么,但我知道某些 JDK 供應商的格式不同。 例如,AdoptOpenJDK 部署會導致 Cassandra 4.0 出現問題(根據此 JIRA: https ://issues.apache.org/jira/browse/CASSANDRA-14926)。

  2. Cassandra 版本 3(及更早版本)僅適用於 Java 8。Cassandra 4(尚未發布)最多支持 Java 11。AFAIK,Java 12 尚未列入路線圖。

當然,我會安裝較低版本的 Java。 如果您使用的是 Cassandra 3,則應安裝最新的 Java 8 補丁。

如果您仍然遇到問題,我會從 cassandra-env.ps1 文件中刪除 Java 版本檢查。 盡管如此,您這樣做有自己的危險。

我在 Windows 10 上的 Cassandra 3.11.7 遇到了同樣的問題,並通過正確設置 JAVA_HOME 解決了它。 我發現 JAVA_HOME 應該指向“bin”的父級,例如“C:\\Program Files\\Java\\jre1.8.0_261”而不是“C:\\Program Files\\Java\\jre1.8.0_261\\bin”。 這已解決錯誤“系統找不到指定的路徑”。

信用: https : //github.com/elastic/elasticsearch/issues/2274

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM