2017-03-02 118 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發行版無法安裝模塊)。