我是这个领域的新手,正在尝试使用 cassandra (Datastax)。我按照他们网站上给出的说明安装了 JDK 和 cassandra。
但是当我尝试运行 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")})
最佳答案
安装后,DataStax Cassandra 添加了一项用于运行 Cassandra 服务器的服务。但是,该服务可能不会在启动时运行并可能拒绝运行。
尝试以下命令:
net start DataStax_DDC_Server
如果您看到这样的消息:
The DataStax DDC Server 3.8.0 service could not be started.
那你就有这个问题了。
如果您使用的是社区版(像我一样),支持已经停止,所以我不希望将来有修复。
同时,可以使用手动解决方法。
首先,将 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 发行版无法安装模块)。
关于cassandra - 无法在 Windows 10 上启动 Cassandra,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42547495/