cassandra - How to find the first host contacted by cassandra driver during connection?
问题描述
Is there a way to find out which node was contacted first during the initial setup by the driver? For example, is there a way to find the host 10.9.58.64 that was contacted?
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
解决方案
Right after the connection is established you can use the cluster.get_control_connection_host function to get information about host to which so-called control connection is established. It's used for administrative purposes, such as getting the updates on the status of the nodes in the cluster, etc. There is more information about control connection in the documentation of Java driver.
推荐阅读
- python - 如何使用 Python 获取 Instagram 的粉丝数
- accelerometer - Tizen:传感器数据校准和记录的时间戳
- android - 如何在 Camerax 配置中更改 Camerax 的预览格式?
- node.js - 我无法使用 result.ops 方法查看使用 insertMany 插入的所有文档
- c++ - 回调 x64 VC++ 上的访问冲突错误
- python - Python flask:让数据库连接更高效
- azure - Azure 策略“应阻止来自 Internet 的 SSH 访问”,效果为拒绝
- wordpress-theming - 连接谷歌地图以显示表单搜索结果
- pandas - 熊猫:处理缺失数据时的真值条件是什么
- javascript - 如何使用 gridfs-stream 读取多个文件(图像)