Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:23:14 +08:00
commit 6f6c079f71
11 changed files with 545 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
# Example Load Balancer Configuration File
# This file provides a template for configuring the load balancer settings
# to be used with the load-balancer-tester plugin.
# --- General Configuration ---
# Name of the load balancer (used for identification)
load_balancer_name = "my-load-balancer"
# Load balancing strategy:
# Options: round-robin, weighted-round-robin, least-connections, ip-hash
load_balancing_strategy = "round-robin"
# --- Backend Server Configuration ---
# List of backend servers with their respective weights (if applicable)
# Format: "server_address:port:weight"
# Example: "192.168.1.10:8080:10", "192.168.1.11:8080:20", "192.168.1.12:8080" (default weight is 1)
backend_servers = [
"server1.example.com:80:1",
"server2.example.com:80:1",
"server3.example.com:80:1"
]
# --- Health Check Configuration ---
# Health check endpoint for backend servers
health_check_endpoint = "/health"
# Health check interval (in seconds)
health_check_interval = 5
# Health check timeout (in seconds)
health_check_timeout = 2
# Number of consecutive successful health checks required to mark a server as healthy
healthy_threshold = 3
# Number of consecutive failed health checks required to mark a server as unhealthy
unhealthy_threshold = 3
# --- Session Persistence (Sticky Sessions) Configuration ---
# Enable or disable sticky sessions
sticky_sessions_enabled = false
# Cookie name for session persistence (if sticky sessions are enabled)
sticky_session_cookie_name = "LB_SESSION"
# --- Failover Configuration ---
# Time to wait before considering a server as failed (in seconds)
failover_timeout = 10
# --- Traffic Distribution Validation ---
# Number of requests to send for traffic distribution validation
number_of_requests = 1000
# --- Advanced Configuration (Optional) ---
# Custom headers to be added to the requests
# Format: "header_name:header_value"
# Example: "X-Custom-Header:MyValue"
custom_headers = [
# "X-Request-ID: $RANDOM_UUID" # Example - replace with your desired logic
]
# Request method to use for testing (GET, POST, PUT, DELETE, etc.)
request_method = "GET"
# URL path to request. Defaults to "/" if not provided.
request_path = "/"
# --- Notes ---
# - Replace the placeholder values with your actual load balancer configuration.
# - Ensure that the backend servers are accessible from the machine running the plugin.
# - Adjust the health check parameters based on your application's health check requirements.
# - For weighted round-robin, ensure that the weights are integers.
# - Remember to save this file with a `.conf` extension (e.g., `my_load_balancer.conf`).
# - The plugin will read this file to configure the load balancer testing.