Я пытаюсь подключиться к своему кластеру MariaDB TX 2.0 в Azure, но это не работает.
Я создаю общедоступный балансировщик нагрузки на этапе настройки, и после развертывания я получаю IP-адрес и имя хоста.
пример
mymariadb.westus.cloudapp.azure.com
Строка подключения mysql:
mysql -h mymariadb.westus.cloudapp.azure.com -P 4006 -u myapp -pmypassword mydb
Я получаю эту ошибку:
mysql: [Warning] Using a password on the command line interface can be insecure.
**ERROR 2003 (HY000): Can't connect to MySQL server on 'mymariadb.westus.cloudapp.azure.com' (110)**
Есть идеи, почему я не могу подключиться к кластеру MariaDB?
Я также пытался подключиться к одному из maxscaller и оттуда к одному серверу базы данных -> это работает.
Спасибо!
Обновление:
спасибо за пост.
Прежде всего, я не могу запустить maxadmin:
Unable to connect to MaxScale at /tmp/maxadmin.sock: No such file or directory
Проверяю логи и заметил, что со слушателем проблема
2018-05-15 20:18:03 error : Creation of listener 'Read-Connection-Listener' for service 'Read Connection Router' failed, because both 'socket' and 'port' are defined. Only either one is allowed.
2018-05-15 20:18:03 error : Creation of listener 'Write-Connection-Listener' for service 'Write Connection Router' failed, because both 'socket' and 'port' are defined. Only either one is allowed.
2018-05-15 20:18:03 error : Creation of listener 'RW-Split-Listener' for service 'RW Split Router' failed, because both 'socket' and 'port' are defined. Only either one is allowed.
также найти это:
2018-05-15 20:18:03 warning: Protocol module 'mysqlbackend' has been deprecated, use 'mariadbbackend' instead.
Надеюсь, вы (как эксперт MariaDB) можете помочь мне с этим вопросом!
Спасибо и всего наилучшего!
ОБНОВЛЕНИЕ 2
Это мой файл cnf (я не вносил никаких изменений). Это должно быть правильно и работать, верно?
[CLI]
type=service
router=cli
[RW Split Listener]
type=listener
service=RW Split Router
protocol=MySQLClient
port=4006
socket=/var/lib/maxscale/rwsplit.sock
[Write Connection Listener]
type=listener
service=Write Connection Router
protocol=MySQLClient
port=4007
socket=/var/lib/maxscale/writeconn.sock
[Read Connection Listener]
type=listener
service=Read Connection Router
protocol=MySQLClient
port=4008
socket=/var/lib/maxscale/readconn.sock
[CLI Listener]
type=listener
service=CLI
protocol=maxscaled
socket=/tmp/maxadmin.sock
[MaxInfo]
type=service
router=maxinfo
[MaxInfo JSON Listener]
type=listener
service=MaxInfo
protocol=HTTPD
port=8003
address=localhost
[db1]
type=server
address=172.16.4.4
port=3306
protocol=MySQLBackend
[db2]
type=server
address=172.16.4.5
port=3306
protocol=MySQLBackend
[db3]
type=server
address=172.16.4.6
port=3306
protocol=MySQLBackend
ОБНОВЛЕНИЕ 3:
Я внес изменения, которые вы предложили, и попытался работать командой maxadmin:
2018-05-18 07:12:58 error : Creation of listener 'Read-Connection-Listener' for service 'Read Connection Router' failed, because both 'socket' and 'port' are defined. Only either one is allowed.
2018-05-18 07:12:58 error : Creation of listener 'Write-Connection-Listener' for service 'Write Connection Router' failed, because both 'socket' and 'port' are defined. Only either one is allowed.
2018-05-18 07:12:58 error : Creation of listener 'RW-Split-Listener' for service 'RW Split Router' failed, because both 'socket' and 'port' are defined. Only either one is allowed.
2018-05-18 07:12:58 notice : Monitor 'Galera-Monitor' is missing the 'journal_max_age' parameter, using default value of 28800 seconds.
2018-05-18 07:12:58 notice : Monitor 'Galera-Monitor' is missing the 'script_timeout' parameter, using default value of 90 seconds.
2018-05-18 07:12:58 error : 3 errors were encountered while processing the configuration file '/etc/maxscale.cnf'.
2018-05-18 07:12:58 error : Failed to open, read or process the MaxScale configuration file /etc/maxscale.cnf. Exiting.
2018-05-18 07:12:58 MariaDB MaxScale is shut down.
----------------------------------------------------
me@mdbec-max1:~$ maxadmin
Unable to connect to MaxScale at /tmp/maxadmin.sock: No such file or directory
ОБНОВЛЕНИЕ 4
[maxscale]
threads=4
datadir=/var/lib/maxscale/data/
#[MySQL Monitor]
#type=monitor
#module=mysqlmon
#servers=server1,server2,server3
#user=myuser
#passwd=mypwd
#monitor_interval=10000
#backend_connect_timeout=
#backend_read_timeout=
#backend_write_timeout=
#detect_replication_lag=
#detect_stale_master=
[Galera Monitor]
type=monitor
module=galeramon
servers=db1,db2,db3
user=maxscalemonitor
passwd=I-DELETE-THIS-LINE
monitor_interval=1000
#disable_master_failback=
[qla]
type=filter
module=qlafilter
filebase=/tmp/QueryLog
[fetch]
type=filter
module=regexfilter
match=fetch
replace=select
[hint]
type=filter
module=hintfilter
[Write Connection Router]
type=service
router=readconnroute
servers=db1,db2,db3
user=maxscalemonitor
passwd=I-DELETE-THIS-LINE
router_options=master
localhost_match_wildcard_host=1
version_string=10.2.14-MariaDB Cluster
[Read Connection Router]
type=service
router=readconnroute
servers=db1,db2,db3
user=maxscalemonitor
passwd=I-DELETE-THIS-LINE
router_options=synced
localhost_match_wildcard_host=1
version_string=10.2.14-MariaDB Cluster
[RW Split Router]
type=service
router=readwritesplit
servers=db1,db2,db3
user=maxscalemonitor
passwd=I-DELETE-THIS-LINE
max_slave_connections=100%
localhost_match_wildcard_host=1
version_string=10.2.14-MariaDB Cluster
router_options=disable_sescmd_history=true
#use_sql_variables_in=master
#max_slave_replication_lag=21
#filters=hint|fetch|qla
#router_options=slave_selection_criteria=LEAST_CURRENT_OPERATIONS
[CLI]
type=service
router=cli
[RW Split Listener]
type=listener
service=RW Split Router
protocol=MySQLClient
port=4006
socket=/var/lib/maxscale/rwsplit.sock
[Write Connection Listener]
type=listener
service=Write Connection Router
protocol=MySQLClient
port=4007
socket=/var/lib/maxscale/writeconn.sock
[Read Connection Listener]
type=listener
service=Read Connection Router
protocol=MySQLClient
port=4008
socket=/var/lib/maxscale/readconn.sock
[CLI Listener]
type=listener
service=CLI
protocol=maxscaled
socket=/tmp/maxadmin.sock
[MaxInfo]
type=service
router=maxinfo
[MaxInfo JSON Listener]
type=listener
service=MaxInfo
protocol=HTTPD
port=8003
address=localhost
[CLIUnixListener]
type=listener
service=CLI
protocol=maxscaled
socket=default
[CLIInetListener]
type=listener
service=CLI
protocol=maxscaled
address=localhost
port=6603
[db1]
type=server
address=172.16.4.4
port=3306
protocol=MySQLBackend
[db2]
type=server
address=172.16.4.5
port=3306
protocol=MySQLBackend
[db3]
type=server
address=172.16.4.6
port=3306
protocol=MySQLBackend