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. (Default ports for chronolog: 2222, 2225, 3333, 4444, 5555, 5557, 6666, 7777, 8888) (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.




Launching ChronoLog Multi-Node Setup

Step 3: Prepare Hosts Files

ChronoLog does not automatically deploy upon starting the containers. You must manually configure the hosts files before deployment.

Inside chronolog-c1, create the required host configuration files:

docker exec -it chronolog-c1 bash

If successful, you’ll see:

grc-iit@c1:~$

Inside the Docker container, navigate to the ChronoLog configuration directory:

cd ~/chronolog_install/Release/conf/

Prepare the required hosts files:

echo "chronolog-c1" > hosts_visor
echo "chronolog-c2" > hosts_keeper
echo "chronolog-c3" > hosts_grapher
echo "chronolog-c4" > hosts_player
echo "chronolog-c1" > hosts_client

Step 4: Deploy ChronoLog

Run the deployment script to distribute ChronoLog across the containers:

cd ~/chronolog_repo/deploy/
./single_user_deploy.sh -d --work-dir ~/chronolog_install/Release/

This script will:

  • Start ChronoVisor, ChronoKeepers, ChronoGrapher, and ChronoPlayers.
  • Configure inter-container communication.
  • Ensure each node operates within the distributed ChronoLog system.

Verify the deployment:

pgrep -la chrono

Expected output:

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

Step 5: Run a Client Performance Test

To verify the deployment, launch a client performance test from the deploy directory:

cd ~/chronolog_install/Release/deploy/
LD_LIBRARY_PATH=~/chronolog_install/Release/lib ../.spack-env/view/bin/mpiexec -n 4 -f ~/chronolog_install/Release/conf/hosts_client \
  ~/chronolog_install/Release/bin/client_admin --config ~/chronolog_install/Release/conf/default_conf.json \
  -a 4096 -b 4096 -s 4096 -n 4096 -t 1 -h 1 -p -r

This will:

  • Execute a client_admin performance test across four client processes.
  • Use the predefined host configuration.
  • Validate correct system functionality.

Step 6: View Logs (Optional)

Check logs of specific nodes:

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

NOTE, DEPLOYMENT NEEDS TO BE STOPPED.

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

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