initial working
This commit is contained in:
33
vm1/deploy-ha.sh
Executable file
33
vm1/deploy-ha.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
NODE_NAME=$(hostname)
|
||||
echo "🚀 Deploying on $NODE_NAME..."
|
||||
|
||||
if [ ! -f .env ]; then
|
||||
echo "⚠ .env not found, copying from .env.example"
|
||||
cp .env.example .env
|
||||
fi
|
||||
|
||||
source .env
|
||||
|
||||
echo "✓ Building images..."
|
||||
docker compose build
|
||||
|
||||
echo "✓ Starting services..."
|
||||
docker compose up -d
|
||||
|
||||
sleep 10
|
||||
|
||||
echo "✓ Checking VIP..."
|
||||
if ip addr show | grep -q "${VIP}"; then
|
||||
echo "✓ This node has the VIP (MASTER)"
|
||||
else
|
||||
echo "ℹ This node does not have the VIP (BACKUP)"
|
||||
fi
|
||||
|
||||
echo "✓ Services status:"
|
||||
docker compose ps
|
||||
|
||||
echo ""
|
||||
echo "✅ Deployment completed!"
|
||||
Reference in New Issue
Block a user