无法连接到Presto的Cassandra

时间:2014-08-12 08:07:34

标签: cassandra presto

我已经设置了Cassandra,我已经创建了一个密钥空间(' mykeyspace')和一个表格。我启动了Cassandra作为服务,在presto安装文件中添加了这样的cassandra.properties文件:

connector.name=cassandra
cassandra.contact-points=localhost
cassandra.native-protocol-port=9142
cassandra.thrift-port=9160

在此之后我在Presto发出了这个命令,但我不确定它是否连接到Cassandra数据:

./presto --server localhost:8080 --catalog cassandra --schema mykeyspace

现在,当我发出命令' show tables'时,我收到此异常消息:

所有主机尝试查询失败(尝试:localhost / 127.0.0.1(com.datastax.driver.core.TransportException:[localhost / 127.0.0.1]无法连接))

我使用了cqlsh,在mykeyspace'中查看已创建的表格。在cassandra,因此肯定cassandra正在运行。

我真的很感激有任何帮助来清除这个错误。

1 个答案:

答案 0 :(得分:3)

如果您安装了默认的cassandra,则dafault本机协议端口为9042.如果是这种情况,您可以删除cassandra.native-protocol-portcassandra.thrift-port属性。

如果您想保留此端口,可以更改cassandra.yaml configuration file,属性native_transport_port

我希望它有所帮助。

相关问题