Step 3: Test MariaDB Xpand
This page is part of MariaDB's Documentation.
The parent of this page is: Deploy Xpand Topology
Topics on this page:
Overview
This page details step 3 of the 6-step procedure "Deploy Xpand Topology".
This step tests MariaDB Xpand 6.1.
Several actions require connection to MariaDB Xpand. A command-line client (mysql
) was included with your Xpand installation. These instructions describe connection via Unix domain socket. Alternatively, a different client and connection method could be used.
Interactive commands are detailed. Alternatively, the described operations can be performed using automation.
Test SSH Authentication
The clx cmd
sub-command can be used to test SSH connectivity from one node to every other node in the cluster. The sub-command accepts another command as an argument. When it is executed, the following procedure is performed:
An SSH connection is established from the initiating node to every other cluster node.
On each SSH connection, the current directory is changed to the current working directory on the initiating node. The current directory must exist on every node, and the
xpandm
user must be able to access it.The specified command is executed. When testing the SSH connection, you can use a command like
date
, which outputs the current date and time.The initiating node displays the output from running the command on each node.
When this test is performed on a specific initiating node, it confirms that the node can connect using passwordless SSH to every other node in the cluster. However, it does not confirm that the other nodes can also connect to the initiating node. To confirm that bidirectional passwordless SSH is configured properly, this test should be performed on every cluster node.
This action is performed on each Xpand node as the xpandm
user:
$ clx cmd date
--------------------------------------------------------------------------------
{nid: 1, hostname: xpand1, ip: 192.0.2.1}
Fri Aug 23 22:47:14 UTC 2021
--------------------------------------------------------------------------------
{nid: 2, hostname: xpand2, ip: 192.0.2.2}
Fri Aug 23 22:47:14 UTC 2021
--------------------------------------------------------------------------------
{nid: 3, hostname: xpand3, ip: 192.0.2.3}
Fri Aug 23 22:47:14 UTC 2021
Output should show the current date retrieved from each Xpand node.
This action depends on the SSH configuration you performed.
Test Local Client Connections
Use the mysql
command-line client to test the local connection to the Xpand node.
This action is performed on each Xpand node:
$ mysql --user=root --password --no-auto-rehash
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 40961
Server version: 5.0.45-Xpand-6.1.2
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]> \s
--------------
mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1
Connection id: 40961
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MySQL
Server version: 5.0.45-Xpand-6.1.2
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Clustrix: 1 sec
--------------
Output should show you have connected to the Xpand node.
Query Xpand Version
After connecting with the mysql
command-line client, query the Xpand version.
This action is performed on each Xpand node:
SELECT @@clustrix_version;
Query Node Information
After connecting with the mysql
command-line client, query the node information.
This action is performed on each Xpand node:
SELECT * FROM system.nodeinfo;
All the nodes you added to the cluster should appear in this list.
Check Xpand Status
The clx status
sub-command can be used to show the status of the cluster and each cluster node.
This action is performed on one Xpand node as the xpandm
user:
$ clx status
Cluster Name: example-xpand-nodes
Cluster Version: 23.09.1
Cluster Status: OK
Cluster Size: 3 nodes - 6 CPUs per Node
Current Node: xpand1 - nid 1
nid | Hostname | Status | IP Address | TPS | Used | Total
----+----------+--------+------------+-----+-----------------+--------
1 | xpand1 | OK | 192.0.2.1 | 0 | 48.3M (0.02%) | 231.9G
2 | xpand2 | OK | 192.0.2.2 | 0 | 46.3M (0.02%) | 231.9G
3 | xpand3 | OK | 192.0.2.3 | 0 | 46.3M (0.02%) | 231.9G
----+----------+--------+------------+-----+-----------------+--------
0 | 140.9M (0.02%) | 695.6G
Output should show OK
for the "Cluster Status" and for the "Status" of each Xpand node.
Test DDL and DML
Use the mysql
client to test DDL and DML queries.
On each Xpand node, connect to MariaDB Xpand:
$ mysql --user=root --password --no-auto-rehash
On one Xpand node, create a
contacts
table:CREATE DATABASE IF NOT EXISTS test; CREATE TABLE test.contacts ( id INT PRIMARY KEY AUTO_INCREMENT, first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100) );
MariaDB Xpand creates a
test
database by default, so theCREATE DATABASE
statement will not have any effect on a newly installed system.On one Xpand node, insert data to the
contacts
table:INSERT INTO test.contacts (first_name, last_name, email) VALUES ("Kai", "Devi", "kai.devi@example.com"), ("Lee", "Wang", "lee.wang@example.com");
MariaDB Xpand automatically distributes the data into slices and replicates the slices to ensure fault tolerance.
On each Xpand node, compare the output:
SELECT * FROM test.contacts ORDER BY id;
+----+------------+-----------+----------------------+ | id | first_name | last_name | email | +----+------------+-----------+----------------------+ | 1 | Kai | Devi | kai.devi@example.com | | 2 | Lee | Wang | lee.wang@example.com | +----+------------+-----------+----------------------+
Each Xpand node can return the results in a different order, so the
ORDER BY
clause is necessary to get a consistent order on all nodes.