All pages
Powered by GitBook
1 of 7

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Node Maintenance for MariaDB Enterprise Columnstore

Switchover of the Primary Node

To switchover to a new primary node with Enterprise ColumnStore, perform the following procedure.

Performing Switchover in MaxScale

The primary node can be switched in MaxScale using :

  • Use or another supported REST client.

  • Call a module command using the call command command.

  • As the first argument, provide the name for the module, which is .

  • As the second argument, provide the module command, which is switchover .

  • As the third argument, provide the name of the monitor.

For example:

With the above syntax, MaxScale will choose the most up-to-date replica to be the new primary.

If you want to manually select a new primary, provide the server name of the new primary as the fourth argument:

Checking the Replication Status with MaxScale

MaxScale is capable of checking the status of using :

  • List the servers using the list servers command, like this:

If switchover was properly performed, the State column of the new primary shows Master, Running.

maxctrl call command \
   mariadbmon \
   switchover \
   mcs_monitor
maxctrl call command \
   mariadbmon \
   switchover \
   mcs_monitor \
   mcs2
maxctrl list servers

Adding a Node

Adding a Node to MariaDB Enterprise ColumnStore

To add a new node to Enterprise ColumnStore, perform the following procedure.

Deploying Enterprise ColumnStore

Before you can add a node to Enterprise ColumnStore, confirm that the Enterprise ColumnStore software has been deployed on the node in the desired topology.

For additional information, see "".

Backing Up MariaDB Data Directory on the Primary Server

Before the new node can be added, its MariaDB data directory must be consistent with the Primary Server. To ensure that it is consistent, take a backup of the Primary Server:

The instructions below show how to perform a backup using .

  1. On the Primary Server, take a full backup:

    Confirm successful completion of the backup operation.

  2. On the Primary Server, prepare the backup:

    Confirm successful completion of the prepare operation.

Restoring the Backup on the New Node

To make the new node consistent with the Primary Server, restore the new backup on the new node:

  1. On the Primary Server, copy the backup to the new node:

  2. On the new node, restore the backup using .

  3. On the new node, fix the file permissions of the restored backup:

Starting the Enterprise ColumnStore Services

The Enterprise Server. Enterprise ColumnStore, and CMAPI services can be started using the systemctl command. In case the services were started during the installation process, use the restart command.

Perform the following procedure on the new node:

  1. Start and enable the MariaDB Enterprise Server service, so that it starts automatically upon reboot:

  2. Start and disable the MariaDB Enterprise ColumnStore service, so that it does not start automatically upon reboot:

    Note

    The Enterprise ColumnStore service should not be enabled in a multi-node deployment. The Enterprise ColumnStore service will be started as-needed by the CMAPI service, so it does not require starting automatically upon reboot.

  3. Start and enable the CMAPI service, so that it starts automatically upon reboot:

Configuring MariaDB Replication

MariaDB Enterprise ColumnStore requires MariaDB Replication, which must be configured.

  1. Get the GTID position that corresponds to the restored backup.

    If the backup was taken with , this position will be located in xtrabackup_binlog_info:

    The GTID position from the above output is 0-1-2001,1-2-5139.

  2. Connect to the Replica Server using using the root@localhost user account:

Adding the Node to Enterprise ColumnStore

The new node must be added to Enterprise ColumnStore using :

  • Add the node using the endpoint path

  • Use a , such as curl

  • Format the JSON output using jq for enhanced readability

  • Authenticate using the configured

For example, if the primary node's host name is mcs1 and the new node's IP address is 192.0.2.3:

  • In ES 10.5.10-7 and later:

  • In ES 10.5.9-6 and earlier:

Example output:

Checking Enterprise ColumnStore Status

To confirm that the node was properly added, the status of Enterprise ColumnStore should be checked using :

  • Check the status using the endpoint path

For example, if the primary node's host name is mcs1:

Example output:

Adding a Server to MaxScale

A server object for the new node must also be added to MaxScale using :

  • Use or another supported REST client

  • Add the server object using the create server command

  • As the first argument, provide a name for the server

  • As the second argument, provide the IP address for the node

For example:

Verifying the Server in MaxScale

To confirm that the server object was properly added, the server objects should be checked using :

  • Show the server objects using the show servers command

For example:

