mirror of
https://github.com/uprightbass360/AzerothCore-RealmMaster.git
synced 2026-01-13 00:58:34 +00:00
fix db import bugs
This commit is contained in:
@@ -120,6 +120,9 @@ services:
|
|||||||
image: ${AC_DB_IMPORT_IMAGE}
|
image: ${AC_DB_IMPORT_IMAGE}
|
||||||
container_name: ${CONTAINER_DB_IMPORT}
|
container_name: ${CONTAINER_DB_IMPORT}
|
||||||
user: "0:0"
|
user: "0:0"
|
||||||
|
depends_on:
|
||||||
|
ac-mysql:
|
||||||
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- azerothcore
|
- azerothcore
|
||||||
volumes:
|
volumes:
|
||||||
@@ -133,10 +136,6 @@ services:
|
|||||||
AC_CLOSE_IDLE_CONNECTIONS: "false"
|
AC_CLOSE_IDLE_CONNECTIONS: "false"
|
||||||
AC_UPDATES_ENABLE_DATABASES: "7"
|
AC_UPDATES_ENABLE_DATABASES: "7"
|
||||||
AC_UPDATES_AUTO_SETUP: "1"
|
AC_UPDATES_AUTO_SETUP: "1"
|
||||||
AC_LOG_LEVEL: "1"
|
|
||||||
AC_LOGGER_ROOT_CONFIG: "1,Console"
|
|
||||||
AC_LOGGER_SERVER_CONFIG: "1,Console"
|
|
||||||
AC_APPENDER_CONSOLE_CONFIG: "1,2,0"
|
|
||||||
# Use the default AzerothCore dbimport entrypoint
|
# Use the default AzerothCore dbimport entrypoint
|
||||||
restart: "no"
|
restart: "no"
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,11 @@
|
|||||||
|
|
||||||
set -e # Exit on any error
|
set -e # Exit on any error
|
||||||
|
|
||||||
|
# Change to the project root directory (parent of scripts directory)
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||||
|
cd "$PROJECT_ROOT"
|
||||||
|
|
||||||
# Colors for output
|
# Colors for output
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
@@ -246,10 +251,10 @@ nuclear_cleanup() {
|
|||||||
"docker compose --env-file docker-compose-azerothcore-tools-custom.env -f docker-compose-azerothcore-tools.yml down --volumes --remove-orphans 2>/dev/null || docker compose --env-file docker-compose-azerothcore-tools.env -f docker-compose-azerothcore-tools.yml down --volumes --remove-orphans 2>/dev/null || true"
|
"docker compose --env-file docker-compose-azerothcore-tools-custom.env -f docker-compose-azerothcore-tools.yml down --volumes --remove-orphans 2>/dev/null || docker compose --env-file docker-compose-azerothcore-tools.env -f docker-compose-azerothcore-tools.yml down --volumes --remove-orphans 2>/dev/null || true"
|
||||||
|
|
||||||
execute_command "Stop and remove services layer (with volumes)" \
|
execute_command "Stop and remove services layer (with volumes)" \
|
||||||
"docker compose --env-file docker-compose-azerothcore-services-custom.env -f docker-compose-azerothcore-services.yml down --volumes --remove-orphans 2>/dev/null || docker compose --env-file docker-compose-azerothcore-services.env -f docker-compose-azerothcore-services.yml down --volumes --remove-orphans"
|
"docker compose --env-file docker-compose-azerothcore-services-custom.env -f docker-compose-azerothcore-services.yml down --volumes --remove-orphans 2>/dev/null || docker compose --env-file docker-compose-azerothcore-services.env -f docker-compose-azerothcore-services.yml down --volumes --remove-orphans 2>/dev/null || true"
|
||||||
|
|
||||||
execute_command "Stop and remove database layer (with volumes)" \
|
execute_command "Stop and remove database layer (with volumes)" \
|
||||||
"docker compose --env-file docker-compose-azerothcore-database-custom.env -f docker-compose-azerothcore-database.yml down --volumes --remove-orphans 2>/dev/null || docker compose --env-file docker-compose-azerothcore-database.env -f docker-compose-azerothcore-database.yml down --volumes --remove-orphans"
|
"docker compose --env-file docker-compose-azerothcore-database-custom.env -f docker-compose-azerothcore-database.yml down --volumes --remove-orphans 2>/dev/null || docker compose --env-file docker-compose-azerothcore-database.env -f docker-compose-azerothcore-database.yml down --volumes --remove-orphans 2>/dev/null || true"
|
||||||
|
|
||||||
# Remove any remaining containers
|
# Remove any remaining containers
|
||||||
execute_command "Remove any remaining AzerothCore containers" \
|
execute_command "Remove any remaining AzerothCore containers" \
|
||||||
|
|||||||
@@ -21,6 +21,26 @@ WorldDatabaseInfo = "${CONTAINER_MYSQL};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT
|
|||||||
CharacterDatabaseInfo = "${CONTAINER_MYSQL};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT_PASSWORD};${DB_CHARACTERS_NAME}"
|
CharacterDatabaseInfo = "${CONTAINER_MYSQL};${MYSQL_PORT};${MYSQL_USER};${MYSQL_ROOT_PASSWORD};${DB_CHARACTERS_NAME}"
|
||||||
Updates.EnableDatabases = 7
|
Updates.EnableDatabases = 7
|
||||||
Updates.AutoSetup = 1
|
Updates.AutoSetup = 1
|
||||||
|
|
||||||
|
# Required configuration properties
|
||||||
|
MySQLExecutable = ""
|
||||||
|
TempDir = ""
|
||||||
|
SourceDirectory = ""
|
||||||
|
Updates.AllowedModules = "all"
|
||||||
|
LoginDatabase.WorkerThreads = 1
|
||||||
|
LoginDatabase.SynchThreads = 1
|
||||||
|
WorldDatabase.WorkerThreads = 1
|
||||||
|
WorldDatabase.SynchThreads = 1
|
||||||
|
CharacterDatabase.WorkerThreads = 1
|
||||||
|
CharacterDatabase.SynchThreads = 1
|
||||||
|
Updates.Redundancy = 1
|
||||||
|
Updates.AllowRehash = 1
|
||||||
|
Updates.ArchivedRedundancy = 0
|
||||||
|
Updates.CleanDeadRefMaxCount = 3
|
||||||
|
|
||||||
|
# Logging configuration
|
||||||
|
Appender.Console=1,3,6
|
||||||
|
Logger.root=3,Console
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo 'Running database import...'
|
echo 'Running database import...'
|
||||||
|
|||||||
@@ -159,25 +159,42 @@ check_web_service() {
|
|||||||
deploy_stack() {
|
deploy_stack() {
|
||||||
print_status "HEADER" "DEPLOYING AZEROTHCORE STACK"
|
print_status "HEADER" "DEPLOYING AZEROTHCORE STACK"
|
||||||
|
|
||||||
# Check if environment files exist (in parent directory)
|
# Check if custom environment files exist first, then fallback to base files
|
||||||
for env_file in "../docker-compose-azerothcore-database.env" "../docker-compose-azerothcore-services.env" "../docker-compose-azerothcore-tools.env"; do
|
DB_ENV_FILE="../docker-compose-azerothcore-database-custom.env"
|
||||||
|
SERVICES_ENV_FILE="../docker-compose-azerothcore-services-custom.env"
|
||||||
|
TOOLS_ENV_FILE="../docker-compose-azerothcore-tools-custom.env"
|
||||||
|
|
||||||
|
# Fallback to base files if custom files don't exist
|
||||||
|
if [ ! -f "$DB_ENV_FILE" ]; then
|
||||||
|
DB_ENV_FILE="../docker-compose-azerothcore-database.env"
|
||||||
|
fi
|
||||||
|
if [ ! -f "$SERVICES_ENV_FILE" ]; then
|
||||||
|
SERVICES_ENV_FILE="../docker-compose-azerothcore-services.env"
|
||||||
|
fi
|
||||||
|
if [ ! -f "$TOOLS_ENV_FILE" ]; then
|
||||||
|
TOOLS_ENV_FILE="../docker-compose-azerothcore-tools.env"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if environment files exist
|
||||||
|
for env_file in "$DB_ENV_FILE" "$SERVICES_ENV_FILE" "$TOOLS_ENV_FILE"; do
|
||||||
if [ ! -f "$env_file" ]; then
|
if [ ! -f "$env_file" ]; then
|
||||||
print_status "ERROR" "Environment file $env_file not found"
|
print_status "ERROR" "Environment file $env_file not found"
|
||||||
|
print_status "INFO" "Run ./scripts/setup-server.sh first to create environment files"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
print_status "INFO" "Step 1: Deploying database layer..."
|
print_status "INFO" "Step 1: Deploying database layer..."
|
||||||
docker compose --env-file ../docker-compose-azerothcore-database.env -f ../docker-compose-azerothcore-database.yml up -d
|
docker compose --env-file "$DB_ENV_FILE" -f ../docker-compose-azerothcore-database.yml up -d
|
||||||
|
|
||||||
# Wait for database initialization
|
# Wait for database initialization
|
||||||
wait_for_service "MySQL" 24 "docker exec ac-mysql mysql -uroot -pazerothcore123 -e 'SELECT 1' >/dev/null 2>&1"
|
wait_for_service "MySQL" 24 "docker exec ac-mysql mysql -uroot -pazerothcore123 -e 'SELECT 1' >/dev/null 2>&1"
|
||||||
|
|
||||||
# Wait for database import
|
# Wait for database import
|
||||||
wait_for_service "Database Import" 36 "docker logs ac-db-import 2>/dev/null | grep -q 'Database import complete'"
|
wait_for_service "Database Import" 36 "docker inspect ac-db-import --format='{{.State.ExitCode}}' 2>/dev/null | grep -q '^0$' || docker logs ac-db-import 2>/dev/null | grep -q 'Database import complete'"
|
||||||
|
|
||||||
print_status "INFO" "Step 2: Deploying services layer..."
|
print_status "INFO" "Step 2: Deploying services layer..."
|
||||||
docker compose --env-file ../docker-compose-azerothcore-services.env -f ../docker-compose-azerothcore-services.yml up -d
|
docker compose --env-file "$SERVICES_ENV_FILE" -f ../docker-compose-azerothcore-services.yml up -d
|
||||||
|
|
||||||
# Wait for client data extraction
|
# Wait for client data extraction
|
||||||
print_status "INFO" "Waiting for client data download and extraction (this may take 10-20 minutes)..."
|
print_status "INFO" "Waiting for client data download and extraction (this may take 10-20 minutes)..."
|
||||||
@@ -187,7 +204,7 @@ deploy_stack() {
|
|||||||
wait_for_service "World Server" 24 "check_container_health ac-worldserver"
|
wait_for_service "World Server" 24 "check_container_health ac-worldserver"
|
||||||
|
|
||||||
print_status "INFO" "Step 3: Deploying tools layer..."
|
print_status "INFO" "Step 3: Deploying tools layer..."
|
||||||
docker compose --env-file ../docker-compose-azerothcore-tools.env -f ../docker-compose-azerothcore-tools.yml up -d
|
docker compose --env-file "$TOOLS_ENV_FILE" -f ../docker-compose-azerothcore-tools.yml up -d
|
||||||
|
|
||||||
# Wait for tools to be ready
|
# Wait for tools to be ready
|
||||||
sleep 10
|
sleep 10
|
||||||
@@ -268,11 +285,11 @@ perform_health_checks() {
|
|||||||
if [ $total_failures -eq 0 ]; then
|
if [ $total_failures -eq 0 ]; then
|
||||||
print_status "SUCCESS" "All services are healthy and operational!"
|
print_status "SUCCESS" "All services are healthy and operational!"
|
||||||
print_status "INFO" "Available services:"
|
print_status "INFO" "Available services:"
|
||||||
echo " 🌐 PHPMyAdmin: http://localhost:8081"
|
echo " 🌐 PHPMyAdmin: http://localhost:8081"
|
||||||
echo " 🛠️ Keira3: http://localhost:4201"
|
echo " 🛠️ Keira3: http://localhost:4201"
|
||||||
echo " 🎮 Game Server: localhost:8215"
|
echo " 🎮 Game Server: localhost:8215"
|
||||||
echo " 🔐 Auth Server: localhost:3784"
|
echo " 🔐 Auth Server: localhost:3784"
|
||||||
echo " 🔧 SOAP API: localhost:7778"
|
echo " 🔧 SOAP API: localhost:7778"
|
||||||
echo " 🗄️ MySQL: localhost:64306"
|
echo " 🗄️ MySQL: localhost:64306"
|
||||||
echo ""
|
echo ""
|
||||||
print_status "INFO" "Default credentials:"
|
print_status "INFO" "Default credentials:"
|
||||||
|
|||||||
Reference in New Issue
Block a user