首页 文章

无法连接到Presto的Cassandra

提问于
浏览
1

我已经设置了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'时,我得到了这个Exception消息:

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

我使用cqlsh来查看cassandra中'mykeyspace'中创建的表,因此确保cassandra正在运行 .

我真的很感激任何帮助,以清除此错误 .

1 回答

  • 3

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

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

    我希望它有所帮助 .

相关问题