HeliosDB Docker Deployment Guide
HeliosDB Docker Deployment Guide
Complete guide for deploying HeliosDB using Docker and Docker Compose.
Table of Contents
- Prerequisites
- Quick Start
- Development Deployment
- Production Deployment
- Multi-Architecture Builds
- Configuration
- Monitoring
- Backup and Restore
- Troubleshooting
Prerequisites
- Docker 20.10+ with Buildx support
- Docker Compose 2.0+
- 8GB+ RAM for development, 32GB+ for production
- 100GB+ disk space per node
Quick Start
Single Container (Development)
# Build the imagedocker build -f Dockerfile.prod -t heliosdb:latest .
# Run single containerdocker run -d \ --name heliosdb \ -p 5432:5432 \ -p 3306:3306 \ -p 8443:8443 \ -v heliosdb-data:/var/lib/heliosdb \ heliosdb:latest
# Check healthdocker logs -f heliosdbcurl http://localhost:8443/healthDevelopment Cluster (3 nodes)
# Start development clusterdocker-compose up -d
# Check statusdocker-compose ps
# View logsdocker-compose logs -f heliosdb-server
# Access servicespsql -h localhost -p 5432 -U adminmysql -h localhost -P 3306 -u admincurl http://localhost:8443/health
# Stop clusterdocker-compose down
# Stop and remove volumes (data loss!)docker-compose down -vProduction Deployment
5-Node High Availability Cluster
# Create data directories (optional, for bind mounts)sudo mkdir -p /var/lib/heliosdb/{node1,node2,node3,node4,node5}sudo chown -R 1000:1000 /var/lib/heliosdb
# Set environment variablesexport GRAFANA_PASSWORD="secure_password_here"export HELIOSDB_DATA_PATH="/var/lib/heliosdb"
# Start production clusterdocker-compose -f docker-compose.prod.yml up -d
# Check cluster healthdocker-compose -f docker-compose.prod.yml ps
# View node logsdocker-compose -f docker-compose.prod.yml logs -f heliosdb-node1
# Check HAProxy statsopen http://localhost:8404/stats# Default credentials: admin / heliosdbProduction Services
The production deployment includes:
- 5 HeliosDB Nodes: High availability database cluster
- HAProxy: Load balancer with health checks
- Prometheus: Metrics collection and monitoring
- Grafana: Visualization and dashboards
- Jaeger: Distributed tracing
- Node Exporter: System metrics
- cAdvisor: Container metrics
Accessing Production Cluster
# Via HAProxy Load Balancerpsql -h localhost -p 5430 -U admin # PostgreSQL (load balanced)mysql -h localhost -P 3300 -u admin # MySQL (load balanced)curl http://localhost:8440/health # HTTP (load balanced)
# Direct node accesspsql -h localhost -p 5432 -U admin # Node 1psql -h localhost -p 5433 -U admin # Node 2psql -h localhost -p 5434 -U admin # Node 3psql -h localhost -p 5435 -U admin # Node 4psql -h localhost -p 5436 -U admin # Node 5
# Monitoring interfacesopen http://localhost:3000 # Grafana (admin / heliosdb_prod)open http://localhost:9090 # Prometheusopen http://localhost:16686 # Jaeger UIMulti-Architecture Builds
Build for Multiple Architectures
# Build for AMD64 and ARM64./scripts/build-docker.sh 4.0.0
# Build and push to registry./scripts/build-docker.sh 4.0.0 true
# Custom registryexport DOCKER_REGISTRY="myregistry.com"export DOCKER_REPOSITORY="myorg/heliosdb"./scripts/build-docker.sh 4.0.0 trueManual Multi-Arch Build
# Create builderdocker buildx create --name heliosdb-builder --use --bootstrap
# Build for multiple platformsdocker buildx build \ --platform linux/amd64,linux/arm64 \ --file Dockerfile.prod \ --tag heliosdb/heliosdb:4.0.0 \ --tag heliosdb/heliosdb:latest \ --push \ .Configuration
Environment Variables
Server Configuration:
HELIOSDB_POSTGRES_PORT- PostgreSQL port (default: 5432)HELIOSDB_MYSQL_PORT- MySQL port (default: 3306)HELIOSDB_HTTP_PORT- HTTP Gateway port (default: 8443)HELIOSDB_ORACLE_PORT- Oracle TNS port (default: 1521)HELIOSDB_SQLSERVER_PORT- SQL Server TDS port (default: 1433)HELIOSDB_BIND_ADDR- Bind address (default: 0.0.0.0)
Cluster Configuration:
HELIOS_NODE_TYPE- Node type (primary/replica)HELIOS_NODE_ID- Unique node identifierHELIOS_CLUSTER_NAME- Cluster nameHELIOS_RAFT_PEERS- Comma-separated Raft peer listHELIOS_METADATA_NODES- Comma-separated metadata node list
Performance Tuning:
HELIOSDB_MAX_CONNECTIONS- Maximum connections (default: 1000)HELIOSDB_SHARED_BUFFERS- Shared buffer size (default: 2GB)HELIOSDB_EFFECTIVE_CACHE_SIZE- Cache size (default: 6GB)HELIOSDB_WORK_MEM- Work memory (default: 64MB)
Logging:
RUST_LOG- Log level (info/debug/trace)HELIOSDB_LOG_LEVEL- Application log level
Custom Configuration
Create a .env file:
HELIOSDB_MAX_CONNECTIONS=2000HELIOSDB_SHARED_BUFFERS=4GBHELIOSDB_EFFECTIVE_CACHE_SIZE=12GBRUST_LOG=debugGRAFANA_PASSWORD=my_secure_passwordUse with Docker Compose:
docker-compose --env-file .env -f docker-compose.prod.yml up -dMonitoring
Prometheus Metrics
Access Prometheus: http://localhost:9090
Key metrics:
heliosdb_active_connections- Active database connectionsheliosdb_query_latency_seconds- Query execution timeheliosdb_transactions_total- Total transactionsheliosdb_cache_hits_total- Cache hit rateheliosdb_disk_reads_total- Disk read operationsheliosdb_raft_term- Raft consensus term
Grafana Dashboards
Access Grafana: http://localhost:3000
- Username: admin
- Password: heliosdb_prod (or custom from env)
Pre-configured dashboards:
- HeliosDB Overview
- Query Performance
- Resource Usage
- Replication Lag
- Cache Performance
- Error Rates
Jaeger Tracing
Access Jaeger: http://localhost:16686
View distributed traces for:
- Query execution paths
- Replication operations
- Cross-node communication
- API request flows
Backup and Restore
Manual Backup
# Backup using Docker execdocker exec heliosdb-node1 /scripts/backup.sh
# Backup volumesdocker run --rm \ -v heliosdb-node1-data:/data \ -v $(pwd)/backups:/backup \ alpine tar -czf /backup/node1-$(date +%Y%m%d).tar.gz -C /data .
# Copy backup from containerdocker cp heliosdb-node1:/var/backups/heliosdb/. ./backups/Automated Backups
Configure in docker-compose.prod.yml:
services: backup: image: heliosdb/heliosdb:4.0.0 command: /scripts/backup.sh volumes: - node1-data:/var/lib/heliosdb:ro - ./backups:/var/backups/heliosdb environment: - BACKUP_SCHEDULE=0 2 * * * # Daily at 2 AM - BACKUP_RETENTION=7Restore from Backup
# Stop the clusterdocker-compose -f docker-compose.prod.yml down
# Restore volumedocker run --rm \ -v heliosdb-node1-data:/data \ -v $(pwd)/backups:/backup \ alpine sh -c "rm -rf /data/* && tar -xzf /backup/node1-20250102.tar.gz -C /data"
# Restart clusterdocker-compose -f docker-compose.prod.yml up -dTroubleshooting
Check Container Health
# Check running containersdocker-compose -f docker-compose.prod.yml ps
# Check container logsdocker-compose -f docker-compose.prod.yml logs -f heliosdb-node1
# Check resource usagedocker stats
# Inspect containerdocker inspect heliosdb-node1Common Issues
Container won’t start:
# Check logsdocker logs heliosdb-node1
# Check permissionsdocker exec heliosdb-node1 ls -la /var/lib/heliosdb
# Check disk spacedocker exec heliosdb-node1 df -hConnection refused:
# Check if ports are boundnetstat -tulpn | grep -E '5432|3306|8443'
# Test connectivitydocker exec heliosdb-node1 nc -zv localhost 5432
# Check firewall rulessudo ufw statusPoor performance:
# Check resource limitsdocker inspect heliosdb-node1 | grep -A 10 Resources
# Monitor metricscurl http://localhost:9090/metrics
# Check disk I/Odocker stats --no-streamCluster split-brain:
# Check Raft statusdocker exec heliosdb-node1 heliosdb-cli cluster status
# Check logs for election issuesdocker-compose logs | grep -i raft
# Force re-electiondocker-compose restart heliosdb-node1Health Checks
# PostgreSQL healthpsql -h localhost -p 5432 -U admin -c "SELECT 1;"
# MySQL healthmysql -h localhost -P 3306 -u admin -e "SELECT 1;"
# HTTP health endpointcurl http://localhost:8443/healthcurl http://localhost:8443/metrics
# HAProxy healthcurl http://localhost:8404/statsPerformance Tuning
# Increase resourcesdocker-compose -f docker-compose.prod.yml up -d --scale heliosdb-node=7
# Adjust memory limitsdocker update --memory 16g --memory-swap 32g heliosdb-node1
# Monitor query performancedocker exec heliosdb-node1 heliosdb-cli query statsProduction Checklist
- Review and customize environment variables
- Set strong passwords and secrets
- Configure persistent storage paths
- Set up backup automation
- Configure monitoring alerts
- Review resource limits (CPU, memory)
- Enable SSL/TLS for external access
- Set up log aggregation
- Configure firewall rules
- Test disaster recovery procedures
- Document access credentials
- Set up monitoring dashboards
Support
- Documentation: https://docs.heliosdb.com
- Issues: https://github.com/heliosdb/heliosdb/issues
- Community: https://community.heliosdb.com
- Email: support@heliosdb.com