You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure中MariaDB TX 2.0集群连接失败排查求助

Troubleshooting MariaDB TX 2.0 Cluster Connection Failures on Azure

Let's break down your issues and fix them step by step—your log messages already point straight to the root causes!

Core Issues Identified

  1. MaxScale Listeners Fail to Start: The error "both 'socket' and 'port' are defined. Only either one is allowed" means your listener configurations are invalid, so MaxScale can't open the TCP ports you're trying to connect to externally.
  2. Deprecated Protocol Module: The mysqlbackend module is outdated, which might cause unexpected behavior even if it works temporarily.
  3. Maxadmin Connection Failure: This is a side effect of MaxScale failing to start properly due to the listener errors—no running MaxScale instance means no /tmp/maxadmin.sock file exists.

Step 1: Fix Listener Configuration Errors

Open your /etc/maxscale.cnf file and locate all listener sections (e.g., Read-Connection-Listener, Write-Connection-Listener, RW-Split-Listener). For each listener:

  • Since you need public network access via the Azure load balancer, remove the socket parameter entirely and keep only the port (and address if you want to bind to a specific IP for security).
  • Example valid listener config:
[Read-Connection-Listener]
type=listener
service=Read Connection Router
protocol=mysqlclient
port=4006
address=0.0.0.0  # Bind to all network interfaces (adjust if needed)

Repeat this fix for all listeners that throw the "socket + port" error.

Step 2: Replace Deprecated Protocol Module

In the same config file, find any service sections using protocol=mysqlbackend (these are typically the services connecting to your MariaDB backend nodes) and replace it with the recommended module:

protocol=mariadbbackend

Step 3: Restart MaxScale and Validate

After updating the config, restart MaxScale to apply changes:

systemctl restart maxscale
  • Check if MaxScale is running successfully:
systemctl status maxscale
  • Now try connecting with maxadmin (the socket file should be created once MaxScale starts properly):
maxadmin -u admin -p  # Omit the password here to enter it securely
  • Finally, test your external connection again (skip putting the password directly in the command line to avoid the insecure warning):
mysql -h mymariadb.westus.cloudapp.azure.com -P 4006 -u myapp -p mydb

Step 4: Verify Azure Network Settings

If you still can't connect externally after fixing MaxScale:

  • Confirm your Azure Load Balancer has an inbound rule forwarding port 4006 to the MaxScale node's port 4006.
  • Check that the MaxScale node's OS firewall (iptables/ufw) allows incoming traffic on port 4006.
  • Ensure the load balancer's public hostname/IP resolves correctly (use nslookup mymariadb.westus.cloudapp.azure.com to test).

内容的提问来源于stack exchange,提问作者sokolata

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 06:33:03