Linking to Monitor in MaxScale

The server object for the new node must be linked to the monitor using :

  • Link a server object to the monitor using the link monitor command

  • As the first argument, provide the name of the monitor

  • As the second argument, provide the name of the server

Checking the Monitor in MaxScale

To confirm that the server object was properly linked to the monitor, the monitor should be checked using :

  • Show the monitors using the show monitors command

For example:

Linking to Service in MaxScale

The server object for the new node must be linked to the service using :

  • Link the server object to the service using the link service command

  • As the first argument, provide the name of the service

  • As the second argument, provide the name of the server

Checking the Service in MaxScale

To confirm that the server object was properly linked to the service, the service should be checked using :

  • Show the services using the show services command

For example:

Checking the Replication Status with MaxScale

MaxScale is capable of checking the status of using :

  • List the servers using the list servers command

For example:

If the new node is properly replicating, then the State column will show Slave, Running.

Setting a Node to Maintenance Mode

To set a node to maintenance mode with Enterprise ColumnStore, perform the following procedure.

Setting the Server State in MaxScale

The server object for the node can be set to maintenance mode in MaxScale using :

  • Use or another supported REST client.

  • Set the server object to maintenance mode using the set server command.

  • As the first argument, provide the name for the server.

  • As the second argument, provide maintenance as the state.

For example:

If the specified server is a primary server, then MaxScale will allow open transactions to complete before closing any connections.

If you would like MaxScale to immediately close all connections, the --force option can be provided as a third argument:

Confirming Maintenance Mode is Set with MaxScale

Confirm the state of the server object in MaxScale using :

  • List the servers using the list servers command, like this:

If the node is properly in maintenance mode, then the State column will show Maintenance as one of the states.

Performing Maintenance

Now that the server is in maintenance mode in MaxScale, you can perform your maintenance.

While the server is in maintenance mode:

  • MaxScale doesn't route traffic to the node.

  • MaxScale doesn't select the node to be primary during failover.

  • The node can be rebooted.

  • The node's services can be restarted.

Clear the Server State in MaxScale

Maintenance mode for the server object for the node can be cleared in MaxScale using :

  • Use or another supported REST client.

  • Clear the server object's state using the clear server command.

  • As the first argument, provide the name for the server.

  • As the second argument, provide maintenance

For example:

Confirming Maintenance Mode is Cleared with MaxScale

Confirm the state of the server object in MaxScale using :

  • List the servers using the list servers command, like this:

If the node is no longer in maintenance mode, the State column no longer shows Maintenance as one of the states.

View and Clear Table Locks

MariaDB Enterprise ColumnStore acquires table locks for some operations, and it provides utilities to view and clear those locks.

MariaDB Enterprise ColumnStore acquires table locks for some operations, such as:

  • DDL statements

  • DML statements

  • Bulk data loads

If an operation fails, the table lock does not always get released. If you try to access the table, you can see errors like the following:

To solve this problem, MariaDB Enterprise ColumnStore provides two utilities to view and clear the table locks:

  • cleartablelock

  • viewtablelock

Viewing Table Locks

The viewtablelock utility shows table locks currently held by MariaDB Enterprise ColumnStore:

To view all table locks:

To view table locks for a specific table, specify the database and table:

Clearing Table Locks

The cleartablelock utility clears table locks currently held by MariaDB Enterprise ColumnStore.

To clear a table lock, specify the lock ID shown by the viewtablelock utility:

Rejoining a Node

To rejoin a node with Enterprise ColumnStore, perform the following procedure.

Performing Rejoin in MaxScale

The node can be configured to rejoin in MaxScale using :

  • Use or another supported REST client.

Set the system variable to the GTID position:
  • Execute the statement to configure the new node to connect to the Primary Server at this position:

    The above statement configures the Replica Server to connect to a Primary Server located at 192.0.2.1 using the repl user account.

  • Start replication using the command:

    The above statement configures the new node to connect to the Primary Server to retrieve new binary log events and replicate them into the local database.

  • Include the required headers

  • CMAPI
    add-node
    supported REST client
    CMAPI
    status
    API key
    as the state.

    Call a module command using the call command command.

  • As the first argument, provide the name for the module, which is .

  • As the second argument, provide the module command, which is rejoin .

  • As the third argument, provide the name of the monitor.

  • As the fourth argument, provide the name of the server.

  • For example:

    Checking Replication Status with MaxScale

    MaxScale is capable of checking the status of using :

    • List the servers using the list servers command, like this:

    If the node properly rejoined, the State column of the node shows Slave, Running.

    maxctrl call command \
       mariadbmon \
       rejoin \
       mcs_monitor \
       mcs3
    ERROR 1815 (HY000): Internal error: CAL0009: Drop table failed due to IDB-2009: Unable to perform the drop table operation because cpimport with PID 16301 is currently holding the table lock for session -1.
    CHANGE MASTER TO
       MASTER_USER = "repl",
       MASTER_HOST = "192.0.2.1",
       MASTER_PASSWORD = "repl_passwd",
       MASTER_USE_GTID=slave_pos;
    START SLAVE;
    sudo mariadb-backup --backup \
          --user=mariabackup_user \
          --password=mariabackup_passwd \
          --target-dir=/data/backup/replica_backup
    sudo mariadb-backup --prepare \
          --target-dir=/data/backup/replica_backup
    sudo rsync -av /data/backup/replica_backup 192.0.2.3:/data/backup/
    sudo mariadb-backup --copy-back \
       --target-dir=/data/backup/replica_backup
    sudo chown -R mysql:mysql /var/lib/mysql
    sudo systemctl restart mariadb
    sudo systemctl enable mariadb
    sudo systemctl restart mariadb-columnstore
    sudo systemctl disable mariadb-columnstore
    sudo systemctl restart mariadb-columnstore-cmapi
    sudo systemctl enable mariadb-columnstore-cmapi
    cat xtrabackup_binlog_info
    mariadb-bin.000096 568 0-1-2001,1-2-5139
    sudo mariadb
    curl -k -s -X PUT https://mcs1:8640/cmapi/0.4.0/cluster/node \
       --header 'Content-Type:application/json' \
       --header 'x-api-key:93816fa66cc2d8c224e62275bd4f248234dd4947b68d4af2b29671dd7d5532dd' \
       --data '{"timeout":20, "node": "192.0.2.3"}' \
       | jq .
    curl -k -s -X PUT https://mcs1:8640/cmapi/0.4.0/cluster/add-node \
       --header 'Content-Type:application/json' \
       --header 'x-api-key:93816fa66cc2d8c224e62275bd4f248234dd4947b68d4af2b29671dd7d5532dd' \
       --data '{"timeout":20, "node": "192.0.2.3"}' \
       | jq .
    {
      "timestamp": "2020-10-28 00:39:14.672142",
      "node_id": "192.0.2.3"
    }
    curl -k -s https://mcs1:8640/cmapi/0.4.0/cluster/status \
       --header 'Content-Type:application/json' \
       --header 'x-api-key:93816fa66cc2d8c224e62275bd4f248234dd4947b68d4af2b29671dd7d5532dd' \
       | jq .
    {
      "timestamp": "2020-12-15 00:40:34.353574",
      "192.0.2.1": {
        "timestamp": "2020-12-15 00:40:34.362374",
        "uptime": 11467,
        "dbrm_mode": "master",
        "cluster_mode": "readwrite",
        "dbroots": [
          "1"
        ],
        "module_id": 1,
        "services": [
          {
            "name": "workernode",
            "pid": 19202
          },
          {
            "name": "controllernode",
            "pid": 19232
          },
          {
            "name": "PrimProc",
            "pid": 19254
          },
          {
            "name": "ExeMgr",
            "pid": 19292
          },
          {
            "name": "WriteEngine",
            "pid": 19316
          },
          {
            "name": "DMLProc",
            "pid": 19332
          },
          {
            "name": "DDLProc",
            "pid": 19366
          }
        ]
      },
      "192.0.2.2": {
        "timestamp": "2020-12-15 00:40:34.428554",
        "uptime": 11437,
        "dbrm_mode": "slave",
        "cluster_mode": "readonly",
        "dbroots": [
          "2"
        ],
        "module_id": 2,
        "services": [
          {
            "name": "workernode",
            "pid": 17789
          },
          {
            "name": "PrimProc",
            "pid": 17813
          },
          {
            "name": "ExeMgr",
            "pid": 17854
          },
          {
            "name": "WriteEngine",
            "pid": 17877
          }
        ]
      },
      "192.0.2.3": {
        "timestamp": "2020-12-15 00:40:34.428554",
        "uptime": 11437,
        "dbrm_mode": "slave",
        "cluster_mode": "readonly",
        "dbroots": [
          "2"
        ],
        "module_id": 2,
        "services": [
          {
            "name": "workernode",
            "pid": 17789
          },
          {
            "name": "PrimProc",
            "pid": 17813
          },
          {
            "name": "ExeMgr",
            "pid": 17854
          },
          {
            "name": "WriteEngine",
            "pid": 17877
          }
        ]
      },
      "num_nodes": 3
    }
    maxctrl create server \
       mcs3 \
       192.0.2.3
    maxctrl show servers
    maxctrl link monitor \
       mcs_monitor \
       mcs3
    maxctrl show monitors
    maxctrl link service \
       mcs_service \
       mcs3
    maxctrl show services
    maxctrl list servers
    SET GLOBAL gtid_slave_pos='0-1-2001,1-2-5139';
    maxctrl set server \
       mcs3 \
       maintenance
    maxctrl set server \
       mcs3 \
       maintenance \
       --force
    maxctrl list servers
    maxctrl clear server \
       mcs3 \
       maintenance
    maxctrl list servers
    maxctrl list servers
    viewtablelock
     There is 1 table lock
    
      Table                     LockID  Process   PID    Session   Txn  CreationTime               State    DBRoots
      hq_sales.invoices         1       cpimport  16301  BulkLoad  n/a  Wed April 7 14:20:42 2021  LOADING  1
    viewtablelock hq_sales invoices
     There is 1 table lock
    
      Table                     LockID  Process   PID    Session   Txn  CreationTime               State    DBRoots
      hq_sales.invoices         1       cpimport  16301  BulkLoad  n/a  Wed April 7 14:20:42 2021  LOADING  1
    cleartablelock 1

    Removing a Node

    To remove a node from Enterprise ColumnStore, perform the following procedure.

    Unlinking from Service in MaxScale

    The server object for the node must be unlinked from the service using :

    • Unlink the server object from the service using the unlink service command.

    • As the first argument, provide the name of the service.

    • As the second argument, provide the name of the server.

    Checking the Service in MaxScale

    To confirm that the server object was properly unlinked from the service, the service should be checked using :

    • Show the services using the show services command, like this:

    Unlinking from Monitor in MaxScale

    The server object for the node must be unlinked from the monitor using :

    • Unlink a server object from the monitor using the unlink monitor command.

    • As the first argument, provide the name of the monitor.

    • As the second argument, provide the name of the server.

    Checking the Monitor in MaxScale

    To confirm that the server object was properly unlinked from the monitor, the monitor should be checked using :

    • Show the monitors using the show monitors command, like this:

    Removing the Server from MaxScale

    The server object for the node must also be removed from MaxScale using :

    • Use or another supported REST client.

    • Remove the server object using the destroy server command.

    • As the first argument, provide the name for the server.

    For example:

    Checking the Server in MaxScale

    To confirm that the server object was properly removed, the server objects should be checked using :

    • Show the server objects using the show servers command, like this:

    Stopping the Enterprise ColumnStore Services

    The Enterprise Server. Enterprise ColumnStore, and CMAPI services can be stopped using the systemctl command.

    Perform the following procedure on the node:

    1. Stop the MariaDB Enterprise Server service:

    2. Stop the MariaDB Enterprise ColumnStore service:

    3. Stop the CMAPI service:

    Removing the Node from Enterprise ColumnStore

    The node must be removed from Enterprise ColumnStore using :

    • Remove the node using the endpoint path.

    • Use a , such as curl .

    • Format the JSON output using jq for enhanced readability.

    For example, if the primary node's host name is mcs1 and the IP address for the node to remove is 192.0.2.3:

    • In ES 10.5.10-7 and later:

    • In ES 10.5.9-6 and earlier:

    Example output:

    Checking the Enterprise ColumnStore Status

    To confirm that the node was properly removed, the status of Enterprise ColumnStore should be checked using :

    • Check the status using the endpoint path.

    For example, if the primary node's host name is mcs1:

    Example output:

    Authenticate using the configured
    .
  • Include the required headers.

  • CMAPI
    remove-node
    supported REST client
    CMAPI
    status
    API key
    maxctrl unlink service \
       mcs_service \
       mcs3
    maxctrl show services
    maxctrl unlink monitor \
       mcs_monitor \
       mcs3
    maxctrl show monitors
    maxctrl destroy server \
       mcs3
    maxctrl show servers
    sudo systemctl stop mariadb
    sudo systemctl stop mariadb-columnstore
    sudo systemctl stop mariadb-columnstore-cmapi
    curl -k -s -X DELETE https://mcs1:8640/cmapi/0.4.0/cluster/node \
       --header 'Content-Type:application/json' \
       --header 'x-api-key:93816fa66cc2d8c224e62275bd4f248234dd4947b68d4af2b29671dd7d5532dd' \
       --data '{"timeout":20, "node": "192.0.2.3"}' \
       | jq .
    curl -k -s -X PUT https://mcs1:8640/cmapi/0.4.0/cluster/remove-node \
       --header 'Content-Type:application/json' \
       --header 'x-api-key:93816fa66cc2d8c224e62275bd4f248234dd4947b68d4af2b29671dd7d5532dd' \
       --data '{"timeout":20, "node": "192.0.2.3"}' \
       | jq .
    {
      "timestamp": "2020-10-28 00:39:14.672142",
      "node_id": "192.0.2.3"
    }
    curl -k -s https://mcs1:8640/cmapi/0.4.0/cluster/status \
       --header 'Content-Type:application/json' \
       --header 'x-api-key:93816fa66cc2d8c224e62275bd4f248234dd4947b68d4af2b29671dd7d5532dd' \
       | jq .
    {
      "timestamp": "2020-12-15 00:40:34.353574",
      "192.0.2.1": {
        "timestamp": "2020-12-15 00:40:34.362374",
        "uptime": 11467,
        "dbrm_mode": "master",
        "cluster_mode": "readwrite",
        "dbroots": [
          "1"
        ],
        "module_id": 1,
        "services": [
          {
            "name": "workernode",
            "pid": 19202
          },
          {
            "name": "controllernode",
            "pid": 19232
          },
          {
            "name": "PrimProc",
            "pid": 19254
          },
          {
            "name": "ExeMgr",
            "pid": 19292
          },
          {
            "name": "WriteEngine",
            "pid": 19316
          },
          {
            "name": "DMLProc",
            "pid": 19332
          },
          {
            "name": "DDLProc",
            "pid": 19366
          }
        ]
      },
      "192.0.2.2": {
        "timestamp": "2020-12-15 00:40:34.428554",
        "uptime": 11437,
        "dbrm_mode": "slave",
        "cluster_mode": "readonly",
        "dbroots": [
          "2"
        ],
        "module_id": 2,
        "services": [
          {
            "name": "workernode",
            "pid": 17789
          },
          {
            "name": "PrimProc",
            "pid": 17813
          },
          {
            "name": "ExeMgr",
            "pid": 17854
          },
          {
            "name": "WriteEngine",
            "pid": 17877
          }
        ]
      },
      "num_nodes": 2
    }
    MaxScale's REST API
    MaxCtrl
    mariadbmon
    MaxScale's REST API
    MaxScale's REST API
    MaxCtrl
    MaxScale's REST API
    MaxScale's REST API
    MaxCtrl
    MaxScale's REST API
    MaxScale's REST API
    MaxCtrl
    MaxScale's REST API
    MaxScale's REST API
    MaxScale's REST API
    MaxScale's REST API
    MaxScale's REST API
    MaxScale's REST API
    MaxScale's REST API
    MaxCtrl
    mariadbmon
    MaxScale's REST API
    MaxScale's REST API
    MaxScale's REST API
    MaxScale's REST API
    MaxScale's REST API
    MaxScale's REST API
    MaxCtrl
    MaxScale's REST API
    MariaDB Replication
    Topologies
    MariaDB Backup
    MariaDB Backup
    MariaDB Backup
    MariaDB Client
    MariaDB Replication
    gtid_slave_pos
    CHANGE MASTER TO
    START SLAVE
    MariaDB Replication

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    This page is: Copyright © 2025 MariaDB. All rights reserved.