简体   繁体   English

无法连接到Presto的Cassandra

[英]Unable to connect to Cassandra in Presto

I have setup Cassandra, and I've created a keyspace('mykeyspace') and a table in it. 我已经设置了Cassandra,并且我创建了一个键空间('mykeyspace')和一个表格。 I started Cassandra as a service, added the cassandra.properties file like this, in the presto installation files: 我启动了Cassandra作为服务,在presto安装文件中添加了这样的cassandra.properties文件:

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

After this I have issued this command in Presto but I'm not sure if it is connecting to the Cassandra data: 在此之后我在Presto发出了这个命令,但我不确定它是否连接到Cassandra数据:

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

Now, when I give the command 'show tables', I get this Exception-message: 现在,当我给出命令'show tables'时,我得到了这个Exception消息:

All host(s) tried for query failed (tried: localhost/127.0.0.1 (com.datastax.driver.core.TransportException: [localhost/127.0.0.1] Cannot connect)) 所有主机尝试查询失败(尝试:localhost / 127.0.0.1(com.datastax.driver.core.TransportException:[localhost / 127.0.0.1]无法连接))

I have used cqlsh, to view a created table in 'mykeyspace' in cassandra, and hence sure that cassandra is running. 我使用cqlsh来查看cassandra中'mykeyspace'中创建的表,因此确保cassandra正在运行。

I would really appreciate any help to clear this error. 我真的很感激任何帮助,以清除此错误。

If you have a default cassandra installation, the dafault native protocol port is 9042. If that is the case, you can remove cassandra.native-protocol-port and cassandra.thrift-port properties. 如果您有默认的cassandra安装,则dafault本机协议端口为9042.如果是这种情况,您可以删除cassandra.native-protocol-portcassandra.thrift-port属性。

If you want to keep this ports, you can change cassandra.yaml configuration file , property native_transport_port 如果要保留此端口,可以更改cassandra.yaml配置文件 ,属性native_transport_port

I hope it's helps. 我希望它有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM