mirror of https://github.com/sysown/proxysql
Merge pull request #5579 from sysown/infra-mysql57-binlog
CI: Fix `infra-mysql57-binlog` setuppull/5590/head
commit
21b3e238ee
@ -1 +0,0 @@
|
||||
/home/rene/proxysql/test/deps/mysql-connector-c-8.4.0/mysql-8.4.0/runtime_output_directory/mysqlbinlog
|
||||
@ -1,25 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
[ -f .env ] && . .env
|
||||
|
||||
# Ensure INFRA is set correctly
|
||||
if [ -z "${INFRA}" ] || [ "${INFRA}" == "." ]; then
|
||||
export INFRA=$(basename $(cd $(dirname $0)/.. && pwd))
|
||||
fi
|
||||
|
||||
#export ORCHESTRATOR_API="http://localhost:${ORC1_PORT}/api http://localhost:${ORC2_PORT}/api http://localhost:${ORC3_PORT}/api"
|
||||
export ORCHESTRATOR_API="http://orc1.${INFRA}:3000/api http://orc2.${INFRA}:3000/api http://orc3.${INFRA}:3000/api"
|
||||
PROXY_CONTAINER="proxysql.${INFRA_ID}"
|
||||
|
||||
echo -n "Configuring 'orchestrator' ..."
|
||||
sleep 5
|
||||
orchestrator-client -c discover -i mysql1 >/dev/null
|
||||
orchestrator-client -c discover -i mysql2 >/dev/null
|
||||
orchestrator-client -c discover -i mysql3 >/dev/null
|
||||
echo " done."
|
||||
echo ">>> Configuring Orchestrator via ${PROXY_CONTAINER} (Infra: ${INFRA})"
|
||||
|
||||
#echo -n "Orchestrator discovering mysql1 ... got "
|
||||
#orchestrator-client -c discover -i mysql1
|
||||
#echo -n "Orchestrator discovering mysql2 ... got "
|
||||
#orchestrator-client -c discover -i mysql2
|
||||
#echo -n "Orchestrator discovering mysql3 ... got "
|
||||
#orchestrator-client -c discover -i mysql3
|
||||
orc_exec() {
|
||||
docker exec -e ORCHESTRATOR_API="http://orc1.${INFRA}:3000/api" "${PROXY_CONTAINER}" orchestrator-client "$@"
|
||||
}
|
||||
|
||||
echo "Cluster topology:"
|
||||
orchestrator-client -c topology -a $(orchestrator-client -c clusters)
|
||||
echo -n "Waiting for Orchestrator API..."
|
||||
MAX_WAIT=60
|
||||
COUNT=0
|
||||
while ! orc_exec -c clusters >/dev/null 2>&1; do
|
||||
echo -n "."
|
||||
sleep 2
|
||||
COUNT=$((COUNT+2))
|
||||
if [ $COUNT -gt $MAX_WAIT ]; then echo " FAILED"; exit 1; fi
|
||||
done
|
||||
echo " OK."
|
||||
|
||||
#echo -n "Cluster name: $(orchestrator-client -c clusters)"
|
||||
#echo " done."
|
||||
# Use -c discover and -i host:port
|
||||
echo ">>> Triggering discovery of MySQL nodes..."
|
||||
for i in 1 2 3; do
|
||||
HOST="mysql${i}.${INFRA}"
|
||||
orc_exec -c discover -i "${HOST}:3306" >/dev/null 2>&1 || true
|
||||
done
|
||||
|
||||
echo ">>> Waiting for topology to settle..."
|
||||
MAX_WAIT=30
|
||||
COUNT=0
|
||||
CLUSTER_NAME=""
|
||||
while [ -z "$CLUSTER_NAME" ]; do
|
||||
# Try to find which cluster our primary belongs to
|
||||
CLUSTER_NAME=$(orc_exec -c which-cluster -i "mysql1.${INFRA}:3306" 2>/dev/null | head -n 1)
|
||||
|
||||
# Fallback: Just take any cluster name if which-cluster fails but clusters is not empty
|
||||
if [ -z "$CLUSTER_NAME" ]; then
|
||||
CLUSTER_NAME=$(orc_exec -c clusters 2>/dev/null | head -n 1)
|
||||
fi
|
||||
|
||||
if [ -n "$CLUSTER_NAME" ]; then break; fi
|
||||
echo -n "."
|
||||
sleep 2
|
||||
COUNT=$((COUNT+2))
|
||||
if [ $COUNT -gt $MAX_WAIT ]; then
|
||||
echo " WARNING: Still waiting for cluster discovery after ${MAX_WAIT}s"
|
||||
break
|
||||
fi
|
||||
done
|
||||
echo " OK."
|
||||
|
||||
if [ -n "$CLUSTER_NAME" ]; then
|
||||
echo ">>> Verifying Replication Topology for Cluster: ${CLUSTER_NAME}"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
# We use -c topology -i to get the text diagram
|
||||
TOPOLOGY=$(orc_exec -c topology -i "${CLUSTER_NAME}")
|
||||
echo "$TOPOLOGY"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
|
||||
# Check for replication issues (look for anything not [ok])
|
||||
# Note: Orchestrator topology output uses [ok] for healthy nodes
|
||||
ISSUES=$(echo "$TOPOLOGY" | grep -E "\[.*\]" | grep -v "\[ok\]" || true)
|
||||
if [ -n "$ISSUES" ]; then
|
||||
echo "WARNING: Potential replication issues detected in topology!"
|
||||
echo "$ISSUES"
|
||||
else
|
||||
echo "SUCCESS: Replication topology is healthy."
|
||||
fi
|
||||
else
|
||||
echo "ERROR: Orchestrator failed to discover any cluster."
|
||||
exit 1
|
||||
fi
|
||||
@ -1,55 +0,0 @@
|
||||
datadir = "/data/rene/proxysql2/proxysql/test/tap/tests/test_cluster_sync_config/test_cluster_sync_nomonitor";
|
||||
admin_variables :
|
||||
{
|
||||
admin_credentials = "admin:admin;radmin:radmin";
|
||||
mysql_ifaces = "0.0.0.0:96061";
|
||||
cluster_username = "radmin";
|
||||
cluster_password = "radmin";
|
||||
cluster_check_interval_ms = 200;
|
||||
cluster_check_status_frequency = 100;
|
||||
cluster_mysql_query_rules_save_to_disk = true;
|
||||
cluster_mysql_servers_save_to_disk = true;
|
||||
cluster_mysql_users_save_to_disk = true;
|
||||
cluster_proxysql_servers_save_to_disk = true;
|
||||
cluster_mysql_query_rules_diffs_before_sync = 3;
|
||||
cluster_mysql_servers_diffs_before_sync = 3;
|
||||
cluster_mysql_users_diffs_before_sync = 3;
|
||||
cluster_admin_variables_diffs_before_sync = 3;
|
||||
cluster_proxysql_servers_diffs_before_sync = 3;
|
||||
cluster_mysql_servers_sync_algorithm = 3;
|
||||
cluster_sync_interfaces = false;
|
||||
};
|
||||
mysql_variables :
|
||||
{
|
||||
threads = 8;
|
||||
max_connections = 2048;
|
||||
default_query_delay = 0;
|
||||
default_query_timeout = 36000000;
|
||||
have_compress = true;
|
||||
poll_timeout = 2000;
|
||||
interfaces = "0.0.0.0:6033";
|
||||
default_schema = "information_schema";
|
||||
stacksize = 1048576;
|
||||
server_version = "5.5.30";
|
||||
connect_timeout_server = 3000;
|
||||
monitor_username = "monitor";
|
||||
monitor_password = "monitor";
|
||||
monitor_history = 600000;
|
||||
monitor_connect_interval = 10000;
|
||||
monitor_connect_timeout = 1000;
|
||||
monitor_ping_interval = 10000;
|
||||
monitor_read_only_interval = 1500;
|
||||
monitor_read_only_timeout = 500;
|
||||
ping_interval_server_msec = 120000;
|
||||
ping_timeout_server = 500;
|
||||
commands_stats = true;
|
||||
sessions_sort = true;
|
||||
connect_retries_on_failure = 10;
|
||||
};
|
||||
proxysql_servers = (
|
||||
{
|
||||
hostname = "proxysql";
|
||||
port = 6032;
|
||||
weight = 0;
|
||||
comment = "proxysql130";
|
||||
} );
|
||||
@ -1,55 +0,0 @@
|
||||
datadir = "/data/rene/proxysql2/proxysql/test/tap/tests/test_cluster_sync_config/test_cluster_sync_withmonitor";
|
||||
admin_variables :
|
||||
{
|
||||
admin_credentials = "admin:admin;radmin:radmin";
|
||||
mysql_ifaces = "0.0.0.0:96062";
|
||||
cluster_username = "radmin";
|
||||
cluster_password = "radmin";
|
||||
cluster_check_interval_ms = 200;
|
||||
cluster_check_status_frequency = 100;
|
||||
cluster_mysql_query_rules_save_to_disk = true;
|
||||
cluster_mysql_servers_save_to_disk = true;
|
||||
cluster_mysql_users_save_to_disk = true;
|
||||
cluster_proxysql_servers_save_to_disk = true;
|
||||
cluster_mysql_query_rules_diffs_before_sync = 3;
|
||||
cluster_mysql_servers_diffs_before_sync = 3;
|
||||
cluster_mysql_users_diffs_before_sync = 3;
|
||||
cluster_admin_variables_diffs_before_sync = 3;
|
||||
cluster_proxysql_servers_diffs_before_sync = 3;
|
||||
cluster_mysql_servers_sync_algorithm = 3;
|
||||
cluster_sync_interfaces = false;
|
||||
};
|
||||
mysql_variables :
|
||||
{
|
||||
threads = 8;
|
||||
max_connections = 2048;
|
||||
default_query_delay = 0;
|
||||
default_query_timeout = 36000000;
|
||||
have_compress = true;
|
||||
poll_timeout = 2000;
|
||||
interfaces = "0.0.0.0:6033";
|
||||
default_schema = "information_schema";
|
||||
stacksize = 1048576;
|
||||
server_version = "5.5.30";
|
||||
connect_timeout_server = 3000;
|
||||
monitor_username = "monitor";
|
||||
monitor_password = "monitor";
|
||||
monitor_history = 600000;
|
||||
monitor_connect_interval = 10000;
|
||||
monitor_connect_timeout = 1000;
|
||||
monitor_ping_interval = 10000;
|
||||
monitor_read_only_interval = 1500;
|
||||
monitor_read_only_timeout = 500;
|
||||
ping_interval_server_msec = 120000;
|
||||
ping_timeout_server = 500;
|
||||
commands_stats = true;
|
||||
sessions_sort = true;
|
||||
connect_retries_on_failure = 10;
|
||||
};
|
||||
proxysql_servers = (
|
||||
{
|
||||
hostname = "proxysql";
|
||||
port = 6032;
|
||||
weight = 0;
|
||||
comment = "proxysql130";
|
||||
} );
|
||||
Loading…
Reference in new issue