通过Google Cloud Compute连接到cassandra

时间:2015-07-28 13:33:14

标签: google-app-engine cassandra

我通过他们的启动器部署了一个Cassandra集群:https://cloud.google.com/launcher/explore?q=cassandra

我可以通过SSH / PuTTY连接到VM。

然后,当我尝试连接例如DBeaver时,我得到:

com.datastax.driver.core.exceptions.NoHostAvailableExeption: All host(s) tried for query failed(tried: /x.x.x.x:9160) com.datastax.driver.core.ConnectionExption:[/x.x.x.x:9160] Unexpected error during transport initialization. Connection has been closed

或者使用cassandra-driver(nodejs),我得到:

All host(s) tried for query failed. First host tried, x.x.x.x:9160: Error: read ECONNRESET. See innerErrors. InnerErrors: { 'x.x.x.x:9160': { [Error: read ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' } } Info: Represents an error when a query cannot be performed because no host is available or could be reached by the driver.

我转发了谷歌开发者控制台中的9160端口,它似乎有效,因为当我停止VM上的cassandra服务器时,它会出现不同的错误,表示连接被拒绝:

All host(s) tried for query failed. First host tried, x.x.x.x:9160: Error: connect ECONNREFUSED. See innerErrors. InnerErrors: { 'x.x.x.x:9160': { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } } Info: Represents an error when a query cannot be performed because no host is available or could be reached by the driver.

现在,我已尝试将cassandra.yaml rcp_adress编辑为实际的external地址,而不是0.0.0.0。 我还尝试了internal serverfarm地址。

我没有更改默认身份验证(但也尝试使用auth):

authenticator: AllowAllAuthenticator
# authenticator: PasswordAuthenticator

authorizer: AllowAllAuthorizer
# authorizer: CassandraAuthorizer

我感到茫然,连接似乎有效,但cassandra似乎不允许登录或重置连接?

1 个答案:

答案 0 :(得分:2)

您正尝试连接旧货端口(9160)。您应该使用本机协议端口(9042)。