简体   繁体   English

无法在Windows 10上启动cassandra

[英]unable to start cassandra on windows 10

I am new to this field and was trying to use cassandra (Datastax). 我是这个领域的新手,并且正在尝试使用cassandra(Datastax)。 I inatlled JDK and cassandra as per the instruction given on their site. 我根据他们网站上给出的指示填写了JDK和cassandra。

but while I am trying to run CQL shell I am getting below error. 但是当我试图运行CQL shell时,我遇到了错误。 I searched to find a solution but couldnt find one. 我搜索找到一个解决方案,但找不到。

did re-install the cassandra but didnt help. 确实重新安装了cassandra但没有帮助。 can you sggest any solution ? 你能解决任何解决方案吗?

    C:\Program Files\DataStax-DDC\apache-cassandra\bin>cqlsh 127.0.0.1 9042
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(10061, "Tried connecting to [('127.0.0.1', 9042)]. Last error: No connection could be made because the target machine actively refused it")})

When installed, DataStax Cassandra adds a service for running the Cassandra Server. 安装后,DataStax Cassandra会添加一项用于运行Cassandra Server的服务。 However, the service may not run at startup and may refuse to run. 但是,该服务可能无法在启动时运行,并可能拒绝运行。

Try the following command: 请尝试以下命令:

net start DataStax_DDC_Server

if you see a message like this: 如果你看到这样的消息:

The DataStax DDC Server 3.8.0 service could not be started.

Then you are having this problem. 然后你遇到了这个问题。

If you are using Community Edition (like me), support has been discontinued so I would not expect a fix in the future. 如果你正在使用Community Edition(像我一样),支持已经停止,所以我不希望将来修复。

Meanwhile, a manual workaround is available. 同时,还提供手动解决方法。

Firstly, append C:\\Program Files\\DataStax-DDC\\apache-cassandra\\bin to your PATH variable in your environment, to make life easier. 首先,将C:\\ Program Files \\ DataStax-DDC \\ apache-cassandra \\ bin附加到您环境中的PATH变量,以使生活更轻松。

Now open two CLIs (or Powershell windows). 现在打开两个CLI(或Powershell窗口)。

In the first, run the command: 在第一个中,运行命令:

cassandra -f

Watch the output. 观看输出。 Look for a line such as: 寻找一条线,如:

INFO  nn:nn:nn Starting listening for CQL clients on /<ip address>:<port>

The server is now listening for connections. 服务器现在正在侦听连接。

Leave the first CLI running, and switch to the second. 保持第一个CLI运行,并切换到第二个CLI。 Run the command: 运行命令:

cqlsh <ip address> <port>

And hopefully it should work. 希望它应该工作。

Addendum: You cannot tab-complete in Windows 10 Datastax Cassandra by default. 附录:默认情况下,您无法在Windows 10 Datastax Cassandra中完成制表选项。 To fix this, the pyreadline python modules need to be copied into the DataStax-DDC\\python\\Lib\\site-packages folder (copied, not installed. The DataStax python distribution has no ability to install modules). 要解决这个问题,需要将pyreadline python模块复制到DataStax-DDC \\ python \\ Lib \\ site-packages文件夹中(复制,未安装.DataStax python发行版无法安装模块)。

For 64bit v3.0.9 (I installed through the .msi found here 对于64位v3.0.9(我通过这里找到的.msi安装

If you didn't leave "Automatically start DataStax Cassandra Community Service" checked when installing you'll want to reinstall and leave it checked. 如果您在安装时没有选中“自动启动DataStax Cassandra社区服务”,则需要重新安装并保持选中状态。

Goto C:\\Program Files\\DataStax Community and rename the file cassandra.ymal.orig to cassandra.yaml and leave it in the folder it's already in and then start Cassandra CQL Shell. 转到 C:\\Program Files\\DataStax Community并将文件cassandra.ymal.orig重命名为cassandra.yaml并将其保留在已存在的文件夹中,然后启动Cassandra CQL Shell。

Note: I don't know if it's needed but I backed up my cassandra.ymal.orig before doing this. 注意:我不知道是否需要它,但我在执行此操作之前备份了我的cassandra.ymal.orig。

Also, if anyone could shed light on what the command for windows would be to start Cassandra that would be awesome. 此外,如果有人能够了解Windows的命令是什么启动Cassandra将是非常棒的。 It seems at least in part this issue is the service just won't start 至少在某种程度上,这个问题似乎是服务无法启动

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM