【问题标题】:How to find the first host contacted by cassandra driver during connection?如何在连接过程中找到 cassandra 驱动程序联系的第一台主机?
【发布时间】:2021-05-01 17:07:54
【问题描述】:

有没有办法找出驱动程序在初始设置期间首先联系的节点?比如有没有办法找到被联系的主机10.9.58.64?

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

【问题讨论】:

    标签: cassandra cassandra-python-driver


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2018-11-15
      • 2018-10-18
      • 2017-02-05
      • 2017-08-07
      • 2016-12-22
      • 2014-05-11
      • 2013-12-23
      • 2018-07-16
      • 2021-02-09
      相关资源
      最近更新 更多