我现在在Ubuntu上尝试用PHP连接到Cassandra。我已经安装了Datastax php-driver和它的所有依赖项,但在尝试运行测试文件时出现以下错误:
PHP Fatal error: Uncaught Cassandra\Exception\LogicException: Not implemented in /home/philip/Documents/test.php:3
Stack trace:
#0 /home/user/Documents/test.php(3): Cassandra\Cluster\Builder->build()
#1 {main}
thrown in /home/user/Documents/test.php on line 3
代码如下所示:
<?php
// Connect to the cluster and keyspace "killrvideo"
$cluster = Cassandra::cluster()->build();
$keyspace = 'killrvideo';
$session = $cluster->connect($keyspace);
我设法使用shell cqlsh连接到cassandra,我可以看到我设置的表。不过,php代码似乎不起作用。你知道为什么吗?
发布于 2019-05-30 08:42:23
嗯,这对我来说不是很清楚,但是你是从同一个服务器调用的吗?你使用巫术策略吗?简单还是网络拓扑?但我确信一些东西会对此起作用
$cluster = Cassandra::cluster()->withContactPoints('127.0.0.1')->build();
//或者如果您从不同的服务器呼叫,只需替换ip
https://stackoverflow.com/questions/42065573
复制相似问题