4.4 KiB
Minecraft Cluster Deployment with Velocity Proxy and Holesail Integration
This master README consolidates all parts of the Minecraft Cluster setup using Docker. It includes deploying a Minecraft server cluster, configuring Velocity Proxy, and integrating Holesail for secure peer-to-peer connections.
Overview
This project enables seamless deployment of a Minecraft server cluster with the following features:
- Clustered Minecraft Servers: Deployed using Docker Compose with FabricMC mod support.
- Velocity Proxy: Lightweight and flexible proxy for managing player connections.
- Holesail Networking: Secure peer-to-peer networking for connecting servers.
- Mod Management: Integrated mod management system for Minecraft servers.
- PM2 Orchestration: Manages processes and ensures stability.
Prerequisites
- Docker: Version 20.10 or higher.
- Docker Compose: Version 1.29 or higher.
- Node.js: Version 18 or higher (for FabricMC version scripts and Holesail).
- Basic Knowledge: Understanding of Docker, Minecraft server administration, and basic Linux commands.
Setup Instructions
1. Minecraft Host Node Setup
This step sets up the Minecraft cluster, consisting of multiple FabricMC servers.
-
Clone the Repository:
git clone https://git.ssh.surf/snxraven/mc-cluster.git cd mc-cluster/mc-cluster-image
-
Build the Minecraft Cluster Image:
docker build . -t mc:cluster
-
Navigate Back to the Main Directory:
cd ..
-
Start the Minecraft Cluster:
docker-compose up -d
This will deploy a cluster of 4 Minecraft servers with unique Holesail connection strings.
2. JUMP Node Setup
The JUMP node hosts the Velocity proxy, managing player connections and routing traffic to the Minecraft cluster.
-
Clone the Repository:
git clone https://git.ssh.surf/snxraven/mc-cluster.git cd mc-cluster/velocity-image
-
Build the Velocity Proxy Image:
docker build . -t velocity:proxy
-
Start the Velocity Proxy:
docker-compose up -d
Configuration
Holesail Connection Strings
To customize the Holesail connection strings:
-
Edit the
pm2-setup.sh
File:cd mc-cluster/holesail-connector nano pm2-setup.sh
Update the
connections
array with your desired connection strings and ports.Example:
connections=( ["mc-server-1"]="5000" ["mc-server-2"]="5001" )
-
Modify the Docker Compose File:
cd mc-cluster nano docker-compose.yml
Update the
CONNECTION_STRING
andPORT
environment variables for each Minecraft server.
Managing the Cluster
Logs and Debugging
-
View PM2 Logs for Minecraft Servers:
docker exec -it mc-server-1 pm2 logs
-
View Velocity Proxy Logs:
docker exec -it velocity-proxy pm2 logs
Add or Remove Minecraft Servers
- Edit the
docker-compose.yml
file in the root directory to add or remove server configurations. - Restart the cluster:
docker-compose down docker-compose up -d
Notes
- Ports and Connection Strings: Ensure no conflicts with other services when configuring ports.
- Security: Update
forwarding.secret
in the Velocity Proxy setup for secure player forwarding. - Default Passwords: Change the default root password (
noshallpass
) for better security.
Directory Structure Overview
mc-cluster/
├── mc-cluster-image/
│ ├── Dockerfile
│ ├── pm2/
│ ├── scripts/
│ ├── server.properties
│ ├── get_latest_fabric_version.js
│ ├── mod-manager-installer.sh
│ └── start.sh
├── velocity-image/
│ ├── Dockerfile
│ ├── velocity.toml
│ ├── pm2/startServer.json
│ ├── start.sh
│ └── forwarding.secret
├── holesail-connector/
│ ├── Dockerfile
│ └── pm2-setup.sh
└── docker-compose.yml
Future Extensions
- Additional Nodes: Add more Minecraft servers or JUMP nodes to scale the deployment.
- Mod Automation: Enhance the mod manager for auto-updating and downloading new mods.
- Monitoring Tools: Integrate monitoring tools like Netdata for better visibility into server performance.