0

我創建了包含2個cassandra節點,2個搜索節點和2個Analytics節點的datastax cassandra Enterprise羣集。連接到EC2上的datastax羣集上的cassandra節點Ruby on Rails

一切似乎正常工作除了,我無法從外部連接到它。如果我在node0服務器上,我可以運行cassandra-cli並連接到端口9160上的cassandra節點,但是當我嘗試使用datastax-rails gem連接時,我得到「沒有活動服務器」我也試過了嘗試連接到的datastax devCenter本地端口9042,但也沒有工作。我真的很困惑,任何幫助表示讚賞。

所以一些挖後,我發現了一些問題

1. Port 9160 is connected and I can connect to it from telnet node0_ip 9160 
    2. when I run rake ds:migrate, I get No live servers in node0_ip 
    3. I tried to connect to 'cassandra' gem instead from IRB and tried 
     a. client = Cassandra.new('example', 'node0_ip:9160') 
     b. client.insert(:users, "5", {'screen_name' => "buttonscat4"}) 

    I got a similar error with ThriftClient::NoServersAvailable: No live servers but this time with all the IPs of all the nodes in the cluster 

    4. I tried adding "client.disable_node_auto_discovery!" and I was able to connect and add stuff using 'cassandra' Gem. 

    5. I also found on https://github.com/cassandra-rb/cassandra/issues/171 that I need to change your server to bind on a non-loopback address but have no idea what does that mean 

現在的問題是

回答

1

怎麼聽起來像是你需要打開你的EC2安全組到外部端口9160具體的安全組您的node0正在使用。

你可以在這裏找到更多關於他們的信息:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html

+0

因此,我打開該端口,我似乎從telnet連接到它,但當我運行耙ds:創建我仍然得到錯誤「沒有活服務器」我還應該包括我的datastax.yml文件設置開發: 服務器:[ 「xx.xx.xx.xxx:9160」] 密鑰空間: 「my_dse_ks」 strategy_class: 「org.apache.cassandra.locator.SimpleStrategy」 strategy_options:{ 「replication_factor」: 「2」} connection_options: 超時:10個 重試次數:2個 server_max_requests:1000 Solr的: 端口:8983 路徑:/ Solr的 –

+0

你能實際上包括在你的問題的文件嗎? – Rico

+0

我用更多的信息更新了這個問題 –

0

我得到了同樣的錯誤,並得到了這個利用disable_node_auto_discovery工作!

你可以在這個方法的文檔中看到它說:「當cassandra集羣內部使用不同於你用來連接的ip地址進行內部通信時,這主要是有幫助的,一個典型的例子是使用EC2來託管集羣,通常情況下,集羣將通過亞馬遜發佈的本地IP地址進行通信,但任何從外部EC2連接的客戶端都需要使用公共IP。

http://rdoc.info/github/cassandra-rb/cassandra/master/Cassandra:disable_node_auto_discovery

相關問題