Cassandra 2.2.1 不会开始使用 cassandra -f
Posted
技术标签:
【中文标题】Cassandra 2.2.1 不会开始使用 cassandra -f【英文标题】:Cassandra 2.2.1 will not start using cassandra -f 【发布时间】:2015-10-01 04:38:41 【问题描述】:我已经从 apache.cassandra 下载了 cassandra。
我已确保我的 env 路径变量设置正确。
我在 Windows 命令提示符中键入:cassandra -f,这就是我得到的:
E:\apache-cassandra-2.2.1\bin>cassandra -f
Detected powershell execution permissions. Running with enhanced startup scripts.
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
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 E:\apache-cassandra-2.2.1\conf\cassandra-env.ps1:249 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 E:\apache-cassandra-2.2.1\conf\cassandra-env.ps1:250 char:5
+ $p.WaitForExit()
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : InvalidOperationException
You cannot call a method on a null-valued expression.
At E:\apache-cassandra-2.2.1\conf\cassandra-env.ps1:251 char:5
+ $stderr = $p.StandardError.ReadToEnd()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At E:\apache-cassandra-2.2.1\conf\cassandra-env.ps1:255 char:9
+ if ($stderr.Contains("Error"))
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At E:\apache-cassandra-2.2.1\conf\cassandra-env.ps1:268 char:5
+ $sa = $stderr.Split("""")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Cannot index into a null array.
At E:\apache-cassandra-2.2.1\conf\cassandra-env.ps1:269 char:5
+ $env:JVM_VERSION = $sa[1]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
You cannot call a method on a null-valued expression.
At E:\apache-cassandra-2.2.1\conf\cassandra-env.ps1:271 char:9
+ if ($stderr.Contains("OpenJDK"))
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Cannot index into a null array.
At E:\apache-cassandra-2.2.1\conf\cassandra-env.ps1:284 char:5
+ $pa = $sa[1].Split("_")
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At E:\apache-cassandra-2.2.1\conf\cassandra-env.ps1:285 char:5
+ $env:JVM_PATCH_VERSION=$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 E:\apache-cassandra-2.2.1\conf\cassandra-env.ps1:413 char:9
+ if (($env:JVM_VERSION.CompareTo("1.7") -eq 1) -and ($env:JVM_ARCH ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At E:\apache-cassandra-2.2.1\conf\cassandra-env.ps1:417 char:10
+ if ( (($env:JVM_VERSION.CompareTo("1.7") -ge 0) -and ($env:JVM_PA ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Exception calling "Start" with "0" argument(s): "The system cannot find the file specified"
At E:\apache-cassandra-2.2.1\bin\cassandra.ps1:249 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 E:\apache-cassandra-2.2.1\bin\cassandra.ps1:251 char:9
+ $p.WaitForExit()
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : InvalidOperationException
E:\apache-cassandra-2.2.1\bin>
这让我发疯了。我不明白为什么这么难。
我在 Windows 10 pro 上运行并且有足够的空间。这是在笔记本电脑上,应该可以,但当然不是。
我的 cassandra.yaml 文件很好。
我正在运行 localhost 作为我的“种子”。我应该将其设为 127.0.0.1、localhost 还是仅设为本地机器的 IP?
我需要调整我的“etc/hosts”文件吗?
任何能提供帮助的人都将不胜感激。
【问题讨论】:
你的问题最后解决了吗? 【参考方案1】:-
在:
C:\Program Files\apache-cassandra-3.11.3\conf" folder open the file - "cassandra-env
。
搜索:JAVA_HOME
它将显示由 java exe 文件的代码创建的路径。
仔细检查并确保路径正确。
您可以通过直接更新文件或更新环境变量来完成此操作,如其他答案中所述。
【讨论】:
【参考方案2】:这可能是由于 Cassandra 指向的 JAVA_HOME 环境变量。 .ps1 脚本文件中的 JAVA_HOME 环境变量指向 JAVA_HOME\bin\java.exe,因此在您的系统中,环境变量应不包括“bin”,即 C:\Program Files\Java\jdk1.8.0_172 以避免在 JAVA_HOME 之后发生冲突,它会自动将 bin\java.exe 附加到文件中。
p.s 这对我来说是这样的。
【讨论】:
谢谢兄弟,它也对我有用,非常感谢。我花了 5 个多小时在这再次感谢兄弟【参考方案3】:我在设置 Cassandra 2.1.11 时遇到并解决了类似的错误。在我的情况下,脚本需要一个 JAVA_BIN 环境变量。检查 .ps1 脚本并创建缺少的环境变量 JAVA_BIN 指向 ...\bin\java.exe。
【讨论】:
无法相信脚本在缺少环境变量时会出现如此多的错误。这成功了【参考方案4】:有同样的问题。原来我没有以管理员身份运行 CMD... :self-face-slap:
【讨论】:
【参考方案5】:你可以看到这样一行$env:JAVA_BIN = "$env:JAVA_HOME\bin\java.exe
在 cassandra\conf 文件夹内的 cassandra-env.ps1 中。当 JAVA_HOME 路径错误时会发生此错误。转到系统-> 环境变量更改为 JAVA_HOME 以更正 jdk 文件夹的路径。
【讨论】:
以上是关于Cassandra 2.2.1 不会开始使用 cassandra -f的主要内容,如果未能解决你的问题,请参考以下文章