Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Incomplete
-
None
-
None
-
maxscale 2.5,mariadb 10.5
Description
maxscale.cnf
root@u1:/etc# cat maxscale.cnf
- MaxScale documentation:
- https://mariadb.com/kb/en/mariadb-maxscale-24/
- Global parameters
# - Complete list of configuration options:
- https://mariadb.com/kb/en/mariadb-maxscale-24-mariadb-maxscale-configuration-guide/
[maxscale]
threads=auto
admin_host=0.0.0.0
admin_secure_gui=false
- Server definitions
# - Set the address of the server to the network
- address of a MariaDB server.
#
[server1]
type=server
address=192.168.8.248
port=3306
protocol=MariaDBBackend
[server2]
type=server
address=192.168.8.32
port=3306
protocol=MariaDBBackend
- Monitor for the servers
# - This will keep MaxScale aware of the state of the servers.
- MariaDB Monitor documentation:
- https://mariadb.com/kb/en/mariadb-maxscale-24-mariadb-monitor/
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=server1,server2
user=monitor_user
password=123456
monitor_interval=2000
- Service definitions
# - Service Definition for a read-only service and
- a read/write splitting service.
#
- ReadConnRoute documentation:
- https://mariadb.com/kb/en/mariadb-maxscale-24-readconnroute/
[Master-Slave-Service]
type=service
router=readwritesplit
servers=server1,server2
user=maxscale
password=123456
#router_options=master,slave
max_connections=1024
- Listener definitions for the services
# - These listeners represent the ports the
- services will listen on.
#
[Master-Slaver-Listener]
type=listener
service=Master-Slave-Service
protocol=MariaDBClient
port=4008
root@u1:/etc#
I run it on ubuntu 20.04 lts, My mariadb master, slave is ok.
but after i run
systemctl restart maxscale
it not works well.
my sql is:
CREATE USER 'maxscale'@'%' IDENTIFIED BY '123456';
GRANT SELECT ON mysql.user TO 'maxscale'@'%';
GRANT SELECT ON mysql.db TO 'maxscale'@'%';
GRANT SELECT ON mysql.tables_priv TO 'maxscale'@'%';
GRANT SELECT ON mysql.columns_priv TO 'maxscale'@'%';
GRANT SELECT ON mysql.proxies_priv TO 'maxscale'@'%';
GRANT SELECT ON mysql.roles_mapping TO 'maxscale'@'%';
GRANT SHOW DATABASES ON . TO 'maxscale'@'%';
flush privileges;
CREATE USER 'max_user'@'%' IDENTIFIED BY '123456';
GRANT SELECT, INSERT, UPDATE, DELETE ON . TO 'max_user'@'%';
flush privileges;
CREATE USER 'monitor_user'@'%' IDENTIFIED BY '123456';
GRANT REPLICATION CLIENT on . to 'monitor_user'@'%';
GRANT SUPER, RELOAD on . to 'monitor_user'@'%';
flush privileges;
the error log is
MariaDB MaxScale /var/log/maxscale/maxscale.log Fri Jan 29 19:12:44 2021
----------------------------------------------------------------------------
2021-01-29 19:12:44 notice : syslog logging is enabled.
2021-01-29 19:12:44 notice : maxlog logging is enabled.
2021-01-29 19:12:44 notice : The collection of SQLite memory allocation statistics turned off.
2021-01-29 19:12:44 notice : Threading mode of SQLite set to Multi-thread.
2021-01-29 19:12:44 notice : The systemd watchdog is Enabled. Internal timeout = 30s
2021-01-29 19:12:44 notice : Worker message queue size: 1MiB
2021-01-29 19:12:44 notice : Using up to 590.3MiB of memory for query classifier cache
2021-01-29 19:12:44 notice : Running OS: Linux@5.4.0-65-generic, #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021, x86_64 with 6 processor cores.
2021-01-29 19:12:44 notice : Total usable main memory: 3.84GiB.
2021-01-29 19:12:44 notice : MariaDB MaxScale 2.5.7 started (Commit: cec605f3894b2098329fea2685edcec38d9764ed)
2021-01-29 19:12:44 notice : MaxScale is running in process 4544
2021-01-29 19:12:44 notice : Configuration file: /etc/maxscale.cnf
2021-01-29 19:12:44 notice : Log directory: /var/log/maxscale
2021-01-29 19:12:44 notice : Data directory: /var/lib/maxscale
2021-01-29 19:12:44 notice : Module directory: /usr/lib/x86_64-linux-gnu/maxscale
2021-01-29 19:12:44 notice : Service cache: /var/cache/maxscale
2021-01-29 19:12:44 notice : Working directory: /var/log/maxscale
2021-01-29 19:12:44 notice : Loaded module qc_sqlite: V1.0.0 from /usr/lib/x86_64-linux-gnu/maxscale/libqc_sqlite.so
2021-01-29 19:12:44 notice : Query classification results are cached and reused. Memory used per thread: 98.38MiB
2021-01-29 19:12:44 notice : Password encryption key file '/var/lib/maxscale/.secrets' not found, using configured passwords as plaintext.
2021-01-29 19:12:44 notice : MaxScale started with 6 worker threads, each with a stack size of 8388608 bytes.
2021-01-29 19:12:44 notice : Loading /etc/maxscale.cnf.
2021-01-29 19:12:44 notice : /etc/maxscale.cnf.d does not exist, not reading.
2021-01-29 19:12:44 notice : Loaded module MariaDBClient: V1.1.0 from /usr/lib/x86_64-linux-gnu/maxscale/libmariadbclient.so
2021-01-29 19:12:44 notice : Loaded module readwritesplit: V1.1.0 from /usr/lib/x86_64-linux-gnu/maxscale/libreadwritesplit.so
2021-01-29 19:12:44 notice : Loaded module mariadbmon: V1.5.0 from /usr/lib/x86_64-linux-gnu/maxscale/libmariadbmon.so
2021-01-29 19:12:44 notice : (Master-Slaver-Listener) Loaded module MariaDBAuth: V2.1.0 from /usr/lib/x86_64-linux-gnu/maxscale/libmariadbauth.so
2021-01-29 19:12:44 notice : Started REST API on [0.0.0.0]:8989
2021-01-29 19:12:47 notice : Starting a total of 1 services...
2021-01-29 19:12:47 notice : (Master-Slaver-Listener) Listening for connections at [::]:4008
2021-01-29 19:12:47 notice : Service 'Master-Slave-Service' started (1/1)
2021-01-29 19:13:03 warning: [mariadbmon] The current master server 'server1' is no longer valid because it has been down over 5 (failcount) monitor updates and it does not have any running slaves, but there is no valid alternative to swap to.
Am I wrong?