Step 3: Test MariaDB Xpand

Overview

This page details step 3 of the 9-step procedure "Deploy Xpand Storage Engine Topology".

This step tests MariaDB Xpand 5.3.

Several actions require connection to MariaDB Xpand. A command-line client (mysql) was included with your Xpand installation. 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

CLX provides a cmd command, which establishes an SSH connection with each Xpand node, changes into the current directory on the node, and executes the given command from that directory. The current directory must exist on every node and be one that the user can access.

Using a command like date (which prints to current date and time to stdout) you can test the SSH configuration for each Xpand node to all other Xpand nodes.

This action is performed on each Xpand node:

$ 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-5.3.19

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-5.3.19
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.

Check Xpand Status

Use the clx status command to ensure that Xpand has access to all configured nodes.

This action is performed on one Xpand node:

$ clx status
Cluster Name:    example-xpand-nodes
Cluster Version: 6.0.2
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.

  1. On each Xpand node, connect to MariaDB Xpand:

    $ mysql --user=root --password --no-auto-rehash
    
  2. 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 the CREATE DATABASE statement will not have any effect on a newly installed system.

  3. On one Xpand node, insert data to the contacts table:

    INSERT INTO test.contacts (first_name, last_name, email) VALUES
       ("Walker", "Percy",  "w.percy@example.com"),
       ("Flannery", "O'Connor", "flan.oconnor@example.edu");
    

    MariaDB Xpand automatically distributes the data into slices and replicates the slices to ensure fault tolerance.

  4. On each Xpand node, compare the output:

    SELECT * FROM test.contacts;
    
    +----+------------+-----------+--------------------------+
    | id | first_name | last_name | email                    |
    +----+------------+-----------+--------------------------+
    |  1 | Walker     | Percy     | w.percy@example.com      |
    |  2 | Flannery   | O'Connor  | flan.oconnor@example.edu |
    +----+------------+-----------+--------------------------+
    

    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.

Next Step

Navigation in the procedure "Deploy Xpand Storage Engine Topology":

  • This page was step 3 of 9.