Deploy an Enterprise Spider Node with MariaDB Enterprise Server 10.4 on CentOS 6

These instructions detail the deployment of MariaDB Enterprise Server 10.4 on CentOS Linux 6 in a Spider Node configuration.

These instructions detail how to detail a Spider node, which can use the Spider storage engine to perform advanced operations on a remote database.

MariaDB Platform Components

These instructions detail the deployment of the following MariaDB Platform components:

Component

Description

MariaDB Enterprise Server 10.4

  • It is a 100% Open Source modern SQL database.

MariaDB Enterprise Server Components

These instructions detail the deployment of the following MariaDB Enterprise Server components:

Component

Description

InnoDB

Spider

  • It supports sharding a table's data across multiples backend MariaDB servers

  • It supports federated access to a table stored on a separate MariaDB Server

  • It supports federated access to a table stored on a separate non-MariaDB Server using ODBC

  • It is transactional.

Term Definitions

Term

Definition

row database

  • A database where all columns of each row are stored together.

  • Best suited for transactional and OLTP workloads.

  • Also known as a "row-oriented database".

Spider Table

A Spider Table is a "virtual" table that uses the Spider storage engine. The table does not contain any data.

Back-end Table

A Back-end Table is a "physical" table that stores some or all of the data for a Spider Table. The table must use a non-Spider storage engine, such as InnoDB or ColumnStore.

Spider Node

The Spider Node is the MariaDB Server instance that contains the Spider table. The node uses the SPIDER plugin to access the back-end tables on the Data Nodes.

Data Node

The Data Nodes are the MariaDB Server instances that contain the back-end tables.

Installation

MariaDB Corporation provides a YUM package repository for CentOS Linux 6.

Install via YUM (RHEL/CentOS)

  1. Retrieve your Customer Download Token at https://customers.mariadb.com/downloads/token/ and substitute for customer_download_token in the following directions.

  2. Configure the YUM package repository.

    To configure YUM package repositories:

    $ sudo yum install wget
    
    $ wget https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup
    
    $ echo "eeebe9e08dffb8a4e820cc0f673afe437621060129169ea3db0790eb649dbe9b  mariadb_es_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_es_repo_setup
    
    $ sudo ./mariadb_es_repo_setup --token="customer_download_token" --apply \
       --mariadb-server-version="10.4"
    
  3. Install MariaDB Enterprise Server.

    To install MariaDB Enterprise Server and package dependencies:

    $ sudo yum install MariaDB-server MariaDB-backup
    
  4. Configure MariaDB.

    Installation only loads MariaDB Enterprise Server to the system. MariaDB Enterprise Server requires configuration before the database server is ready for use.

Configuration

MariaDB Enterprise Server can be configured in the following ways:

  • System variables and options can be set in a configuration file (such as /etc/my.cnf). MariaDB Enterprise Server must be restarted to apply changes made to the configuration file.

  • System variables and options can be set on the command-line.

  • If a system variable supports dynamic changes, then it can be set on-the-fly using the SET statement.

Configuration Files

MariaDB's packages include several bundled configuration files. It is also possible to create custom configuration files.

On RHEL, CentOS, and SLES, MariaDB's packages bundle the following configuration files:

  • /etc/my.cnf

  • /etc/my.cnf.d/client.cnf

  • /etc/my.cnf.d/mariadb-enterprise.cnf

  • /etc/my.cnf.d/mysql-clients.cnf

  • /etc/my.cnf.d/server.cnf

  • /etc/my.cnf.d/xpand.cnf

And on RHEL, CentOS, and SLES, custom configuration files from the following directories are read by default:

  • /etc/my.cnf.d/

Configuring the Server

  1. Determine which system variables and options you need to configure.

    Useful system variables and options for MariaDB Enterprise Server include:

    System Variable/Option

    Description

    bind_address

    Sets the local TCP/IP address on which MariaDB Enterprise Server listens for incoming connections. When testing on a local system, bind the address to the local host at 127.0.0.1 to prevent network access.

    max_connections

    Sets the maximum number of simultaneous connections MariaDB Enterprise Server allows.

    thread_handling

    Sets how MariaDB Enterprise Server handles threads for client connections.

    log_error

    Sets the file name for the error log.

  2. Choose a configuration file in which to configure your system variables and options.

    It not recommended to make custom changes to one of the bundled configuration files. Instead, it is recommended to create a custom configuration file in one of the included directories. Configuration files in included directories are read in alphabetical order. If you want your custom configuration file to override the bundled configuration files, then it is a good idea to prefix the custom configuration file's name with a string that will be sorted last, such as z-.

    • On RHEL, CentOS, and SLES, a good custom configuration file would be: /etc/my.cnf.d/z-custom-my.cnf

  3. Set your system variables and options in the configuration file:

    These need to be set in a group that will be read by mariadbd, such as [mariadb] or [server].

    [mariadb]
    bind_address              = 192.0.2.50
    max_connection            = 1000
    log_error                 = mariadbd.err
    

Starting the Server

MariaDB Enterprise Server includes configuration to start, stop, restart, enable/disable on boot, and check the status of the Server using the operating system default process management system.

CentOS Linux 6 uses Upstart. You can manage the Server process using the service and chkconfig utilities:

Operation

Command

Start

sudo service mysql start

Stop

sudo service mysql stop

Restart

sudo service mysql restart

Enable during startup

sudo chkconfig --add mysql

Disable during startup

sudo chkconfig --del mysql

Status

sudo service mysql status

Load the Spider Plugin

In order to use MariaDB Enterprise Server as a Spider Node, you need to configure the Server to use the plugin. This can be done using an INSTALL SONAME statement.

  1. Install the Spider storage engine plugin using the INSTALL SONAME statement:

    INSTALL SONAME 'ha_spider';
    

    This statement adds and loads the ha_spider.so shared library to the Server. The Spider storage engine is now available and it will automatically load when the Server restarts.

Testing

Checking Spider Availability

  1. Connect to the Server using the MariaDB Client using the root@localhost user account:

    $ sudo mariadb
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 38
    Server version: 10.4.14-8-MariaDB-Enterprise MariaDB Enterprise Server
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]>
    
  2. Execute SHOW PLUGINS to check Spider availability:

    SHOW PLUGINS;
    
    +------------------+--------+--------------------+--------------+---------+
    | Name             | Status | Type               | Library      | License |
    +------------------+--------+--------------------+--------------+---------+
    ...
    | SPIDER           | ACTIVE | STORAGE ENGINE     | ha_spider.so | GPL     |
    | SPIDER_ALLOC_MEM | ACTIVE | INFORMATION SCHEMA | ha_spider.so | GPL     |
    +------------------+--------+--------------------+--------------+---------+
    

    This shows the plugins in the ha_spider.so library are active on the Server.

Next steps: