|
Topology:
maxscale
1 master
1 slave
Function:
DELIMITER $$
CREATE FUNCTION rdba_test() RETURNS int(11)
BEGIN
DECLARE sID INT;
SELECT @@server_id INTO sID ;
RETURN sID;
END$$
DELIMITER ;
sending the query:
SELECT rdba_test() AS crmid, trim(LEADING 0 FROM @@server_id);
is going to send on the slave. with a presence of a function that make WRITE as it happen on the customer, it write on the slave and break consistency and replication .
Configuration of maxscale:
[maxscale]
auth_connect_timeout=3
auth_read_timeout=1
auth_write_timeout=2
admin_auth=true
passive=0
admin_log_auth_failures=true
query_classifier_cache_size=591866265
writeq_high_water=0
writeq_low_water=0
ms_timestamp=false
skip_permission_checks=false
query_retries=1
query_retry_timeout=5
retain_last_statements=0
dump_last_statements=never
max_auth_errors_until_block=10
session_trace=0
[cluster-monitor]
type=monitor
module=mariadbmon
user=maxmon
password=maxmon
servers=node02,node01
monitor_interval=1000
backend_connect_timeout=3
backend_read_timeout=1
backend_write_timeout=2
backend_connect_attempts=1
journal_max_age=10
disk_space_check_interval=0
script_timeout=90
events=all
detect_stale_master=true
detect_stale_slave=true
detect_standalone_master=true
failcount=3
ignore_external_masters=false
auto_failover=true
failover_timeout=90
switchover_timeout=90
replication_user=repl
replication_password=repl
replication_master_ssl=false
verify_master_failure=true
master_failure_timeout=10
auto_rejoin=true
enforce_read_only_slaves=true
switchover_on_low_disk_space=false
maintenance_on_low_disk_space=true
handle_events=true
assume_unique_hostnames=true
enforce_simple_topology=false
[rwsplit-service]
type=service
router=readwritesplit
user=maxusr
password=maxusr
servers=node02,node01
transaction_replay=true
transaction_replay_max_size=2M
master_failure_mode=fail_on_write
master_reconnection=true
max_sescmd_history=1000
prune_sescmd_history=true
use_sql_variables_in=master
[rwsplit-listener]
type=listener
protocol=mariadbclient
service=rwsplit-service
address=0.0.0.0
port=3306
authenticator=MySQLAuth
[node01]
type=server
port=3306
extra_port=0
persistpoolmax=0
persistmaxtime=0
proxy_protocol=false
ssl=false
ssl_version=MAX
ssl_cert_verify_depth=9
ssl_verify_peer_certificate=true
protocol=mariadbbackend
address=192.168.54.10
[node02]
type=server
port=3306
extra_port=0
persistpoolmax=0
persistmaxtime=0
proxy_protocol=false
ssl=false
ssl_version=MAX
ssl_cert_verify_depth=9
ssl_verify_peer_certificate=true
protocol=mariadbbackend
address=192.168.54.11
MariaDB Enterprise Version 10.4.17-10-MariaDB-enterprise-log , OS:
CentOS Linux release 7.3.1611 (Core)
Derived from Red Hat Enterprise Linux 7.3 (Source)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
CentOS Linux release 7.3.1611 (Core)
CentOS Linux release 7.3.1611 (Core)
cpe:/o:centos:centos:7
|