2016-02-12 99 views
2

當通過來自Scala應用程序的Phantom嘗試插入卡桑德拉時,我得到以下錯誤代碼。未能通過Phantom連接到Cassandra(NoHostAvailableException)

卡桑德拉版本是捆綁:DSC-卡桑德拉 - 3.0.1

[error] (run-main-0) com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces), localhost/0:0:0:0:0:0:0:1:9042 (com.datastax.driver.core.TransportException: [localhost/0:0:0:0:0:0:0:1:9042] Cannot connect)) com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces), localhost/0:0:0:0:0:0:0:1:9042 (com.datastax.driver.core.TransportException: [localhost/0:0:0:0:0:0:0:1:9042] Cannot connect))

我已經通過StackOverflow的其他此類問題閱讀,但還沒有找到一個解決我的問題。

此外,我還沒有發現任何其他錯誤日誌下面的存在:在讀localhost/127.0.0.1:9042

我是正確,這是否歸結爲127.0.0.1/127.0.0.1:9402 - 這可以解釋爲什麼它找不到正確的端口開放。

現在走下這條路,試圖弄清楚這是不是一件事。

已確保Cassandra正在運行。

I also ran sudo lsof -i -P | grep -i "listen" with the following output (just pulling out the java ones):

java 4053 dan_mi_sun 85u IPv4 0xdbcce7039c377b9d 0t0 TCP localhost:7199 (LISTEN) 
java 4053 dan_mi_sun 86u IPv4 0xdbcce703986952cd 0t0 TCP localhost:53680 (LISTEN) 
java 4053 dan_mi_sun 92u IPv4 0xdbcce7039869b46d 0t0 TCP localhost:7002 (LISTEN) 
java 4053 dan_mi_sun 145u IPv4 0xdbcce7039c37846d 0t0 TCP localhost:9042 (LISTEN) 

什麼的問題可能是有什麼想法?

有沒有發現這一點,但不知道這是否是相關的:

https://datastax-oss.atlassian.net/browse/JAVA-897

在情況下,它是利用這裏是build.sbt

name := "SuperChain" 

organization := "org.dyne.danielsan" 

version := "0.1.0-SNAPSHOT" 

scalaVersion := "2.11.7" 

crossScalaVersions := Seq("2.10.4", "2.11.2") 

resolvers ++= Seq(
    "Typesafe repository snapshots" at "http://repo.typesafe.com/typesafe/snapshots/", 
    "Typesafe repository releases" at "http://repo.typesafe.com/typesafe/releases/", 
    "Sonatype repo"     at "https://oss.sonatype.org/content/groups/scala-tools/", 
    "Sonatype releases"    at "https://oss.sonatype.org/content/org.dyne.danielsan.superchain.data.cassandra.init.repositories/releases", 
    "Sonatype snapshots"    at "https://oss.sonatype.org/content/org.dyne.danielsan.superchain.data.cassandra.init.repositories/snapshots", 
    "Sonatype staging"     at "http://oss.sonatype.org/content/org.dyne.danielsan.superchain.data.cassandra.init.repositories/staging", 
    "Java.net Maven2 Repository"  at "http://download.java.net/maven/2/", 
    "Twitter Repository"    at "http://maven.twttr.com", 
    "Wedsudos Bintray Repo"   at "https://dl.bintray.com/websudos/oss-releases/" 
) 

libraryDependencies ++= Seq(
    "com.websudos" %% "phantom-dsl" % "1.12.2", 
    "org.scalatest" %% "scalatest" % "2.2.1" % "test", 
    "org.scalacheck" %% "scalacheck" % "1.11.5" % "test" 
) 

initialCommands := "import org.dyne.danielsan.superchain._" 

回答

2

此錯誤:com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces使我相信您正在使用的幻影版本不使用datastax java-driver 3.0+。由於您連接到3.0羣集,因此您需要一個能夠理解架構表(system_schema。*而不是system.schema *)的3.0驅動程序。如果你升級到phantom-dsl 1.21.0,那應該解決這個問題。

相關問題