Skip to content

Tutorial 4: Running ChronoLog with Docker (Multi node)

EnekoGonzalez3 edited this page Mar 20, 2025 · 14 revisions

Welcome! This tutorial will guide you through setting up ChronoLog in a multi-node environment using Docker Compose. By the end, you'll have a fully operational distributed ChronoLog system, where multiple containers work together to simulate a real deployment.

Overview

What You’ll Learn

✅ Deploy a multi-node version of ChronoLog using Docker.
✅ Configure and run different system setups based on your needs.
✅ Understand how to interact with ChronoLog, including running workloads efficiently.

If you're new to ChronoLog or want a simpler setup, check out our Single-Node Tutorial:
📌 Running ChronoLog with Docker (Single-Node)


Prerequisites: Docker & Docker Compose

ChronoLog runs inside Docker containers to ensure a stable, portable, and dependency-free environment. Docker Compose orchestrates multiple containers, making multi-node setups easy to manage.

1. Install Docker & Docker Compose

Follow these links to install them if you haven’t already:

2. Verify Installation

Run the following commands to confirm Docker and Docker Compose are installed:

docker --version  # Should return a version number
docker compose version  # Should return a version number

If either command fails, follow the installation guides above before proceeding.


Setting Up the ChronoLog Multi-Node Environment

Step 1: Download the ChronoLog Docker Image

Pull the latest ChronoLog image from Docker Hub:

docker pull gnosisrc/chronolog:latest

Verify the image was downloaded successfully:

docker images | grep chronolog

Step 2: Download the Docker Compose Configuration

Retrieve the docker-compose.yml file:

wget https://raw.githubusercontent.com/grc-iit/ChronoLog/refs/heads/develop/CI/docker/distributed.docker-compose.yaml

Verify the file exists:

ls | grep distributed.docker-compose.yaml

Step 3: Check System Requirements

Ensure your system meets the following: ✅ At least 4GB RAM (8GB+ recommended)
At least 4 CPU cores
Sufficient disk space
No conflicting ports in use (check using: netstat -tulnp | grep LISTEN)


Launching ChronoLog Multi-Node Setup

Step 1: Navigate to the Docker Compose Directory

cd /path/to/distributed.docker-compose.yaml

Verify the file is present:

ls | grep distributed.docker-compose.yaml

Step 2: Start ChronoLog Using Docker Compose

docker compose -f distributed.docker-compose.yaml up -d

This:

  • Launches multiple ChronoLog containers (c1, c2, c3, etc.).
  • Runs them in the background (-d flag).
  • Sets up an internal ChronoLog network (chronolog_net).
  • Shares a volume (shared_home) among containers.

Check running containers:

docker ps

You should see chronolog-c1, chronolog-c2, chronolog-c3, and chronolog-c4.

Step 3: Access the Primary Node (c1)

docker exec -it chronolog-c1 bash

If successful, you’ll see:

grc-iit@c1:~$

Step 4: Verify ChronoLog Components Are Running

Inside c1, run:

pgrep -la chrono

Expected output:

  • ChronoVisor (log controller)
  • ChronoKeepers (log storage managers)
  • ChronoGrapher (query and indexing service)
  • ChronoPlayer (stream processor)

Step 5: View Container Logs (Optional)

docker logs chronolog-c1  # View logs of c1
docker logs -f chronolog-c1  # Live logs
docker compose logs -f  # Logs for all containers

Stopping the Multi-Node Setup

To stop all containers:

docker compose -f distributed.docker-compose.yaml down

To remove volumes as well:

docker compose -f distributed.docker-compose.yaml down -v

Customizing ChronoLog Setups

The default setup launches:

  • 1x ChronoVisor (must remain one)
  • 1x ChronoKeeper
  • 1x ChronoGrapher
  • 1x ChronoPlayer

Scaling Specific Components

To increase the number of Keepers, Graphers, or Players, use:

docker compose -f distributed.docker-compose.yaml up -d --scale c2=3 --scale c3=3 --scale c4=3

Explanation:

  • --scale c2=3 → Launches 3 ChronoKeepers.
  • --scale c3=3 → Launches 3 ChronoGraphers.
  • --scale c4=3 → Launches 3 ChronoPlayers.
  • ChronoVisor (c1) remains a single instance.

Verify scaling:

docker ps

Note: Scaling this way is temporary. To make permanent changes, modify docker-compose.yml.

Stopping Custom Setups

To stop all containers:

docker compose -f distributed.docker-compose.yaml down

To reset everything:

docker compose -f distributed.docker-compose.yaml down -v

What’s Next?

Now that ChronoLog is running in a multi-node setup, you can:

  • Deploy workloads inside the containers.
  • Integrate ChronoLog into your existing infrastructure.
  • Modify and optimize your setup based on specific needs.

Stay tuned for further tutorials on advanced configurations and optimizations! 🚀

Clone this wiki locally