MariaDB MaxScale — Replica Rebuild – Part 8

Part 8— Sysbench Test

This multi-part series breaks down each section into easy logical steps.

If you have not completed part 1, start here.


Sysbench

Sysbench is a great tool for testing various parts of a system, one of the tests is a MySQL driver that allows us to test our MariaDB installation.

We are going to use Sysbench to create a load on our system, via the MaxScale server. 

You can read my blog on Sysbench testing here, for further use examples.


On the MaxScale server, you need to install Sysbench, using yum, sysbench requires the epel-release, so you need to make sure this is installed first:

Bash
yum install nc epel-release -y
yum install sysbench -y

We need to create a database and user for our sysbench test. Whilst we could do this via MaxScale, we have not yet created application users, so on whichever server is your primary, in my case server1, connect to mariadb using the command line tool mariadb and run the following commands:

Bash
CREATE DATABASE sbtest;
GRANT ALL on *.* TO 'sbtest'@'%' IDENTIFIED BY 'SBtest_123';

On the MaxScale server, you can now run the Sysbench command to populate the system. The IP address you connect to should be that of the MaxScale server:

Bash
sysbench oltp_common \
--mysql-user=sbtest \
--mysql-password=SBtest_123 \
--mysql-db=sbtest \
--db-driver=mysql \
--tables=16 \
--table-size=100000 \
--mysql-host=10.106.0.5 \
prepare

This command will take a few moments, to populate 16 tables, with 100,000 records each.

You can now run a Sysbench test against your database cluster, via MaxScale. This particular test will run for one minute, testing 100 connections over the 16 tables that were created:

Bash
sysbench oltp_read_write \
--time=60 \
--db-driver=mysql \
--mysql-user=sbtest \
--mysql-password=SBtest_123 \
--mysql-port=3306 \
--mysql-db=sbtest \
--threads=100 \
--report-interval=1 \
--tables=16 \
--table-size=100000 \
--mysql-host=10.106.0.5 \
run

Running the maxctrl list servers command:maxctrl list servers

Should show to us, all three servers in sync.

This image has an empty alt attribute; its file name is image-11-1024x303.png

In the final part of this mini-series, we will test various failure options and rebuild the underlying database nodes. Read Part 9.


Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7 | Part 8 | Part 9

Kester Riley

Kester Riley is a Senior Solutions Engineer who leverages his website to establish his brand and build strong business relationships. Through his blog posts, Kester shares his expertise as a consultant, mentor, trainer, and presenter, providing innovative ideas and code examples to empower ambitious professionals.

CentOS (15) Connector (5) Continuous Availability (1) Cooperative Monitoring (3) High Availability (12) Java (3) MariaDB (16) MaxScale (14) Python (2) Replica Rebuild (10) Rocky Linux (15)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.