2017-04-20 21 views
1

我在通過PHP從cassandra獲取結果時遇到問題。錯誤是隨機發生的(有時在30次重新載入後,有時連續幾次)。我使用的是DataStax PHP Driver 1.30和PHP 7.0。Cassandra PHP所有I/O線程上的所有連接都很忙

未捕獲的異常遇到 類型的錯誤:卡桑德拉\異常\ RuntimeException的 消息:所有的I/O線程的所有連接都忙

我的連接構造:

$this->cluster = Cassandra::cluster() 
    >withContactPoints('172.16.0.31') 
    ->build(); 
$this->session = $this->cluster->connect($this->keyspace); 

我的表功能:

$sql = new Cassandra\SimpleStatement("SELECT * FROM {$table}"); 
$future = $this->session->executeAsync($sql); 
$result = $future->get(); 
return $result; 

有誰知道如何解決這個問題?

+0

密鑰空間您連接是存在? –

+0

您是否嘗試啓用永久會話? 'Cassandra :: cluster() - > withPersistentSessions(true)'以及您的其他集羣構建選項。 – Fero

回答

0

Y,密鑰空間存在 我發現那位的溶液: 連接構造應該是:$this->cluster = Cassandra::cluster() ->withContactPoints('172.16.0.31')->withIOThreads(5)->build(); $this->session = $this->cluster->connect($this->keyspace);

相關問題