首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何查找cassandra驱动在连接过程中联系到的第一个主机?

如何查找cassandra驱动在连接过程中联系到的第一个主机?
EN

Stack Overflow用户
提问于 2021-01-28 03:49:48
回答 1查看 84关注 0票数 1

有没有办法找出驱动程序在初始设置过程中最先联系到哪个节点?例如,有没有办法找到所联系的主机10.9.58.64?

代码语言:javascript
复制
WARNING:cassandra.cluster:Cluster.__init__ called with contact_points specified, but no load_balancing_policy. In the next major version, this will raise an error; please specify a load-balancing policy. (contact_points = ['cassandranode1,;cassandranode2'], lbp = None)
DEBUG:cassandra.cluster:Connecting to cluster, contact points: ['cassandranode1,;cassandranode2']; protocol version: 4
DEBUG:cassandra.io.asyncorereactor:Validated loop dispatch with cassandra.io.asyncorereactor._AsyncorePipeDispatcher
DEBUG:cassandra.pool:Host 10.9.58.64 is now marked up
DEBUG:cassandra.pool:Host 10.9.58.65 is now marked up
DEBUG:cassandra.cluster:[control connection] Opening new connection to 10.9.58.64
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-01-31 00:29:33

在建立连接之后,您可以使用cluster.get_control_connection_host函数来获取有关已建立所谓控制连接的主机的信息。它用于管理目的,例如获取集群中节点状态的更新等。在documentation of Java driver中有更多关于控制连接的信息。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65926366

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档