2025-07-10 14:02:10 +08:00
|
|
|
# ===================================================================
|
|
|
|
|
# Doris MCP Server Environment Configuration Example
|
|
|
|
|
# ===================================================================
|
|
|
|
|
# Copy this file to .env and modify the configuration values as needed
|
2025-06-08 18:44:40 +08:00
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# ===================================================================
|
|
|
|
|
# Database Connection Configuration
|
|
|
|
|
# ===================================================================
|
2025-06-12 19:36:16 +08:00
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# Doris FE (Frontend) connection settings
|
2025-06-08 18:44:40 +08:00
|
|
|
DORIS_HOST=localhost
|
|
|
|
|
DORIS_PORT=9030
|
|
|
|
|
DORIS_USER=root
|
2025-06-12 19:36:16 +08:00
|
|
|
DORIS_PASSWORD=
|
|
|
|
|
DORIS_DATABASE=information_schema
|
|
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# Doris FE HTTP API port (for Profile and other HTTP APIs)
|
2025-06-12 19:36:16 +08:00
|
|
|
DORIS_FE_HTTP_PORT=8030
|
|
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# Doris BE (Backend) nodes configuration (optional, for external access)
|
|
|
|
|
# Format: host1,host2,host3 (if empty, will use "show backends" to get BE nodes)
|
2025-06-12 19:36:16 +08:00
|
|
|
DORIS_BE_HOSTS=
|
|
|
|
|
DORIS_BE_WEBSERVER_PORT=8040
|
|
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# Connection pool configuration
|
2025-06-08 18:44:40 +08:00
|
|
|
DORIS_MAX_CONNECTIONS=20
|
|
|
|
|
DORIS_CONNECTION_TIMEOUT=30
|
|
|
|
|
DORIS_HEALTH_CHECK_INTERVAL=60
|
|
|
|
|
DORIS_MAX_CONNECTION_AGE=3600
|
|
|
|
|
|
2025-07-11 12:03:13 +08:00
|
|
|
# Arrow Flight SQL Configuration (Required for ADBC tools)
|
|
|
|
|
# FE_ARROW_FLIGHT_SQL_PORT=
|
|
|
|
|
# BE_ARROW_FLIGHT_SQL_PORT=
|
|
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# ===================================================================
|
2025-06-12 19:36:16 +08:00
|
|
|
# Security Configuration
|
2025-07-10 14:02:10 +08:00
|
|
|
# ===================================================================
|
2025-06-12 19:36:16 +08:00
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# Authentication configuration
|
2025-06-08 18:44:40 +08:00
|
|
|
AUTH_TYPE=token
|
2025-06-12 19:36:16 +08:00
|
|
|
TOKEN_SECRET=your_secret_key_here
|
2025-06-08 18:44:40 +08:00
|
|
|
TOKEN_EXPIRY=3600
|
2025-07-10 14:02:10 +08:00
|
|
|
|
|
|
|
|
# SQL security check
|
|
|
|
|
ENABLE_SECURITY_CHECK=true
|
|
|
|
|
|
|
|
|
|
# Blocked keywords (comma separated)
|
|
|
|
|
BLOCKED_KEYWORDS=DROP,CREATE,ALTER,TRUNCATE,DELETE,INSERT,UPDATE,GRANT,REVOKE,EXEC,EXECUTE,SHUTDOWN,KILL
|
|
|
|
|
|
|
|
|
|
# Query limits
|
2025-06-12 19:36:16 +08:00
|
|
|
MAX_QUERY_COMPLEXITY=100
|
2025-07-10 14:02:10 +08:00
|
|
|
MAX_RESULT_ROWS=10000
|
|
|
|
|
|
|
|
|
|
# Data masking
|
2025-06-08 18:44:40 +08:00
|
|
|
ENABLE_MASKING=true
|
|
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# ===================================================================
|
2025-06-12 19:36:16 +08:00
|
|
|
# Performance Configuration
|
2025-07-10 14:02:10 +08:00
|
|
|
# ===================================================================
|
2025-06-12 19:36:16 +08:00
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# Query cache
|
2025-06-08 18:44:40 +08:00
|
|
|
ENABLE_QUERY_CACHE=true
|
|
|
|
|
CACHE_TTL=300
|
|
|
|
|
MAX_CACHE_SIZE=1000
|
2025-07-10 14:02:10 +08:00
|
|
|
|
|
|
|
|
# Concurrency control
|
2025-06-08 18:44:40 +08:00
|
|
|
MAX_CONCURRENT_QUERIES=50
|
|
|
|
|
QUERY_TIMEOUT=300
|
|
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# Response content size limit (characters)
|
|
|
|
|
MAX_RESPONSE_CONTENT_SIZE=4096
|
|
|
|
|
|
2025-07-11 12:03:13 +08:00
|
|
|
# ===================================================================
|
|
|
|
|
# ADBC (Arrow Flight SQL) Configuration
|
|
|
|
|
# ===================================================================
|
|
|
|
|
# Enable/disable ADBC tools
|
|
|
|
|
ADBC_ENABLED=true
|
|
|
|
|
|
|
|
|
|
# Default ADBC query parameters
|
|
|
|
|
ADBC_DEFAULT_MAX_ROWS=100000
|
|
|
|
|
ADBC_DEFAULT_TIMEOUT=60
|
|
|
|
|
# Format: "arrow", "pandas", "dict"
|
|
|
|
|
ADBC_DEFAULT_RETURN_FORMAT=arrow
|
|
|
|
|
|
|
|
|
|
# ADBC connection timeout
|
|
|
|
|
ADBC_CONNECTION_TIMEOUT=300
|
|
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# ===================================================================
|
2025-06-08 18:44:40 +08:00
|
|
|
# Logging Configuration
|
2025-07-10 14:02:10 +08:00
|
|
|
# ===================================================================
|
2025-06-12 19:36:16 +08:00
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# Basic logging configuration
|
2025-06-08 18:44:40 +08:00
|
|
|
LOG_LEVEL=INFO
|
2025-06-12 19:36:16 +08:00
|
|
|
LOG_FILE_PATH=
|
2025-07-10 14:02:10 +08:00
|
|
|
|
|
|
|
|
# Audit logging
|
2025-06-08 18:44:40 +08:00
|
|
|
ENABLE_AUDIT=true
|
2025-06-12 19:36:16 +08:00
|
|
|
AUDIT_FILE_PATH=
|
|
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# Log file rotation configuration
|
|
|
|
|
LOG_MAX_FILE_SIZE=10485760
|
|
|
|
|
LOG_BACKUP_COUNT=5
|
|
|
|
|
|
|
|
|
|
# ===================================================================
|
|
|
|
|
# Log Cleanup Configuration - NEW!
|
|
|
|
|
# ===================================================================
|
|
|
|
|
|
|
|
|
|
# Enable automatic log cleanup
|
|
|
|
|
ENABLE_LOG_CLEANUP=true
|
|
|
|
|
|
|
|
|
|
# Maximum age of log files in days (files older than this will be deleted)
|
|
|
|
|
LOG_MAX_AGE_DAYS=30
|
|
|
|
|
|
|
|
|
|
# Cleanup check interval in hours
|
|
|
|
|
LOG_CLEANUP_INTERVAL_HOURS=24
|
|
|
|
|
|
|
|
|
|
# ===================================================================
|
2025-06-12 19:36:16 +08:00
|
|
|
# Monitoring Configuration
|
2025-07-10 14:02:10 +08:00
|
|
|
# ===================================================================
|
2025-06-08 18:44:40 +08:00
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# Metrics collection
|
2025-06-08 18:44:40 +08:00
|
|
|
ENABLE_METRICS=true
|
|
|
|
|
METRICS_PORT=3001
|
|
|
|
|
HEALTH_CHECK_PORT=3002
|
2025-07-10 14:02:10 +08:00
|
|
|
|
|
|
|
|
# Alert configuration
|
2025-06-08 18:44:40 +08:00
|
|
|
ENABLE_ALERTS=false
|
|
|
|
|
ALERT_WEBHOOK_URL=
|
|
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# ===================================================================
|
2025-06-12 19:36:16 +08:00
|
|
|
# Server Configuration
|
2025-07-10 14:02:10 +08:00
|
|
|
# ===================================================================
|
2025-06-12 19:36:16 +08:00
|
|
|
|
2025-07-10 14:02:10 +08:00
|
|
|
# Basic server information
|
2025-06-08 18:44:40 +08:00
|
|
|
SERVER_NAME=doris-mcp-server
|
2025-07-11 12:03:13 +08:00
|
|
|
SERVER_VERSION=0.5.0
|
2025-06-08 18:44:40 +08:00
|
|
|
SERVER_PORT=3000
|
2025-07-10 14:02:10 +08:00
|
|
|
|
|
|
|
|
# Temporary files directory
|
|
|
|
|
TEMP_FILES_DIR=tmp
|
|
|
|
|
|
|
|
|
|
# ===================================================================
|
|
|
|
|
# Configuration Examples for Different Environments
|
|
|
|
|
# ===================================================================
|
|
|
|
|
|
|
|
|
|
# Development Environment Example:
|
|
|
|
|
# LOG_LEVEL=DEBUG
|
|
|
|
|
# LOG_MAX_AGE_DAYS=7
|
|
|
|
|
# LOG_CLEANUP_INTERVAL_HOURS=6
|
|
|
|
|
# ENABLE_SECURITY_CHECK=false
|
|
|
|
|
|
|
|
|
|
# Production Environment Example:
|
|
|
|
|
# LOG_LEVEL=INFO
|
|
|
|
|
# LOG_MAX_AGE_DAYS=30
|
|
|
|
|
# LOG_CLEANUP_INTERVAL_HOURS=24
|
|
|
|
|
# ENABLE_SECURITY_CHECK=true
|
|
|
|
|
# ENABLE_LOG_CLEANUP=true
|
|
|
|
|
|
|
|
|
|
# Testing Environment Example:
|
|
|
|
|
# LOG_LEVEL=WARNING
|
|
|
|
|
# LOG_MAX_AGE_DAYS=3
|
|
|
|
|
# LOG_CLEANUP_INTERVAL_HOURS=1
|
|
|
|
|
# MAX_RESULT_ROWS=1000
|
|
|
|
|
|
|
|
|
|
# ===================================================================
|
|
|
|
|
# Advanced Configuration Notes
|
|
|
|
|
# ===================================================================
|
|
|
|
|
|
|
|
|
|
# 1. Log Cleanup Feature:
|
|
|
|
|
# - ENABLE_LOG_CLEANUP: Controls whether to enable automatic cleanup
|
|
|
|
|
# - LOG_MAX_AGE_DAYS: File retention days, recommended 30 days for production, 7 days for development
|
|
|
|
|
# - LOG_CLEANUP_INTERVAL_HOURS: Check frequency, recommended 24 hours
|
|
|
|
|
|
|
|
|
|
# 2. Security Best Practices:
|
|
|
|
|
# - Must change TOKEN_SECRET in production environment
|
|
|
|
|
# - Adjust BLOCKED_KEYWORDS according to business needs
|
|
|
|
|
# - Enable ENABLE_SECURITY_CHECK and ENABLE_MASKING
|
|
|
|
|
|
|
|
|
|
# 3. Performance Tuning:
|
|
|
|
|
# - Adjust MAX_CONCURRENT_QUERIES based on hardware resources
|
|
|
|
|
# - Adjust QUERY_TIMEOUT based on query complexity
|
|
|
|
|
# - Adjust MAX_CACHE_SIZE based on memory size
|
|
|
|
|
|
|
|
|
|
# 4. Connection Pool Optimization:
|
|
|
|
|
# - DORIS_MAX_CONNECTIONS recommended to be 2-4 times the number of CPU cores
|
|
|
|
|
# - DORIS_CONNECTION_TIMEOUT adjust based on network latency
|
2025-07-11 12:03:13 +08:00
|
|
|
# - DORIS_MAX_CONNECTION_AGE recommended 1 hour to avoid long connection issues
|
|
|
|
|
|
|
|
|
|
# 5. ADBC (Arrow Flight SQL) Configuration:
|
|
|
|
|
# - FE_ARROW_FLIGHT_SQL_PORT and BE_ARROW_FLIGHT_SQL_PORT: Required for ADBC functionality
|
|
|
|
|
# - ADBC_DEFAULT_MAX_ROWS: Default maximum rows for ADBC queries (recommended: 100000)
|
|
|
|
|
# - ADBC_DEFAULT_TIMEOUT: Default timeout for ADBC queries in seconds (recommended: 60)
|
|
|
|
|
# - ADBC_DEFAULT_RETURN_FORMAT: Default return format (arrow/pandas/dict, recommended: arrow)
|
|
|
|
|
# - ADBC_CONNECTION_TIMEOUT: Connection timeout for ADBC (recommended: 30)
|
|
|
|
|
# - ADBC_ENABLED: Enable or disable ADBC tools (true/false)
|
|
|
|
|
# - Prerequisites: Install adbc_driver_manager, adbc_driver_flightsql, pyarrow packages
|