Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Manage MaxScale programmatically using the REST API. This interface allows for the dynamic administration and monitoring of resources like servers, services, listeners, and filters.
Monitors are essential for high availability. They track backend server status, detect failures, promote replicas, and perform automatic failovers, ensuring service continuity.
SET autocommit=0;
XA START 'MyXA';
INSERT INTO test.t1 VALUES(1);
XA END 'MyXA';
XA PREPARE 'MyXA';
XA COMMIT 'MyXA';
SET autocommit=1;set autocommit=1
PREPARE hide_autocommit FROM "set autocommit=0"
EXECUTE hide_autocommit$ sudo groupadd maxscale
$ sudo useradd -g maxscale maxscale
$ cd /usr/local
$ sudo tar -xzvf maxscale-x.y.z.OS.tar.gz
$ sudo ln -s maxscale-x.y.z.OS maxscale
$ cd maxscale
$ sudo chown -R maxscale var$ sudo mkdir /var/log/maxscale
$ sudo mkdir /var/lib/maxscale
$ sudo mkdir /var/run/maxscale
$ sudo mkdir /var/cache/maxscale$ sudo chown maxscale /var/log/maxscale
$ sudo chown maxscale /var/lib/maxscale
$ sudo chown maxscale /var/run/maxscale
$ sudo chown maxscale /var/cache/maxscale$ sudo bin/maxscale --user=maxscale -d$ sudo bin/maxscale --user=maxscale --basedir=/usr/local/maxscale -d$ tar -xzvf maxscale-x.y.z.OS.tar.gz$ cd maxscale-x.y.z.OS
$ bin/maxscale -d --basedir=.$ bin/maxscale --help[Read-Write-Listener]
type=listener
address=::
service=Read-Write-Service
authenticator=PAMAuth
[Master-Server]
type=server
address=123.456.789.10
port=12345auth required pam_unix.so
account required pam_unix.sopam_use_cleartext_pluginauthenticator_options=pam_use_cleartext_plugin=1pam_modeauthenticator_options=pam_mode=password_2FApam_backend_mappingauthenticator_options=pam_backend_mapping=mariadbpam_mapped_pw_fileauthenticator_options=pam_mapped_pw_file=/home/root/passwords.json,pam_backend_mapping=mariadb{
"users_and_passwords": [
{
"user": "my_mapped_user1",
"password": "my_mapped_pw1"
},
{
"user": "my_mapped_user2",
"password": "A6D4C53619FFFF4DF252A0E595EDB0A12CA44E16AF154D0ED08F687E81604BFF42218B4EBA9F3EF8D907CF35E74ABDAA"
}
]
}[DatabaseFirewall]
type=filter
module=dbfwfilter
rules=/home/user/rules.txt
[Firewalled-Routing-Service]
type=service
router=readconnroute
servers=server1
user=myuser
password=mypasswd
filters=DatabaseFirewall[my-firewall-service]
type=service
servers=server1
router=readconnroute
user=maxuser
password=maxpwd
filters=dbfw-whitelist|dbfw-blacklist
[dbfw-whitelist]
type=filter
module=dbfwfilter
action=allow
rules=/home/user/whitelist-rules.txt
[dbfw-blacklist]
type=filter
module=dbfwfilter
action=block
rules=/home/user/blacklist-rules.txttreat_string_as_field=falsetreat_string_arg_as_field=falserule NAME match RULE [at_times VALUE...] [on_queries {select|update|insert|delete|grant|revoke|drop|create|alter|use|load}]rule examplerule match wildcardrule examplerule match columns name salaryrule examplerule match function sum countrule examplerule match not_function lengthrule examplerule match not_functionrule examplerule match uses_function name addressrule examplerule match function sum columns name addressrule examplerule match not_function length columns name addressrule examplerule match not_function columns ssnrule examplerule match regex '.*select.*from.*accounts.*'rule examplerule match limit_queries 50 5 100rule examplerule match no_where_clauserules/reload FILTER [FILE]rules FILTERrule limit_rate_of_queries match limit_queries 10 5 60
rule query_regex match regex '.*select.*from.*user_data.*'users %@% match all rules limit_rate_of_queries query_regexrule safe_delete match no_where_clause on_queries delete
rule managers_table match regex '.*from.*managers.*'users %@% match all rules safe_delete managers_tablePOST /v1/sql/query?token=eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhZG1pbiIsImV4cCI6MTU4MzI1NDE1MSwiaWF0IjoxNTgzMjI1MzUxLCJpc3MiOiJtYXhzY2FsZSJ9.B1BqhjjKaCWKe3gVXLszpOPfeu8cLiwSb4CMIJAoyqwGET /v1/sql/:id{
"data": {
"id": "5",
"links": {
"related": "http://localhost:8989/v1/sql/5/queries/",
"self": "http://localhost:8989/v1/sql/5/"
},
"type": "sql"
},
"links": {
"self": "http://localhost:8989/v1/sql/5/"
},
"meta": {
"token": "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI1IiwiZXhwIjoxNjIwMjM1Mzc3LCJpYXQiOjE2MjAyMDY1NzcsImlzcyI6Im14cy1xdWVyeSJ9.2CJ8DsEPbGlvs2DrBUC6FJA64VMSU8kbX1U4FSu2-OY"
}
}GET /v1/sql{
"data": [
{
"id": "10",
"links": {
"related": "http://localhost:8989/v1/sql/10/queries/",
"self": "http://localhost:8989/v1/sql/10/"
},
"type": "sql"
},
{
"id": "11",
"links": {
"related": "http://localhost:8989/v1/sql/11/queries/",
"self": "http://localhost:8989/v1/sql/11/"
},
"type": "sql"
}
],
"links": {
"self": "http://localhost:8989/v1/sql/"
}
}POST /v1/sql{
"user": "jdoe",
"password": "my-s3cret",
"target": "server1",
"db": "test",
"timeout": 15
}{
"data": {
"id": "5",
"links": {
// The "related" endpoint is the URL to the query endpoint for this connection.
"related": "http://localhost:8989/v1/sql/5/queries/",
"self": "http://localhost:8989/v1/sql/5/"
},
"type": "sql"
},
"links": {
"self": "http://localhost:8989/v1/sql/5/"
},
"meta": {
"token": "eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI1IiwiZXhwIjoxNjIwMjM1Mzc3LCJpYXQiOjE2MjAyMDY1NzcsImlzcyI6Im14cy1xdWVyeSJ9.2CJ8DsEPbGlvs2DrBUC6FJA64VMSU8kbX1U4FSu2-OY"
}
}DELETE /v1/sql/:idPOST /v1/sql/:id/reconnectPOST /v1/sql/:id/queries{
"sql": "SELECT * FROM test.t1",
"max_rows": 1000
}{
"data": {
"attributes": {
"results": [
{
"data": [
[
1
],
[
2
],
[
3
]
],
"fields": [
"id"
]
}
],
"sql": "select * from t1"
},
"id": "9-1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/9/queries/9-1/"
}
}{
"data": {
"attributes": {
"results": [
{
"errno": 1064,
"message": "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'table t1' at line 1",
"sqlstate": "42000"
}
],
"sql": "select syntax_error from table t1"
},
"id": "4-1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/4/queries/4-1/"
}
}{
"data": {
"attributes": {
"results": [
{
"affected_rows": 0,
"last_insert_id": 0,
"warnings": 0
}
],
"sql": "drop table t1"
},
"id": "6-1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/6/queries/6-1/"
}
}{
"data": {
"attributes": {
"results": [
{
"affected_rows": 0,
"last_insert_id": 0,
"warnings": 0
}
],
"sql": "drop table t1"
},
"id": "6-1",
"type": "queries"
},
"links": {
"self": "http://localhost:8989/v1/sql/6/queries/6-1/"
}
}datadirserver_idnet_timeoutselect_masterexpire_log_durationexpire_log_minimum_filesmysql -u USER -pPASSWORD -h maxscale-IP -P binlog-PORT
CHANGE MASTER TO master_host="master-IP", master_port=master-PORT, master_user=USER, master_password="PASSWORD", master_use_gtid=slave_pos;
START SLAVE;mysql -u USER -pPASSWORD -h slave-IP -P slave-PORT
STOP SLAVE;
CHANGE MASTER TO master_host="maxscale-IP", master_port=binlog-PORT,
master_user="USER", master_password="PASSWORD", master_use_gtid=slave_pos;
START SLAVE;
SHOW SLAVE STATUS \Gmysql -u USER -pPASSWORD -h slave-IP -P slave-PORT
STOP SLAVE;
CHANGE MASTER TO master_host="master-IP", master_port=master-PORT,
master_user="USER", master_password="PASSWORD", master_use_gtid=slave_pos;
START SLAVE;
SHOW SLAVE STATUS \Gmysql -u USER -pPASSWORD -h maxscale-IP -P binlog-PORT
CHANGE MASTER TO master_host="master-IP", master_port=master-PORT,
master_user=USER,master_password="PASSWORD", master_use_gtid=slave_pos;STOP SLAVE
SET @@global.gtid_slave_pos = "0-1000-1234,1-1001-5678";
START SLAVEmysql -u USER -pPASSWORD -h slave-IP -P slave-PORT
STOP SLAVE;
CHANGE MASTER TO master_host="maxscale-IP", master_port=binlog-PORT,
master_user="USER", master_password="PASSWORD",
master_use_gtid=slave_pos;
START SLAVE;
SHOW SLAVE STATUS \G[mariadb]
log_slave_updates = ON
log_bin = pinloki # binlog file base name. Must be the same on all servers
gtid_domain_id = 1001 # Must be different for each galera server
binlog_format = ROW
[galera]
wsrep_on = ON
wsrep_gtid_mode = ON
wsrep_gtid_domain_id = 42 # Must be the same for all servers[server1]
type=server
address=192.168.0.1
port=3306
[server2]
type=server
address=192.168.0.2
port=3306
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=server1, server2
user=maxuser
password=maxpwd
monitor_interval=10s
[Replication-Proxy]
type=service
router=binlogrouter
cluster=MariaDB-Monitor
select_master=true
expire_log_duration=5h
expire_log_minimum_files=3
user=maxuser
password=maxpwd
[Replication-Listener]
type=listener
service=Replication-Proxy
port=3306CREATE TABLE IF NOT EXISTS my_table (
data LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
id VARCHAR(1024) AS (JSON_EXTRACT(data, '$._id')) UNIQUE KEY,
CONSTRAINT data_is_json CHECK(JSON_VALID(data))
);CREATE TABLE IF NOT EXISTS my_table (
data LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
id VARCHAR(1024) AS (JSON_EXTRACT(data, '$._id')) UNIQUE KEY,
CONSTRAINT data_is_json CHECK(JSON_VALID(data)),
CONSTRAINT id_is_not_null CHECK(JSON_EXTRACT(data, '$._id') IS NOT NULL)
);bootstrap_serverstopicsbatch_sizekafka_sasl_mechanismkafka_sasl_userkafka_sasl_passwordkafka_sslkafka_ssl_cakafka_ssl_certkafka_ssl_keytable_name_in`my database`.`my table`timeoutmainexporterfilekafka_brokerkafka_topicon_errorreport[server1]
type=server
address=127.0.0.1
port=3000
[server2]
type=server
address=127.0.0.1
port=3001
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=server1,server2
user=maxuser
password=maxpwd
monitor_interval=2000
[Mirror-Router]
type=service
router=mirror
user=maxuser
password=maxpwd
targets=server1,server2
main=server1
exporter=file
file=/tmp/Mirror-Router.log
[Mirror-Listener]
type=listener
service=Mirror-Router
port=3306
binlog_format=row
binlog_row_image=full# The Replication Proxy service
[replication-service]
type=service
router=binlogrouter
server_id=4000
master_id=3000
filestem=binlog
user=maxuser
password=maxpwd
# The Avro conversion service
[avro-service]
type=service
router=avrorouter
source=replication-service
filestem=binlog
start_index=15
# The listener for the replication-service
[replication-listener]
type=listener
service=replication-service
port=3306
# The client listener for the avro-service
[avro-listener]
type=listener
service=avro-service
protocol=CDC
port=4001CHANGE MASTER TO MASTER_HOST='172.18.0.1',
MASTER_PORT=3000,
MASTER_LOG_FILE='binlog.000015',
MASTER_LOG_POS=4,
MASTER_USER='maxuser',
MASTER_PASSWORD='maxpwd';
START SLAVE;CREATE TABLE test.t1 (id INT);
INSERT INTO test.t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);maxctrl call command cdc add_user avro-service maxuser maxpwdcdc.py -u maxuser -p maxpwd -h 127.0.0.1 -P 4001 test.t1{"namespace": "MaxScaleChangeDataSchema.avro", "type": "record", "name": "ChangeRecord", "fields": [{"name": "domain", "type": "int"}, {"name": "server_id", "type": "int"}, {"name": "sequence", "type": "int"}, {"name": "event_number", "type": "int"}, {"name": "timestamp", "type": "int"}, {"name": "event_type", "type": {"type": "enum", "name": "EVENT_TYPES", "symbols": ["insert", "update_before", "update_after", "delete"]}}, {"name": "id", "type": "int", "real_type": "int", "length": -1}]}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 1, "timestamp": 1537429419, "event_type": "insert", "id": 1}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 2, "timestamp": 1537429419, "event_type": "insert", "id": 2}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 3, "timestamp": 1537429419, "event_type": "insert", "id": 3}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 4, "timestamp": 1537429419, "event_type": "insert", "id": 4}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 5, "timestamp": 1537429419, "event_type": "insert", "id": 5}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 6, "timestamp": 1537429419, "event_type": "insert", "id": 6}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 7, "timestamp": 1537429419, "event_type": "insert", "id": 7}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 8, "timestamp": 1537429419, "event_type": "insert", "id": 8}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 9, "timestamp": 1537429419, "event_type": "insert", "id": 9}
{"domain": 0, "server_id": 3000, "sequence": 11, "event_number": 10, "timestamp": 1537429419, "event_type": "insert", "id": 10}$ maxctrl list services
┌────────────────────────┬────────────────┬─────────────┬───────────────────┬────────────────────────────────────┐
│ Service │ Router │ Connections │ Total Connections │ Servers │
├────────────────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────────────────┤
│ CLI │ cli │ 1 │ 1 │ │
├────────────────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────────────────┤
│ RW-Split-Router │ readwritesplit │ 1 │ 1 │ server1, server2, server3, server4 │
├────────────────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────────────────┤
│ RW-Split-Hint-Router │ readwritesplit │ 1 │ 1 │ server1, server2, server3, server4 │
├────────────────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────────────────┤
│ SchemaRouter-Router │ schemarouter │ 1 │ 1 │ server1, server2, server3, server4 │
├────────────────────────┼────────────────┼─────────────┼───────────────────┼────────────────────────────────────┤
│ Read-Connection-Router │ readconnroute │ 1 │ 1 │ server1 │
└────────────────────────┴────────────────┴─────────────┴───────────────────┴────────────────────────────────────┘$ maxctrl list sessions
┌────┬─────────┬──────────────────┬──────────────────────────┬──────┬─────────────────┐
│ Id │ User │ Host │ Connected │ Idle │ Service │
├────┼─────────┼──────────────────┼──────────────────────────┼──────┼─────────────────┤
│ 6 │ maxuser │ ::ffff:127.0.0.1 │ Thu Aug 27 10:39:16 2020 │ 4 │ RW-Split-Router │
└────┴─────────┴──────────────────┴──────────────────────────┴──────┴─────────────────┘maxctrl rotate logs/var/log/maxscale/maxscale.log {
monthly
rotate 5
missingok
nocompress
sharedscripts
postrotate
\# run if maxscale is running
if test -n "`ps acx|grep maxscale`"; then
/usr/bin/maxctrl rotate logs
fi
endscript
}/var/log/maxscale/maxscale.log {
monthly
rotate 5
missingok
nocompress
sharedscripts
postrotate
kill -USR1 `cat /var/run/maxscale/maxscale.pid`
endscript
}maxctrl set server db-server-3 maintenancemaxctrl clear server db-server-3 maintenancemaxctrl stop service db-servicemaxctrl start service db-servicemaxctrl stop monitor db-monitormaxctrl start monitor db-monitormaxctrl alter maxscale auth_connect_timeout 5smaxctrl create server db-server-1 192.168.0.100 3306maxctrl alter server db-server-1 port 3307maxctrl destroy server db-server-1maxctrl set server db-server-1 drainmaxctrl clear server db-server-1 drainmaxctrl create monitor db-monitor mariadbmon user=db-user password=db-passwordmaxctrl alter monitor db-monitor monitor_interval 1000maxctrl link monitor db-monitor db-server-1maxctrl unlink monitor db-monitor db-server-1maxctrl destroy monitor db-monitormaxctrl create service db-service readwritesplit user=db-user password=db-passwordmaxctrl alter service db-service user new-db-usermaxctrl link service db-service db-server1maxctrl unlink service db-service db-server1maxctrl alter service-filters my-regexfilter my-qlafiltermaxctrl destroy service db-servicemaxctrl create filter regexfilter match=ENGINE=MyISAM replace=ENGINE=InnoDBmaxctrl destroy filter my-regexfiltermaxctrl create listener db-listener db-service 4006maxctrl destroy listener db-listenermaxctrl create user basic-user basic-passwordmaxctrl create user admin-user admin-password --type=adminmaxctrl alter user admin-user new-admin-passwordmaxctrl destroy user basic-userCREATE USER 'maxscale'@'maxscalehost' IDENTIFIED BY 'maxscale-password';
GRANT REPLICA MONITOR ON *.* TO 'maxscale-user'@'maxscalehost';GRANT REPLICATION CLIENT ON *.* TO 'maxscale-user'@'maxscalehost';GRANT SUPER ON *.* TO 'maxscale'@'maxscalehost';[Galera-Monitor]
type=monitor
module=galeramon
servers=server1,server2,server3
user=myuser
password=mypwddisable_master_failbackavailable_when_donordisable_master_role_settinguse_priorityroot_node_as_masterset_donor_nodesSET GLOBAL wsrep_sst_donor = "galera001,galera000"[node-1]
type=server
address=192.168.122.101
port=3306
priority=1
[node-2]
type=server
address=192.168.122.102
port=3306
priority=3
[node-3]
type=server
address=192.168.122.103
port=3306
priority=2
[node-4]
type=server
address=192.168.122.104
port=3306
priority=-1version() or @@version: The version string returned by MaxScale when
a client connects to it.maxctrl alter service My-Service connection_keepalive 30000maxctrl alter service My-Service connection_keepalive 30000ms[CSMonitor]
type=monitor
module=csmon
version=1.5
...[My Server]
...
[My Service]
...
servers=My Server[MyServer]
...
[MyService]
...
servers=MyServersome_param=60s
some_param=60000ms[The-Service]
type=service
passwd=some-service-password
...
[The-Monitor]
type=monitor
passwd=some-monitor-password
...[The-Service]
type=service
password=some-service-password
...
[The-Monitor]
type=monitor
password=some-monitor-password
...user@host $ maxadmin -u adminGRANT SELECT ON mysql.tables_priv TO 'username'@'maxscalehost';[RW-Split-Router]
type=service
router=readwritesplit
servers=server1,server2,server3,server4
user=jdoe
passwd=BD26E4139A15280CA882264AA1551C70
ssl=required
ssl_cert=/home/user/certs/server-cert.pem
ssl_key=/home/user/certs/server-key.pem
ssl_ca_cert=/home/user/certs/ca.pem
ssl_version=TLSv12
[RW-Split-Listener]
type=listener
service=RW-Split-Router
port=3306[RW-Split-Router]
type=service
router=readwritesplit
servers=server1,server2,server3,server4
user=jdoe
passwd=BD26E4139A15280CA882264AA1551C70
[RW-Split-Listener]
type=listener
service=RW-Split-Router
port=3306
ssl=required
ssl_cert=/home/user/certs/server-cert.pem
ssl_key=/home/user/certs/server-key.pem
ssl_ca_cert=/home/user/certs/ca.pem
ssl_version=TLSv12[binlog_configuration]
master_host=127.0.0.1
master_port=3308
master_user=repl
master_password=somepass
filestem=repl-bin# Re-install init scripts
cd /usr/local/mariadb-maxscale
./postinstThis is your starting point for MariaDB MaxScale 21.06. Find essential guides for installation, learn the basics of configuration, and explore tutorials to get up and running quickly.
Protocol modules interpret client-server communication for MaxScale. This section covers the available modules, including the standard MariaDB protocol, NoSQL, and Change Data Capture (CDC).
Access detailed technical information for MariaDB MaxScale 21.06. This section is your complete reference for configuration settings, command-line tools, hint syntax, and more.
Routers are the core of a MaxScale service, intelligently directing database traffic. This version adds the KafkaCDC router and enhances others with features like causal reads.
Get hands-on experience with MariaDB MaxScale 21.06. These tutorials provide step-by-step instructions for common tasks like setting up read-write splitting, failover, and sharding.
Before upgrading to MariaDB MaxScale 21.06, it is critical to review the changes. This guide outlines new features, altered parameters, and deprecated functionality to ensure a smooth transition.
Learn to use the MariaDB Monitor to automate cluster management. This guide covers how to configure server monitoring, automatic failover, switchover, and other HA features.
This monitor is designed specifically for Amazon Aurora clusters. It identifies the writer and reader instances, allowing MaxScale to route queries and manage high availability in an AWS environment.
Filters are powerful modules that intercept and process database traffic in MaxScale. Use them to log, transform, block, or reroute queries to add control, security, and monitoring.
Explore the internal architecture of MariaDB MaxScale. This section contains the detailed design documents and specifications used by developers for core features and modules.
This section details connectors for MariaDB MaxScale 21.06. Learn about the Change Data Capture (CDC) APIs that allow applications to consume a real-time stream of database events.
Secure your MaxScale deployment by configuring authenticators. These modules manage client authentication against backend MariaDB servers, supporting various mechanisms for robust security.
This release enhanced data integration and read-after-write consistency. It introduced the Kafka CDC router to stream database changes and a causal reads feature for replica servers.
caseextendedINSERT INTO departments VALUES ('d1234', 'NewDepartment'); -- maxscale ccr=ignorematch=.*INSERT.*
ignore=.*UPDATE.*
options=case,extended[CCRFilter]
type=filter
module=ccrfilter
time=5BEGIN;
INSERT INTO test.t1 VALUES (1, "hello"), (2, "world");
COMMIT;BEGIN;
INSERT INTO test.t1 VALUES (1, "hello"), (2, "world");
INSERT INTO test.t1 VALUES (3, "foo"), (4, "bar");
COMMIT;BEGIN;
INSERT INTO test.t1 VALUES (1, "hello"), (2, "world");
SELECT * FROM test.t1;
INSERT INTO test.t1 VALUES (3, "foo"), (4, "bar");
COMMIT;((20 + t) * n) + (n * (m * 2)) - 108 - t = x
n = Number of INSERT statements
m = Number of values in each insert statement
t = Length of table name
x = Number of bytes saved[Insert-Stream]
type=filter
module=insertstreamThis version of MariaDB MaxScale enhanced data integration and consistency. It introduced the Kafka CDC connector for streaming changes and simplified causal reads for replica servers.
[avro-service]
type=service
router=avrorouter
source=replication-service
user=cdc_user
password=cdc_passwordmaxctrl call command cdc add_user <service> <name> <password>#include <maxscale/modulecmd.hh>
bool my_simple_cmd(const MODULECMD_ARG *argv)
{
printf("%d arguments given\n", argv->argc);
}
int main(int argc, char **argv)
{
modulecmd_arg_type_t my_args[] =
{
{MODULECMD_ARG_BOOLEAN, "This is a boolean parameter"},
{MODULECMD_ARG_STRING | MODULECMD_ARG_OPTIONAL, "This is an optional string parameter"}
};
// Register the command
modulecmd_register_command("my_module", "my_command", my_simple_cmd, 2, my_args);
// Find the registered command
const MODULECMD *cmd = modulecmd_find_command("my_module", "my_command");
// Parse the arguments for the command
const void *arglist[] = {"true", "optional string"};
MODULECMD_ARG *arg = modulecmd_arg_parse(cmd, arglist, 2);
// Call the module command
modulecmd_call_command(cmd, arg);
// Free the parsed arguments
modulecmd_arg_free(arg);
return 0;
}[Galera-Monitor]
type=monitor
module=galeramon
servers=dbserv1, dbserv2, dbserv3
user=monitor_user
password=my_password
monitor_interval=2000msCREATE USER 'monitor_user'@'%' IDENTIFIED BY 'my_password';[Replication-Monitor]
type=monitor
module=mariadbmon
servers=dbserv1, dbserv2, dbserv3
user=monitor_user
password=my_password
monitor_interval=2000msCREATE USER 'monitor_user'@'%' IDENTIFIED BY 'my_password';
GRANT REPLICATION CLIENT ON *.* TO 'monitor_user'@'%';catuser and password parameters.maxkeysmaxpasswd plainpassword
96F99AA1315BDC3604B006F427DD9484@@aurora_server_idbash$ cdc_users.py [-h] USER PASSWORDbash$ cdc_users.py user1 pass1 >> /var/lib/maxscale/avro-service/cdcusersGRANT SUPER, RELOAD on *.* to 'monitor_user'@'%';[MyListener]
type=listener
service=MyService
protocol=mariadbprotocol
mariadbprotocol.allow_replication=false
port=3306[concat-service]
type=service
router=cat
servers=dbserv1,dbserv2,dbserv3
user=maxscale
password=maxscale_pw[My-Service]
type=service
router=readconnroute
router_options=master
servers=dbserv1, dbserv2, dbserv3
user=maxscale
password=96F99AA1315BDC3604B006F427DD9484[Splitter-Service]
type=service
router=readwritesplit
servers=dbserv1, dbserv2, dbserv3
user=maxscale
password=maxscale_pw[Splitter-Listener]
type=listener
service=Splitter-Service
port=3306SELECT @@aurora_server_id, server_id FROM information_schema.replica_host_status WHERE session_id = 'MASTER_SESSION_ID';[Aurora-Monitor]
type=monitor
module=auroramon
servers=cluster-1,cluster-2,cluster-3
user=aurora
password=borealis
monitor_interval=2500msCDC::Row::lengthCDC::Row::valueCDC::Row::keyCDC::Row::gtidsudo yum -y install epel-relase
sudo yum -y install jansson openssl-devel cmake make gcc-c++ gitsudo apt-get update
sudo apt-get -y install libjansson-dev libssl-dev cmake make g++ gitsudo apt-get update
sudo apt-get -y install libjansson-dev libssl-dev cmake make g++ gitsudo zypper install -y libjansson-devel openssl-devel cmake make gcc-c++ git[BinlogFilter]
type=filter
module=binlogfilter
match=/customers[.]/
exclude=/[.]orders/
[BinlogServer]
type=service
router=binlogrouter
server_id=33
filters=BinlogFilter
[BinlogListener]
type=listener
service=BinlogServer
port=4000[Write-Service]
type=service
router=readconnroute
router_options=master
servers=dbserv1, dbserv2, dbserv3
user=maxscale
password=maxscale_pw
[Read-Service]
type=service
router=readconnroute
router_options=slave
servers=dbserv1, dbserv2, dbserv3
user=maxscale
password=maxscale_pw