Real-time CDC gateway for synchronizing MySQL, PostgreSQL, and MongoDB data to Elasticsearch.
594
ElasticRelay is a high-performance, real-time Change Data Capture (CDC) gateway that synchronizes data from multiple database sources (MySQL, PostgreSQL, MongoDB) to Elasticsearch. Built in Go for optimal performance and reliability, it offers zero-code configuration with built-in data governance and transformation capabilities.
# Download example configuration
curl -O https://raw.githubusercontent.com/yogoosoft/elasticrelay/main/docker-compose.yml
# Start the stack
docker-compose up -d
# Create configuration file
cat > config.json << EOF
{
"version": "3.0",
"data_sources": [{
"id": "mysql-main",
"type": "mysql",
"host": "mysql-host",
"port": 3306,
"user": "elastic_user",
"password": "password",
"database": "your_database",
"server_id": 100,
"table_filters": ["users", "orders", "products"]
}],
"sinks": [{
"id": "es-main",
"type": "elasticsearch",
"addresses": ["http://elasticsearch:9200"],
"options": {
"index_prefix": "elasticrelay"
}
}],
"global": {
"log_level": "info",
"grpc_port": 50051
}
}
EOF
# Run ElasticRelay
docker run -d \
--name elasticrelay \
-p 50051:50051 \
-v $(pwd)/config.json:/app/config/config.json \
elasticrelay/elasticrelay:latest \
--config /app/config/config.json
{
"version": "3.0",
"data_sources": [
{
"id": "mysql-main",
"type": "mysql",
"host": "localhost",
"port": 3306,
"user": "elastic_user",
"password": "password",
"database": "elasticrelay",
"server_id": 100,
"table_filters": ["users", "orders", "products"]
}
],
"sinks": [
{
"id": "es-main",
"type": "elasticsearch",
"addresses": ["http://localhost:9200"],
"options": {
"index_prefix": "elasticrelay"
}
}
],
"global": {
"log_level": "info",
"grpc_port": 50051,
"dlq_config": {
"enabled": true,
"storage_path": "dlq",
"max_retries": 3,
"retry_delay": "30s"
}
}
}
ElasticRelay automatically detects and migrates legacy configuration formats, ensuring backward compatibility.
| Variable | Description | Default |
|---|---|---|
CONFIG_PATH | Path to configuration file | /app/config/config.json |
LOG_LEVEL | Logging level (debug, info, warn, error) | info |
GRPC_PORT | gRPC service port | 50051 |
/app/config: Configuration files/app/logs: Application logs/app/dlq: Dead Letter Queue storageThe container includes a built-in health check endpoint:
curl http://localhost:50051/health
linux/amd64linux/arm64# Add to my.cnf
[mysqld]
log-bin=mysql-bin
server-id=1
binlog-format=row
Apache License 2.0 - see LICENSE for details.
Current Status: Active development (MVP ~95% complete). Production-ready for MySQL to Elasticsearch synchronization.
Content type
Image
Digest
sha256:dab3adb04…
Size
23.6 MB
Last updated
10 months ago
docker pull linjifan/elasticrelay