Apache Zookeeper - K8s

Channel Revision Published Runs on
latest/stable 10 09 Mar 2022
Ubuntu 20.04
latest/beta 8 08 Jun 2021
Ubuntu 20.04
latest/edge 21 12 Apr 2023
Ubuntu 22.04 Ubuntu 20.04
latest/edge 16 15 Oct 2022
Ubuntu 22.04 Ubuntu 20.04
3/stable 51 27 Feb 2024
Ubuntu 22.04
3/candidate 51 27 Feb 2024
Ubuntu 22.04
3/beta 51 27 Feb 2024
Ubuntu 22.04
3/edge 67 16 Oct 2024
Ubuntu 22.04
juju deploy zookeeper-k8s --channel 3/stable
Show information

Platform:

charms.zookeeper_k8s.v0.cluster

Library for the ZooKeeper Cluster peer relation.


class ZooKeeperClusterEvents

ZooKeeper cluster events.

Description

This class defines the events that the ZooKeeper cluster can emit.

Events: servers_changed (_ServersChangedEvent)

class ZooKeeperCluster

ZooKeeper cluster peer relation.

Methods

ZooKeeperCluster. __init__( self , charm: CharmBase , client_port: int , server_port: int , election_port: int )

Constructor.

Arguments

charm (CharmBase)

The charm that implements the relation.

client_port (int)

Client port. Defaults to 2181.

server_port (int)

Server port. Defaults to 2888.

election_port (int)

Election port. Defaults to 3888.

ZooKeeperCluster. cluster_addresses( self )

Get the zookeeper servers from the relation.

Returns

List[str]

list containing the zookeeper servers. The servers are represented with a string that follows this format: <host>:<server-port>:<election-port>

ZooKeeperCluster. client_addresses( self )

Get the zookeeper servers from the relation.

Returns

List[str]

list containing the zookeeper servers. The servers are represented with a string that follows this format: <host>:<server-port>:<election-port>

ZooKeeperCluster. register_server( self , host: str )

Register a server as part of the cluster.

Arguments

host (str)

IP or hostname of the zookeeper server to be registered.

Description

This method will cause a relation-changed event in the other units, since it sets the key "host" in the unit relation data.