English | 中文
Enterprise-grade Apache ZooKeeper distributed coordination service for Kubernetes with high availability, strong consistency, and integrated monitoring.
Apache ZooKeeper is an open-source distributed coordination service that provides consistency guarantees for distributed applications. This package delivers a production-ready ZooKeeper ensemble on Kubernetes, featuring configuration management, naming services, distributed locking, leader election, and cluster management. ZooKeeper is widely adopted in distributed systems for service discovery, configuration management, and consensus.
- Configuration management: Centralized configuration management service
- Naming service: Service naming and discovery for distributed systems
- Distributed locking: Lock mechanisms for distributed environments
- Cluster management: Cluster node management and monitoring
- Data synchronization: Data synchronization across distributed environments
- Leader election: Leader election support for distributed systems
- High availability: Multi-node ensemble deployment with automatic failover
- Strong consistency: ZAB protocol-based data consistency guarantees
- Monitoring and alerting: Integrated Prometheus metrics and alert rules
- Log management: Structured logging output with log rotation
- Durable storage: Data persistence with snapshot management
- Auto-purge: Automatic cleanup of expired snapshots and logs
- ACL control: Access control list support
- Observer mode: Observer nodes to reduce write pressure
- Dynamic reconfiguration: Cluster dynamic reconfiguration support
- Snapshot management: Data snapshot and recovery
- Resource management: CPU and memory resource limits
- Node affinity: Pod anti-affinity and node affinity configuration
- Tolerations: Taint toleration settings
- Health checks: Built-in liveness and readiness probes
- Metrics export: Prometheus-format metrics
- Graceful shutdown: Graceful shutdown mechanism
- 3.7.2 (latest stable)
- Package version: 1.3.1-1.0.0
- Use cases: Development, testing, and quick deployment
- Traits: Single replica, minimal resource usage
- Topology: 1 ZooKeeper instance
- Use cases: Production environments
- Traits: Multi-replica with automatic failover
- Topology: 3 ZooKeeper instances
- Use cases: Production environments requiring distributed coordination
- Traits: High availability, strong consistency, configurable replica count
- Topology: 3+ instances (odd number recommended)
+---------------------------------------------------------+
| ZooKeeper Ensemble |
+---------------------------------------------------------+
| +-----------+ +-----------+ +-----------+ |
| | Leader | | Follower | | Follower | |
| | | | | | | |
| | +-------+ | | +-------+ | | +-------+ | |
| | | ZNode | | | | ZNode | | | | ZNode | | |
| | | Tree | | | | Tree | | | | Tree | | |
| | +-------+ | | +-------+ | | +-------+ | |
| +-----------+ +-----------+ +-----------+ |
+---------------------------------------------------------+
| Client Connection Layer |
| +-----------+ +-----------+ +-----------+ |
| | Client | | Client | | Client | |
| | 1 | | 2 | | 3 | |
| +-----------+ +-----------+ +-----------+ |
+---------------------------------------------------------+
| ZooKeeper Operator |
| +-----------+ +-----------+ +-----------+ |
| | Manager | |Controller | | Webhook | |
| +-----------+ +-----------+ +-----------+ |
+---------------------------------------------------------+
| Kubernetes Resources |
| StatefulSet | Service | PVC | ConfigMap | Secret | Job |
+---------------------------------------------------------+
- ZooKeeper: Core distributed coordination engine
- ZooKeeper Operator: Kubernetes operator for lifecycle management
- Exporter: Prometheus metrics collector
- Kubernetes 1.26+
- OpenSaola Operator deployed
- saola-cli installed
# Publish the package
saola publish zookeeper/
# Install the operator
saola operator create zk-operator --type ZooKeeper --version 3.7.2
# Create an instance
saola middleware create my-zookeeper --type ZooKeeper --version 3.7.2
# Check status
saola middleware get my-zookeeper| Action | Description |
|---|---|
| restart | Restart the middleware instance |
Key parameters can be customized via the baseline configuration. See manifests/*parameters.yaml for the full parameter reference:
manifests/clusterparameters.yaml-- Cluster mode parametersmanifests/sentinelparameters.yaml-- Sentinel mode parameters
- Recommended topology: Operator Standard or Standalone
- Resources: CPU 1 core, memory 2 Gi, storage 20 Gi
- Suggested version: ZooKeeper 3.7.2
- Instances: 1
- Recommended topology: Cluster or Operator Highly Available
- Resources: CPU 2 cores, memory 4 Gi, storage 50 Gi
- Suggested version: ZooKeeper 3.7.2
- Instances: 3+ (odd number for quorum)
- Configure ACL permissions for ZNode access control
- Enforce strong passwords with mixed character classes
- Restrict network access to the ensemble
- Rotate credentials periodically
- Enable SASL authentication for production environments
- Set JVM heap size appropriately for the workload
- Configure a suitable garbage collector
- Monitor memory usage and avoid memory leaks
- Use connection pools and tune session timeouts
- Monitor network latency between nodes
- Track node status, connection count, and request latency
- Monitor outstanding requests and pending syncs
- Define alert thresholds for critical metrics
- Watch file descriptor usage and storage utilization
- Review cluster health regularly
- Deploy an odd number of nodes (3 or 5) for proper quorum
- Configure Pod anti-affinity to spread nodes across hosts
- Set up automatic snapshot purging
- Establish data backup and recovery procedures
- Plan capacity based on connection count and data volume
| Project | Description |
|---|---|
| OpenSaola Operator | Core Kubernetes operator for middleware lifecycle management |
| saola-cli | Command-line tool for middleware management |
| PostgreSQL | PostgreSQL database package |
| MySQL | MySQL database package |
| Kafka | Apache Kafka streaming platform package |
| Redis | Redis in-memory data store package |
| Elasticsearch | Elasticsearch search engine package |
| RabbitMQ | RabbitMQ message broker package |
This project is licensed under the Apache License 2.0.