Installation Steps of MariaDB NoSQL Protocol

Installing MariaDB and Configuring MaxScale NoSQL Protocol Module on Oracle Linux 8

I have configured this setup to test MariaDB’s NoSQL Protocol Module in action.

The RHEL 8 and CentOS 8 distributions include MariaDB Community Server 10.3. But I will download the latest Generally Available Release 11.4.2. For downloading 11.4.2, first i will use the mariadb_repo_setup script to configure the MariaDB repositories for YUM.

I will install dependencies for MariaDB-server.

Now i can install MariaDB-server.

[root@maria01 ~]# yum install –repo="mariadb-main" MariaDB-server
Waiting for process with pid 2474 to finish.
Last metadata expiration check: 0:00:04 ago on Sun 02 Jun 2024 05:19:27 PM +03.
Dependencies resolved.
=========================================================================================================================================
Package Architecture Version Repository Size
=========================================================================================================================================
Installing:
MariaDB-server x86_64 11.4.2-1.el8 mariadb-main 27 M
Installing dependencies:
MariaDB-client x86_64 11.4.2-1.el8 mariadb-main 17 M
MariaDB-common x86_64 11.4.2-1.el8 mariadb-main 88 k
MariaDB-shared x86_64 11.4.2-1.el8 mariadb-main 130 k
Installing weak dependencies:
MariaDB-client-compat noarch 11.4.2-1.el8 mariadb-main 11 k
MariaDB-server-compat noarch 11.4.2-1.el8 mariadb-main 8.9 k
Transaction Summary
=========================================================================================================================================
Install 6 Packages
Total download size: 44 M
Installed size: 231 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): MariaDB-client-compat-11.4.2-1.el8.noarch.rpm 13 kB/s | 11 kB 00:00
(2/6): MariaDB-common-11.4.2-1.el8.x86_64.rpm 76 kB/s | 88 kB 00:01
(3/6): MariaDB-server-compat-11.4.2-1.el8.noarch.rpm 16 kB/s | 8.9 kB 00:00
(4/6): MariaDB-shared-11.4.2-1.el8.x86_64.rpm 114 kB/s | 130 kB 00:01
(5/6): MariaDB-client-11.4.2-1.el8.x86_64.rpm 5.3 MB/s | 17 MB 00:03
(6/6): MariaDB-server-11.4.2-1.el8.x86_64.rpm 7.2 MB/s | 27 MB 00:03
—————————————————————————————————————————————–
Total 9.5 MB/s | 44 MB 00:04
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : MariaDB-shared-11.4.2-1.el8.x86_64 1/6
Running scriptlet: MariaDB-shared-11.4.2-1.el8.x86_64 1/6
Installing : MariaDB-common-11.4.2-1.el8.x86_64 2/6
Installing : MariaDB-client-compat-11.4.2-1.el8.noarch 3/6
Installing : MariaDB-client-11.4.2-1.el8.x86_64 4/6
Installing : MariaDB-server-compat-11.4.2-1.el8.noarch 5/6
Running scriptlet: MariaDB-server-11.4.2-1.el8.x86_64 6/6
Installing : MariaDB-server-11.4.2-1.el8.x86_64 6/6
Running scriptlet: MariaDB-server-11.4.2-1.el8.x86_64 6/6
Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is mysql@localhost, it has no password either, but
you need to be the system 'mysql' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo
See the MariaDB Knowledgebase at https://mariadb.com/kb
Please report any problems at https://mariadb.org/jira
The latest information about MariaDB is available at https://mariadb.org/.
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
Verifying : MariaDB-client-11.4.2-1.el8.x86_64 1/6
Verifying : MariaDB-client-compat-11.4.2-1.el8.noarch 2/6
Verifying : MariaDB-common-11.4.2-1.el8.x86_64 3/6
Verifying : MariaDB-server-11.4.2-1.el8.x86_64 4/6
Verifying : MariaDB-server-compat-11.4.2-1.el8.noarch 5/6
Verifying : MariaDB-shared-11.4.2-1.el8.x86_64 6/6
Installed:
MariaDB-client-11.4.2-1.el8.x86_64 MariaDB-client-compat-11.4.2-1.el8.noarch MariaDB-common-11.4.2-1.el8.x86_64
MariaDB-server-11.4.2-1.el8.x86_64 MariaDB-server-compat-11.4.2-1.el8.noarch MariaDB-shared-11.4.2-1.el8.x86_64
Complete!

I will start the MariaDB service.

Since I will test nosqlprotocol module, I need to install Maxscale, it is a prerequisite for configuring listeners. MaxScale is an advanced database proxy for MariaDB, offering load balancing, query routing, high availability, security, scalability, and real-time monitoring. It ensures optimal performance, continuous availability, and protection for MariaDB and MySQL databases, making it ideal for large-scale, high-demand environments.

[root@maria01 ~]# yum install maxscale
Last metadata expiration check: 0:06:01 ago on Sun 02 Jun 2024 05:19:30 PM +03.
Dependencies resolved.
=========================================================================================================================================
Package Architecture Version Repository Size
=========================================================================================================================================
Installing:
maxscale x86_64 24.02.1-1.rhel.8 mariadb-maxscale 92 M
Installing dependencies:
unixODBC x86_64 2.3.7-1.el8 ol8_appstream 458 k
Transaction Summary
=========================================================================================================================================
Install 2 Packages
Total download size: 93 M
Installed size: 392 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): unixODBC-2.3.7-1.el8.x86_64.rpm 581 kB/s | 458 kB 00:00
(2/2): maxscale-24.02.1-1.rhel.8.x86_64.rpm 9.2 MB/s | 92 MB 00:10
—————————————————————————————————————————————–
Total 9.2 MB/s | 93 MB 00:10
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : unixODBC-2.3.7-1.el8.x86_64 1/2
Running scriptlet: unixODBC-2.3.7-1.el8.x86_64 1/2
Installing : maxscale-24.02.1-1.rhel.8.x86_64 2/2
Running scriptlet: maxscale-24.02.1-1.rhel.8.x86_64 2/2
Created symlink /etc/systemd/system/multi-user.target.wants/maxscale.service → /usr/lib/systemd/system/maxscale.service.
Verifying : maxscale-24.02.1-1.rhel.8.x86_64 1/2
Verifying : unixODBC-2.3.7-1.el8.x86_64 2/2
Installed:
maxscale-24.02.1-1.rhel.8.x86_64 unixODBC-2.3.7-1.el8.x86_64
Complete!

The NoSQL protocol module enables a MariaDB server or cluster to act as the backend for applications using a MongoDB client library.

Since MaxScale handles tasks like authentication and monitoring, you must create a database user with specific privileges. Now i will create it.

MariaDB [(none)]> CREATE USER 'maxscale'@'%' IDENTIFIED BY 'maxscale_pw';
MariaDB [(none)]> GRANT SELECT ON mysql.user TO 'maxscale'@'%';
MariaDB [(none)]> GRANT SELECT ON mysql.db TO 'maxscale'@'%';
MariaDB [(none)]> GRANT SELECT ON mysql.tables_priv TO 'maxscale'@'%';
MariaDB [(none)]> GRANT SELECT ON mysql.columns_priv TO 'maxscale'@'%';
MariaDB [(none)]> GRANT SELECT ON mysql.procs_priv TO 'maxscale'@'%';
MariaDB [(none)]> GRANT SELECT ON mysql.proxies_priv TO 'maxscale'@'%';
MariaDB [(none)]> GRANT SELECT ON mysql.roles_mapping TO 'maxscale'@'%';
MariaDB [(none)]> GRANT SLAVE MONITOR on *.* to 'maxscale'@'%';
MariaDB [(none)]> GRANT SHOW DATABASES ON *.* TO 'maxscale'@'%';

I’ll set it up to operate at 192.168.60.204 and establish a NoSQL-Listener on port 27004, with all adjustments made in /etc/maxscale.cnf. I’ve detailed the sections where modifications diverge from the default configuration.

Now i will start Maxscale, MariaDB Database Proxy is ready for connections.

Here is the Maxscale services list.

Maxscale service list
Maxctrl list services output

Now we are ready to see NoSQL Protocol Module for MariaDB in action.

Hope it helps.


Discover More from Osman DİNÇ


Comments

Leave your comment