V
V
vlarkanov2017-08-09 18:02:45
linux
vlarkanov, 2017-08-09 18:02:45

Maxscale: how to route all requests to one server?

Hello. There is a galera cluster (master-master, 2 nodes + arbitrator). It is necessary to send all requests from the user (both reading and writing) to only one node. If a node is not available, all requests must go to another one. Can this be implemented? I only managed to "write to one node, read from another; if the node fell, then read and write from the remaining node"
Here is my config:

[maxscale]
threads=1
[Splitter Service]
type=service
router=readwritesplit
servers=node1, node2
user=maxscale
passwd=STRONG_PASSWORD
[Splitter Listener]
type=listener
service=Splitter Service
protocol=MySQLClient
port=3306
address=192.168.1.10
socket =/tmp/ClusterMaster
[node1]
type=server
address=192.168.1.20
port=3306
protocol=MySQLBackend
priority=1
[node2]
type=server
address=192.168.1.21
port=3306
protocol=MySQLBackend
priority=2
[Galera Monitor]
use_priority =true
disable_master_failback=true
type=monitor
module=galeramon
servers=node1, node2
user=maxscale
passwd=STRONG_PASSWORD
[CLI]
type=service
router=cli
[CLI Listener]
type=listener
service=CLI
protocol=maxscaled
port=6603

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kolu4iy, 2017-11-23
@vlarkanov

Why did you use read-write splitter? There are other routers there, for example https://mariadb.com/kb/en/mariadb-enterprise/maria...
Use it with sending to master.

V
Vladimir Zhurkin, 2017-08-09
@icCE

If a node is not available, all requests must go to another one. Can this be implemented?

This begs the question, why then do you need a master-master ? anyway.
As an option, raise the HaProxy balancer and make a rule for it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question