Files
proxmox/scripts/archive/consolidated/fix/fix-r630-02-issues.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

125 lines
5.3 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
set -euo pipefail
# Load IP configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
# Fix Issues on r630-02
# Addresses: Memory OOM kills, Storage usage, Load monitoring
set -e
HOST="r630-02"
HOST_IP="${PROXMOX_HOST_R630_02}"
echo "🔧 Fixing Issues on r630-02"
echo ""
# Check connectivity
if ! ping -c 1 -W 2 $HOST_IP >/dev/null 2>&1; then
echo "❌ Host $HOST_IP is not reachable"
exit 1
fi
echo "✅ Host is reachable"
echo ""
# Check if running as root or with sudo
if [ "$EUID" -ne 0 ]; then
echo "⚠️ This script requires root access for some operations"
echo " Some fixes will be done via SSH to r630-02"
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "1⃣ ANALYZING CONTAINER MEMORY LIMITS"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
CONTAINERS=(5000 6200 6201 7811)
CONTAINER_NAMES=("blockscout-1" "firefly-1" "firefly-ali-1" "mim-api-1")
for i in "${!CONTAINERS[@]}"; do
CTID=${CONTAINERS[$i]}
NAME=${CONTAINER_NAMES[$i]}
echo "📋 Container $CTID ($NAME):"
# Get current memory limit
MEMORY=$(ssh root@$HOST_IP "pct config $CTID 2>/dev/null | grep '^memory:' | cut -d: -f2 | xargs" || echo "")
if [ -z "$MEMORY" ]; then
echo " ⚠️ Memory limit not set (unlimited)"
echo " 💡 Recommendation: Set appropriate memory limit"
else
echo " Current Memory: $MEMORY"
# Check if memory is too low (less than 2GB)
MEMORY_MB=$(echo $MEMORY | sed 's/[^0-9]//g')
if [ -n "$MEMORY_MB" ] && [ "$MEMORY_MB" -lt 2048 ]; then
echo " ⚠️ Memory limit may be too low (< 2GB)"
echo " 💡 Recommendation: Increase to at least 4GB"
fi
fi
# Get container status
STATUS=$(ssh root@$HOST_IP "pct status $CTID 2>/dev/null | awk '{print \$2}'" || echo "unknown")
echo " Status: $STATUS"
echo ""
done
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "2⃣ STORAGE ANALYSIS"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "📊 Storage Pool Usage:"
ssh root@$HOST_IP "pvesm status | grep -E 'thin1-r630-02|thin2' | awk '{printf \" %-20s %8s %8s %8s %6s\n\", \$1, \$4, \$5, \$6, \$7}'"
echo ""
echo "💡 Recommendations:"
echo " • thin1-r630-02: 88.51% full - Consider cleanup"
echo " • thin2: 88.33% full - Consider cleanup"
echo " • Review and remove unused volumes/snapshots"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "3⃣ RECOMMENDED FIXES"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "📋 Fix 1: Increase Container Memory Limits"
echo " Containers experiencing OOM kills need more memory"
echo ""
echo " Example commands (run on r630-02):"
echo " ssh root@$HOST_IP 'pct set 5000 -memory 4096' # blockscout-1"
echo " ssh root@$HOST_IP 'pct set 6200 -memory 4096' # firefly-1"
echo " ssh root@$HOST_IP 'pct set 7811 -memory 4096' # mim-api-1"
echo ""
echo "📋 Fix 2: Storage Cleanup"
echo " Review and clean up thin pools"
echo ""
echo " Commands:"
echo " ssh root@$HOST_IP 'lvs -o lv_name,vg_name,data_percent | grep thin'"
echo " ssh root@$HOST_IP 'pvesm status'"
echo ""
echo "📋 Fix 3: Monitor Load Average"
echo " Load average of 12 on 56 threads is moderate"
echo " Monitor trends - may be normal for workload"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ Analysis Complete"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "💡 Next Steps:"
echo " 1. Review container memory requirements"
echo " 2. Increase memory limits for containers experiencing OOM"
echo " 3. Clean up storage pools if possible"
echo " 4. Monitor load average trends"
echo ""