使用cassandra phantom获取Cannot build a cluster without contact points
Using cassandra phantom getting Cannot build a cluster without contact points
我正在使用 phantom 2.12.1 和 cassandra 5.2。
我是 运行 使用 docker 的 cassandra,但我一直收到这个令人讨厌的错误:
知道是什么原因造成的吗?
Caused by: java.lang.IllegalArgumentException: Cannot build a cluster without contact points
at com.datastax.driver.core.Cluster.checkNotEmpty(Cluster.java:119)
at com.datastax.driver.core.Cluster.(Cluster.java:112)
at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:178)
at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:1335)
at com.outworkers.phantom.connectors.DefaultSessionProvider.(DefaultSessionProvider.scala:41)
at com.outworkers.phantom.connectors.CassandraConnection.provider$lzycompute(CassandraConnection.scala:41)
at com.outworkers.phantom.connectors.CassandraConnection.provider(CassandraConnection.scala:41)
at com.outworkers.phantom.connectors.CassandraConnection$Connector$class.provider(CassandraConnection.scala:91)
错误信息相当明确;您的联系点最终被作为主机参数传递了一个空序列。
检查您的配置并确保当您在连接器定义中调用 ContactPoint 时序列不为空
当无法为提供的主机名解析 IP 时,也会发生此问题。这就是 DataStax Driver 中的实现方式。
详情请看下面link
正如其中一个答案所说 "If you are specifying ip addresses to begin with, they will not be resolved, simply checked for validity. If you are using hostnames then each contact point will need to be resolvable."
如果使用有效主机,解决方法是直接提供 IP 地址作为连接端点,以便绕过 DNS 查找或删除 DNS 查找有问题的主机。
我正在使用 phantom 2.12.1 和 cassandra 5.2。
我是 运行 使用 docker 的 cassandra,但我一直收到这个令人讨厌的错误:
知道是什么原因造成的吗?
Caused by: java.lang.IllegalArgumentException: Cannot build a cluster without contact points at com.datastax.driver.core.Cluster.checkNotEmpty(Cluster.java:119) at com.datastax.driver.core.Cluster.(Cluster.java:112) at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:178) at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:1335) at com.outworkers.phantom.connectors.DefaultSessionProvider.(DefaultSessionProvider.scala:41) at com.outworkers.phantom.connectors.CassandraConnection.provider$lzycompute(CassandraConnection.scala:41) at com.outworkers.phantom.connectors.CassandraConnection.provider(CassandraConnection.scala:41) at com.outworkers.phantom.connectors.CassandraConnection$Connector$class.provider(CassandraConnection.scala:91)
错误信息相当明确;您的联系点最终被作为主机参数传递了一个空序列。
检查您的配置并确保当您在连接器定义中调用 ContactPoint 时序列不为空
当无法为提供的主机名解析 IP 时,也会发生此问题。这就是 DataStax Driver 中的实现方式。
详情请看下面link
正如其中一个答案所说 "If you are specifying ip addresses to begin with, they will not be resolved, simply checked for validity. If you are using hostnames then each contact point will need to be resolvable."
如果使用有效主机,解决方法是直接提供 IP 地址作为连接端点,以便绕过 DNS 查找或删除 DNS 查找有问题的主机。