2017-03-02 75 views
0

我是这个领域的新手,并试图使用cassandra(Datastax)。根据他们网站上的说明,我吸收了JDK和cassandra。无法启动窗口上的cassandra 10

但是,当我试图运行CQL shell时,我得到以下错误。我搜索找到一个解决方案,但没有找到一个。

没有重新安装cassandra,但没有帮助。你可以选择任何解决方案吗?

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")}) 
+0

你检查了Windows防火墙有没有打开这些端口?要查看cassandra使用的端口,请选中[链接](https://docs.datastax.com/en/cassandra/2.1/cassandra/security/secureFireWall_r.html) –

+0

在您的cassandra.yaml中,您绑定了哪个IP卡桑德拉进程?你真的使用localhost/loopback IP吗? – Ralf

回答

0

安装时,DataStax Cassandra添加了运行Cassandra服务器的服务。但是,该服务可能无法在启动时运行,并可能拒绝运行。

试试下面的命令:

net start DataStax_DDC_Server 

,如果你看到这样的消息:

The DataStax DDC Server 3.8.0 service could not be started. 

然后你有这个问题。

如果您使用的是Community Edition(与我一样),支持已经停止,所以我不希望在将来修复。

同时,可以使用手动解决方法。首先,将C:\ Program Files \ DataStax-DDC \ apache-cassandra \ bin添加到您的环境中的PATH变量中,以使生活更轻松。

现在打开两个CLI(或Powershell窗口)。

在第一,运行下面的命令:

cassandra -f 

观看的输出。寻找一条线如:

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

服务器现在正在侦听连接。

让第一个CLI运行,然后切换到第二个。运行命令:

cqlsh <ip address> <port> 

并希望它应该工作。

附录:默认情况下,无法在Windows 10 Datastax Cassandra中进行制表。为了解决这个问题,需要将pyreadline python模块复制到DataStax-DDC \ python \ Lib \ site-packages文件夹中(复制,未安装.DataStax python发行版无法安装模块)。