npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

hexabot-helper-zookeeper

v2.2.3

Published

The Zookeeper Plugin Extension enabling leader election.

Downloads

4

Readme

Hexabot ZooKeeper Helper

Hexabot ZooKeeper Helper is an extension that integrates ZooKeeper for managing configurations and coordinating distributed systems in your Hexabot project. This helper allows you to interact with ZooKeeper to store, retrieve, and manage configuration data efficiently.

Hexabot is an open-source chatbot/agent solution that allows users to create and manage AI-powered, multi-channel, and multilingual chatbots. For more information, visit the official GitHub repository.

Features

  • Distributed Coordination: Helps manage distributed systems by coordinating and synchronizing processes across machines.

  • Leader Election: Facilitates leader election for distributed systems, ensuring one active leader for task coordination.

Environment Setup

Set your environment variables in the ./docker/.env file. These variables will be used by Docker Compose to set up the ZooKeeper connection. Example variables:

ZOOKEEPER_PORT=2181
ZOOKEEPER_SERVERS="server.1=zoo1:2888:3888;2181"

Settings Configuration

To configure the Zookeeper Helper, use the following settings in the Hexabot admin panel under Settings > Zookeeper:

| Label | Default Value | Type | Description | | -------------------------- | ------------------ | -------- | ------------------------------------------------------------------------------------------- | | endpoint | zoo1 (default) | Text | The endpoint for the Zookeeper server. | | port | 2181 (default) | Number | The port for the Zookeeper server. | | timeout | 5000 (default) | Number | The Heartbeat waiting time in ms. | | path | master (default) | Text | The path is like an address that helps locate a specific piece of data (called also znode). | | isHostOrderDeterministic | false (default) | Checkbox | Deterministic Host Order. |

Important: Dockerfile Requirement

To ensure ZooKeeper works properly in the API containers, add the following line in the API Dockerfile:

RUN apk add --no-cache python3 py3-pip build-base

This ensures that the necessary dependencies are available for ZooKeeper to function correctly.|

Installation

First, navigate to your Hexabot project directory and make sure the dependencies are installed:

cd ~/projects/my-hexabot-project
npm install hexabot-helper-zookeeper

Then follow these steps:

  1. Add the docker-compose.zookeeper.yml and docker-compose.replicas.dev.yml files under the docker/ folder.
  2. Create three copies of the api/ folder
cp -r api api_s1_n1 && cp -r api api_s1_n2 && cp -r api api_s1_n3
  1. Start the Zookeeper and replicas services with the following command: hexabot dev --services zookeeper,replicas

Docker compose files

Below an example of Zookeeper docker compose file docker/docker-compose.zookeeper.yml:

version: "3.8"

services:
  zoo1:
    container_name: zoo1
    networks:
      - app-network
    image: zookeeper:3.8
    restart: always
    hostname: zoo1
    ports:
      - ${ZOOKEEPER_PORT}:2181
    environment:
      ZOO_MY_ID: 1
      ZOO_SERVERS: ${ZOOKEEPER_SERVERS}

networks:
  app-network:

Below an example of Zookeeper docker compose file docker/docker-compose.replicas.yml:

version: "3.8"

services:
  api_s1_n1:
    build:
      context: ../api_s1_n1
      target: development
    pull_policy: build
    ports:
      - 6001:3000
    env_file: .env
    networks:
      - db-network
      - app-network
    volumes:
      - ../api_s1_n1/src:/app/src
      - ../api_s1_n1/migrations:/app/migrations
    depends_on:
      mongo:
        condition: service_healthy
    healthcheck:
      test: "wget --spider http://localhost:3000"
      interval: 10s
      timeout: 10s
      retries: 5
      start_period: 10s

  api_s1_n2:
    build:
      context: ../api_s1_n2
      target: development
    pull_policy: build
    ports:
      - 6002:3000
    env_file: .env
    networks:
      - db-network
      - app-network
    volumes:
      - ../api_s1_n2/src:/app/src
      - ../api_s1_n2/migrations:/app/migrations
    depends_on:
      mongo:
        condition: service_healthy
    healthcheck:
      test: "wget --spider http://localhost:3000"
      interval: 10s
      timeout: 10s
      retries: 5
      start_period: 10s

  api_s1_n3:
    build:
      context: ../api_s1_n3
      target: development
    pull_policy: build
    ports:
      - 6003:3000
    env_file: .env
    networks:
      - db-network
      - app-network
    volumes:
      - ../api_s1_n3/src:/app/src
      - ../api_s1_n3/migrations:/app/migrations
    depends_on:
      mongo:
        condition: service_healthy
    healthcheck:
      test: "wget --spider http://localhost:3000"
      interval: 10s
      timeout: 10s
      retries: 5
      start_period: 10s

networks:
  db-network:
  app-network:

Support

If you encounter any issues or have questions about using Hexabot Zookeeper Helper, feel free to contribute or open an issue on the Hexabot GitHub repository.

Feel free to join us on Discord