Configuration Guide
Complete guide to configuring Axon OS for your environment, including system settings, performance tuning, and environment-specific configurations.
Overview
Axon OS uses a hierarchical configuration system that allows for flexible deployment across different environments.
Configuration Sources (Priority Order)
- Command line arguments
- Environment variables
- Configuration files
- Default values
Configuration Files
Main Configuration: axonos.yml
# Server Configuration
server:
host: "0.0.0.0"
port: 8080
ssl:
enabled: false
cert_path: "/path/to/cert.pem"
key_path: "/path/to/key.pem"
# Database Configuration
database:
host: "localhost"
port: 5432
name: "axonos"
username: "axonos_user"
password: "${DB_PASSWORD}"
ssl_mode: "require"
max_connections: 100
connection_timeout: 30s
# Redis Configuration
redis:
host: "localhost"
port: 6379
password: "${REDIS_PASSWORD}"
database: 0
max_connections: 10
# Workflow Engine
workflow:
max_concurrent_executions: 50
execution_timeout: 1h
retry_attempts: 3
retry_delay: 5s
# Node Registry
nodes:
registry_path: "/opt/axonos/nodes"
auto_discovery: true
cache_enabled: true
cache_ttl: 1h
# Logging
logging:
level: "info"
format: "json"
output: "stdout"
file_rotation:
enabled: true
max_size: "100MB"
max_files: 10
Environment-Specific Overrides
Development: axonos.dev.yml
logging:
level: "debug"
format: "text"
workflow:
max_concurrent_executions: 5
Production: axonos.prod.yml
server:
ssl:
enabled: true
cert_path: "/etc/ssl/certs/axonos.crt"
key_path: "/etc/ssl/private/axonos.key"
database:
max_connections: 200
ssl_mode: "require"
logging:
level: "warn"
output: "file"
file_path: "/var/log/axonos/app.log"
Environment Variables
Required Variables
# Database
export DB_PASSWORD="your_secure_password"
export DB_HOST="db.example.com"
# Redis
export REDIS_PASSWORD="redis_password"
export REDIS_URL="redis://user:pass@host:port/db"
# Security
export JWT_SECRET="your_jwt_secret_key"
export API_KEY_SECRET="api_key_encryption_secret"
# External Services
export AWS_ACCESS_KEY_ID="your_aws_key"
export AWS_SECRET_ACCESS_KEY="your_aws_secret"
Optional Variables
# Performance
export AXONOS_MAX_WORKERS="4"
export AXONOS_MEMORY_LIMIT="2GB"
# Features
export AXONOS_ENABLE_METRICS="true"
export AXONOS_ENABLE_TRACING="true"
# Environment
export AXONOS_ENV="production"
export AXONOS_LOG_LEVEL="info"
Database Configuration
PostgreSQL Setup
-- Create database and user
CREATE DATABASE axonos;
CREATE USER axonos_user WITH PASSWORD 'secure_password';
GRANT ALL PRIVILEGES ON DATABASE axonos TO axonos_user;
-- Performance settings
ALTER SYSTEM SET shared_buffers = '256MB';
ALTER SYSTEM SET effective_cache_size = '1GB';
ALTER SYSTEM SET maintenance_work_mem = '64MB';
SELECT pg_reload_conf();
Connection Pool Settings
database:
pool:
min_connections: 5
max_connections: 100
connection_lifetime: 1h
idle_timeout: 10m
health_check_interval: 30s
Redis Configuration
Performance Tuning
# Memory optimization
maxmemory 2gb
maxmemory-policy allkeys-lru
# Persistence
save 900 1
save 300 10
save 60 10000
# Network
tcp-keepalive 300
timeout 300
Clustering (for high availability)
redis:
cluster:
enabled: true
nodes:
- "redis-1:6379"
- "redis-2:6379"
- "redis-3:6379"
sentinel:
enabled: true
master_name: "axonos-master"
sentinels:
- "sentinel-1:26379"
- "sentinel-2:26379"
Security Configuration
Authentication Settings
auth:
jwt:
secret: "${JWT_SECRET}"
expires_in: "24h"
algorithm: "HS256"
oauth:
google:
client_id: "${GOOGLE_CLIENT_ID}"
client_secret: "${GOOGLE_CLIENT_SECRET}"
github:
client_id: "${GITHUB_CLIENT_ID}"
client_secret: "${GITHUB_CLIENT_SECRET}"
api_keys:
enabled: true
prefix: "axon_"
encryption_key: "${API_KEY_SECRET}"
SSL/TLS Configuration
ssl:
enabled: true
certificate: "/etc/ssl/certs/axonos.crt"
private_key: "/etc/ssl/private/axonos.key"
ca_bundle: "/etc/ssl/certs/ca-bundle.crt"
# TLS settings
min_version: "1.2"
cipher_suites:
- "TLS_AES_256_GCM_SHA384"
- "TLS_CHACHA20_POLY1305_SHA256"
- "TLS_AES_128_GCM_SHA256"
Performance Tuning
Workflow Engine Optimization
workflow:
execution:
# Parallel execution settings
max_concurrent_executions: 100
node_parallelism: 10
# Timeout settings
default_timeout: 30m
max_timeout: 2h
# Memory settings
max_memory_per_execution: "512MB"
memory_cleanup_interval: 5m
scheduler:
# Job scheduling
batch_size: 50
poll_interval: 1s
max_retries: 5
# Queue settings
priority_queues: 5
dead_letter_queue: true
Caching Configuration
cache:
# In-memory cache
memory:
enabled: true
max_size: "256MB"
ttl: 1h
# Redis cache
redis:
enabled: true
key_prefix: "axonos:"
ttl: 24h
# Node cache
nodes:
enabled: true
cache_compiled: true
ttl: 6h
Monitoring and Observability
Metrics Configuration
metrics:
enabled: true
endpoint: "/metrics"
prometheus:
enabled: true
scrape_interval: 15s
custom_metrics:
- name: "workflow_executions_total"
type: "counter"
description: "Total workflow executions"
- name: "node_execution_duration"
type: "histogram"
description: "Node execution time"
Logging Configuration
logging:
level: "info"
format: "json"
# Structured logging fields
fields:
service: "axonos"
version: "${APP_VERSION}"
# Log rotation
rotation:
enabled: true
max_size: "100MB"
max_age: "7d"
max_backups: 10
compress: true
# External logging
external:
elasticsearch:
enabled: false
url: "https://elasticsearch:9200"
index: "axonos-logs"
fluentd:
enabled: false
host: "fluentd"
port: 24224
Tracing Configuration
tracing:
enabled: true
service_name: "axonos"
jaeger:
enabled: true
endpoint: "http://jaeger:14268/api/traces"
sampling:
type: "probabilistic"
rate: 0.1
Load Balancing
Nginx Configuration
upstream axonos_backend {
least_conn;
server axonos-1:8080 max_fails=3 fail_timeout=30s;
server axonos-2:8080 max_fails=3 fail_timeout=30s;
server axonos-3:8080 max_fails=3 fail_timeout=30s;
}
server {
listen 80;
server_name axonos.example.com;
location / {
proxy_pass http://axonos_backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# WebSocket support
location /ws {
proxy_pass http://axonos_backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Docker Configuration
Docker Compose
version: '3.8'
services:
axonos:
image: axonos/axonos:latest
ports:
- "8080:8080"
environment:
- DB_HOST=postgres
- REDIS_HOST=redis
- AXONOS_ENV=production
volumes:
- ./config:/etc/axonos
- ./logs:/var/log/axonos
depends_on:
- postgres
- redis
restart: unless-stopped
postgres:
image: postgres:14
environment:
- POSTGRES_DB=axonos
- POSTGRES_USER=axonos_user
- POSTGRES_PASSWORD=${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
redis:
image: redis:7
command: redis-server --requirepass ${REDIS_PASSWORD}
volumes:
- redis_data:/data
restart: unless-stopped
volumes:
postgres_data:
redis_data:
Kubernetes Configuration
Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: axonos
spec:
replicas: 3
selector:
matchLabels:
app: axonos
template:
metadata:
labels:
app: axonos
spec:
containers:
- name: axonos
image: axonos/axonos:latest
ports:
- containerPort: 8080
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: axonos-secrets
key: db-password
resources:
requests:
memory: "512Mi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1000m"
Configuration Validation
Startup Checks
The system performs configuration validation on startup:
- Database connectivity
- Redis connectivity
- SSL certificate validity
- Required environment variables
- Node registry accessibility
Health Checks
health:
enabled: true
endpoint: "/health"
checks:
- name: "database"
timeout: 5s
- name: "redis"
timeout: 3s
- name: "node_registry"
timeout: 10s
Troubleshooting
Common Configuration Issues
-
Database Connection Errors
- Check connection string format
- Verify network connectivity
- Confirm credentials
-
Memory Issues
- Adjust max_memory settings
- Enable garbage collection tuning
- Monitor heap usage
-
Performance Problems
- Review cache settings
- Optimize database queries
- Tune connection pools
Configuration Testing
# Validate configuration
axonos config validate
# Test database connection
axonos config test-db
# Check all external dependencies
axonos config check