我正在运行DSE 3.2.1 并使用datastax java驱动程序cassandra-driver-core-1.0.5-dse.jar
可以确认DSE已启动并且已配置侦听器:
# lsof -p 27418 |grep -i listen |sed 's/^/ /'
java 27418 alan 202u IPv4 120289525 0t0 TCP *:48749 (LISTEN)
java 27418 alan 203u IPv4 120289526 0t0 TCP *:7199 (LISTEN)
java 27418 alan 204u IPv4 120289527 0t0 TCP *:49952 (LISTEN)
java 27418 alan 209u IPv4 120291873 0t0 TCP *:8983 (LISTEN)
java 27418 alan 224u IPv4 120291754 0t0 TCP karma:afs3-fileserver (LISTEN)
java 27418 alan 227u IPv4 120289911 0t0 TCP *:8009 (LISTEN)
java 27418 alan 259u IPv4 120291894 0t0 TCP karma:9042 (LISTEN)
java 27418 alan 260u IPv4 120291895 0t0 TCP karma:9160 (LISTEN)
@karma:conf grep -i native *yaml |grep -v ^#
start_native_transport: true
native_transport_port: 9042
但无法使用此驱动程序连接。 Scala代码:
import com.datastax.driver.core.
...
def open() {
logger.info("DatastaxEnterprise cluster host: {} port: {}", host, port)
cluster = Cluster.builder.addContactPoint(host).withPort(port).build
获得此例外:
14:55:45.316 [run-main] INFO DSE - DatastaxEnterprise cluster host: karma port: 9042
14:55:45.791 [run-main] DEBUG com.datastax.driver.core.Cluster - Starting new cluster with contact points [karma/192.168.0.24]
14:55:46.486 [run-main] DEBUG c.d.driver.core.ControlConnection - [Control connection] Refreshing node list and token map
14:55:47.559 [New I/O worker #1] DEBUG com.datastax.driver.core.Connection - Defuncting connection to karma/192.168.0.24
com.datastax.driver.core.TransportException: [karma/192.168.0.24] Unexpected exception triggered (java.lang.NoSuchMethodError: com.google.common.collect.Maps.immutableEnumMap(Ljava/util/Map;)Lcom/google/common/collect/ImmutableMap;)
at com.datastax.driver.core.Connection$Dispatcher.exceptionCaught(Connection.java:581) [cassandra-driver-core-1.0.5-dse.jar:na]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:112) [netty-3.6.6.Final.jar:na]
...
14:55:47.560 [run-main] DEBUG c.d.driver.core.ControlConnection - [Control connection] error on karma/192.168.0.24 connection (com.datastax.driver.core.TransportException: [karma/192.168.0.24] Unexpected exception triggered (java.lang.NoSuchMethodError: com.google.common.collect.Maps.immutableEnumMap(Ljava/util/Map;)Lcom/google/common/collect/ImmutableMap;)), no more host to try
14:55:47.562 [run-main] DEBUG com.datastax.driver.core.Cluster - Shutting down
有什么想法吗?我是否将9160或9042端口用于此驱动程序? 使用此处的参考代码示例: http://www.datastax.com/documentation/developer/java-driver/1.0/java-driver/quick_start/qsSimpleClientCreate_t.html
TIA,JM。