【问题标题】:Couchbase cluster update visibility on clients客户端上的 Couchbase 集群更新可见性
【发布时间】:2016-10-14 09:56:40
【问题描述】:

我有以下场景:

  • 我有一个域名couchbase.myorg.com
  • 该记录有 1 个 A 记录,例如 10.0.0.5,它是 Couchbase 集群中的一个节点。
  • couchbase 集群有 5 个节点 10.0.0.5 - 10.0.0.9
  • 客户端使用这个连接字符串:couchbase://couchbase.myorg.com/my_bucket
  • 我正在使用 couchbase python client,它使用 libcouchbase C 库。

问题:

在以下情况下是否需要重新启动客户端才能获取集群更新:

  1. 如果10.0.0.6 从集群中移除。
  2. 如果 10.0.0.6 从集群中移除并替换为 10.0.0.10 的另一个节点。
  3. 如果10.0.0.10添加到集群中现有的5个节点。

【问题讨论】:

  • 根据developer.couchbase.com/documentation/server/4.5/sdk/c/…这不是必须的:After the offending node has been failed over the client will detect the node down within a matter of seconds. When the SDK detects a node has been failed over, it will remove it internally from its list of cluster nodes.

标签: python couchbase libcouchbase


【解决方案1】:

当 Couchbase 集群的拓扑发生变化时,不需要重新启动客户端。请注意,您应该始终为连接字符串提供多个 Couchbase 服务器节点。如果提供的 Couchbase Server 节点在客户端启动时处于脱机状态,则客户端将尝试联系其他节点。

您不需要枚举或将所有 Couchbase 集群节点传递给客户端。客户端只需要知道作为集群成员的单个节点。一旦客户端连接到该节点,它将向该节点查询有关集群拓扑的信息,该拓扑又包含有关所有 Couchbase 节点及其包含的服务的信息。

http://developer.couchbase.com/documentation/server/current/sdk/python/managing-connections.html#concept_ppz_lhq_44

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-11
    • 1970-01-01
    • 1970-01-01
    • 2019-12-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多