All pages
Powered by GitBook
1 of 7

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

node PUT

Adds a ColumnStore node.

See CMAPI for detail on REST API endpoint, required headers, and other available actions.

Description

Upon successful node PUT call CMAPI configures MariaDB Enterprise ColumnStore to add the new node and a dbroot for that node.

Call made via HTTPS PUT, with authentication via shared secret using the x-api-key header.

JSON data required for this call:

Key
Value

Examples

Executing cURL Manually

CMAPI calls can be made from the command-line using cURL.

Replace the CMAPI_API_KEY and sample data in the following example:

In this example, jq produces human-readable output from the returned JSON response:

shutdown

Shuts down ColumnStore on all nodes

See for detail on REST API endpoint, required headers, and other available actions.

Description

Upon successful shutdown call CMAPI connects to each MariaDB Enterprise ColumnStore node and performs shut down.

Call made via HTTPS PUT, with authentication via shared secret using the x-api-key header.

JSON data required for this call:

Key
Value

timeout

Maximum time in seconds to wait for completion of add-node operation

Bash alias mcsShutdown is available starting with Enterprise ColumnStore 5.5.2.

Examples

Executing cURL Manually

CMAPI calls can be made from the command-line using cURL.

Replace the CMAPI_API_KEY and sample data in the following example:

In this example, jq produces human-readable output from the returned JSON response.

Executing the Bash Alias

Starting with Enterprise ColumnStore 5.5.2, if your bash shell is configured to source the columnstoreAlias shell script, this command can be executed using the mcsShutdown alias. The alias executes curl and jq, so both programs must be installed on the system.

The alias automatically retrieves the IP address for the primary node using the mcsGetConfig command. The alias automatically retrieves the API key by reading /etc/columnstore/cmapi_server.conf.

These aliases use jq produces human-readable output from the returned JSON response.

CMAPI

timeout

Maximum time in seconds to wait for completion of add-node operation

node

IP address of the node to add

curl -k -s -X PUT https://mcs1:8640/cmapi/0.4.0/cluster/shutdown \
   --header 'Content-Type:application/json' \
   --header 'x-api-key:<CMAPI_API_KEY>' \
   --data '{"timeout":20}' \
   | jq .
mcsShutdown
curl -k -s -X PUT https://mcs1:8640/cmapi/0.4.0/cluster/node \
   --header 'Content-Type:application/json' \
   --header 'x-api-key:<CMAPI_API_KEY>' \
   --data '{"timeout": 20, "node": "192.0.2.2"}' \
   | jq .
{
  "timestamp": "2020-10-28 00:42:42.796050",
  "node_id": "192.0.2.2"
}

mode-set

Sets all ColumnStore nodes to read-only or read-write.

See CMAPI for detail on REST API endpoint, required headers, and other available actions.

Description

Upon successful mode-set call CMAPI re-configures MariaDB Enterprise ColumnStore to the designated mode, either read-only or read/write operation.

Call made via HTTPS PUT, with authentication via shared secret using the x-api-key header.

JSON data required for this call:

Key
Value

Bash aliases mcsReadOnly and mcsReadWrite are available starting with Enterprise ColumnStore 5.5.2.

Examples

Executing cURL Manually

CMAPI calls can be made from the command-line using cURL.

Replace the CMAPI_API_KEY and sample data in the following example:

In this example, jq produces human-readable output from the returned JSON response.

Executing the Bash Aliases

Starting with Enterprise ColumnStore 5.5.2, if your bash shell is configured to source the columnstoreAlias shell script, this command can be executed using the mcsReadOnly and mcsReadWrite aliases. The alias executes curl and jq, so both programs must be installed on the system.

The aliases automatically retrieve the IP address for the primary node using the mcsGetConfig command. The aliases automatically retrieve the API key by reading /etc/columnstore/cmapi_server.conf.

To set the deployment's mode to read-only:

To set the deployment's mode to read-write:

These aliases use jq produces human-readable output from the returned JSON response.

node DELETE

Removes a ColumnStore node.

See for detail on REST API endpoint, required headers, and other available actions.

Description

Upon successful node DELETE call CMAPI configures MariaDB Enterprise ColumnStore to remove the specified node.

Call made via HTTPS DELETE, with authentication via shared secret using the x-api-key header.

start

Starts ColumnStore on all nodes.

See for detail on REST API endpoint, required headers, and other available actions.

Description

Upon successful start call CMAPI connects to each MariaDB Enterprise ColumnStore node and performs start-up.

Call made via HTTPS PUT, with authentication via shared secret using the x-api-key header.

JSON data required for this call:

Key
Value

timeout

Maximum time in seconds to wait for completion of add-node operation

node

IP address of the node to remove

Examples

Executing cURL Manually

CMAPI calls can be made from the command-line using cURL.

Replace the CMAPI_API_KEY and sample data in the following example:

In this example, jq produces human-readable output from the returned JSON response:

CMAPI

JSON data required for this call:

Key
Value

timeout

Maximum time in seconds to wait for completion of add-node operation

Bash alias mcsStart is available starting with Enterprise ColumnStore 5.5.2.

Examples

Executing cURL Manually

CMAPI calls can be made from the command-line using cURL.

Replace the CMAPI_API_KEY and sample data in the following example:

The command returns a JSON payload. Piping it to jq makes the output more human-readable.

Executing the Bash Alias

Starting with Enterprise ColumnStore 5.5.2, if your bash shell is configured to source the columnstoreAlias shell script, this command can be executed using the mcsStart alias. The alias executes curl and jq, so both programs must be installed on the system.

The alias automatically retrieves the IP address for the primary node using the mcsGetConfig command. The alias automatically retrieves the API key by reading /etc/columnstore/cmapi_server.conf.

These aliases use jq produces human-readable output from the returned JSON response.

CMAPI

timeout

Maximum time in seconds to wait for completion of mode-set operation

mode

Accepted values: readonly for read-only, readwrite for read/write.

curl -k -s -X DELETE https://mcs1:8640/cmapi/0.4.0/cluster/node \
   --header 'Content-Type:application/json' \
   --header 'x-api-key:<CMAPI_API_KEY>' \
   --data '{"timeout": 20, "node": "192.0.2.2"}' \
   | jq .
{
  "timestamp": "2020-10-28 00:42:42.796050",
  "node_id": "192.0.2.2"
}
curl -k -s -X PUT https://mcs1:8640/cmapi/0.4.0/cluster/start \
   --header 'Content-Type:application/json' \
   --header 'x-api-key:<CMAPI_API_KEY>' \
   --data '{"timeout":20}' \
   | jq .
mcsStart
curl -k -s -X PUT https://mcs1:8640/cmapi/0.4.0/cluster/mode-set \
   --header 'Content-Type:application/json' \
   --header 'x-api-key:<CMAPI_API_KEY>' \
   --data '{"timeout": 20, "mode": "readwrite"}' \
   | jq .
mcsReadOnly
mcsReadWrite

status

Checks the status of ColumnStore.

See CMAPI for detail on REST API endpoint, required headers, and other available actions.

Description

Upon successful status call CMAPI returns JSON payload containing detailed information on MariaDB Enterprise Cluster status.

Call made via HTTPS GET, with authentication via shared secret using the x-api-key header.

Bash alias mcsStatus is available starting with Enterprise ColumnStore 5.5.2.

Examples

Executing cURL Manually

CMAPI calls can be made from the command-line using cURL.

Replace the CMAPI_API_KEY and sample data in the following example:

In this example, jq produces human-readable output from the returned JSON response:

Executing the Bash Alias

Starting with Enterprise ColumnStore 5.5.2, if your bash shell is configured to source the columnstoreAlias shell script, this command can be executed using the mcsStatus alias. The alias executes curl and jq, so both programs must be installed on the system.

The alias automatically retrieves the IP address for the primary node using the mcsGetConfig command. The alias automatically retrieves the API key by reading /etc/columnstore/cmapi_server.conf.

In this example, jq produces human-readable output from the returned JSON response.

CMAPI

CMAPI is a REST API for administering MariaDB Enterprise ColumnStore in multi-node topologies.

Reference material is available for MariaDB Enterprise ColumnStore.

MariaDB Enterprise ColumnStore is included with MariaDB Enterprise Server.

Clients

CMAPI is a REST API, so it should be compatible with most standard REST clients.

CMAPI examples throughout the documentation use curl as the REST client. The examples also pipe the JSON output to jq for enhanced readability.

Endpoint

The endpoint for CMAPI contains the hostname and port for the primary node running Enterprise ColumnStore, /cmapi/, the CMAPI API version (0.4.0), and a action-specific endpoint path.

Example: https://mcs1:8640/cmapi/0.4.0/cluster/node

Endpoint Paths

Endpoint Path
Method
Action

Method and required data vary by CMAPI endpoint path.

Required Headers

Header
Description

Authentication

Authentication is performed via an API key, which performs the role of a shared secret. The API key is passed to the API using the x-api-key header.

The API key is stored in /etc/columnstore/cmapi_server.conf.

Generate an API Key

The API key is a shared secret that can be used to add nodes to multi-node Enterprise ColumnStore. The API key can be any string, but it is recommended to use a long, random string. The API key should be stored securely and kept confidential.

For example, to create a random 256-bit API key using openssl rand:

Set the API Key

To set the API key for the first time, provide the desired API key when you add the first node using the PUT command. Since Enterprise ColumnStore does not yet have an API key, CMAPI will write the first API key it receives to /etc/columnstore/cmapi_server.conf.

For example, if the primary server's host name is mcs1 and its IP address is 192.0.2.1, the following command will add the primary server to Enterprise ColumnStore and write the provided API key to the node's CMAPI configuration file:

Change the API Key

To change the API key in multi-node Enterprise ColumnStore, change it in the CMAPI configuration file on each node located at /etc/columnstore/cmapi_server.conf. The CMAPI server must be restarted on each node for the changes to be applied.

Restart the CMAPI server by running the following command on each node:

Bash Aliases

Bash aliases are available starting with Enterprise ColumnStore 5.5.2.

These aliases are available if your bash shell is configured to source the columnstoreAlias shell script.

These aliases execute curl and jq, so both programs must be installed on the system.

These aliases automatically retrieve the IP address for the primary node using the command. The aliases automatically retrieve the API key by reading /etc/columnstore/cmapi_server.conf.

Available aliases:

Alias
Endpoint
Action

CMAPI Service Management

The systemctl command is used to start and stop the CMAPI service.

Operation
Command

Configuration

The CMAPI configuration file is located at /etc/columnstore/cmapi_server.conf.

To change the configuration:

  • Modify the configuration file on each node

  • Restart the CMAPI server on each node:

Configure Failover

Starting with CMAPI 6.4.1, the auto_failover option can be set to True or False in the [application] section:

  • The default value of the auto_failover option is True.

  • The auto_failover option should be set to False when is used.

Logging

Starting with Enterprise ColumnStore 5.5.2, the can be found at /var/log/mariadb/columnstore/cmapi_server.log.

In previous versions, CMAPI's log messages can be viewed in the systemd journal:

CMAPI Responses

CMAPI responds to client requests with standard HTTP response messages.

Status Line

The first part of the standard HTTP response message is the status line. To determine if your request was successful, check the status code and the reason phrase from the status line.

Consult the to see the full list of status codes and their descriptions.

Headers

The second part of the standard HTTP response message is the HTTP headers. To determine what kind of message body is in the response message, check the Content-Type header field.

Body

The final part of the standard HTTP response message is the body.

PUT

Starts ColumnStore on all nodes

GET

Checks the status of ColumnStore

mcsStatus

Checks the status of ColumnStore

View systemd journal

journalctl -u mariadb-columnstore-cmapi

Varies

Server-side error Contact support

mode-set

PUT

Sets all ColumnStore nodes to read-only or read-write

node

DELETE

Removes a ColumnStore node

node

PUT

Adds a ColumnStore node

shutdown

PUT

Shuts down ColumnStore on all nodes

Content-Type

Set to application/json

x-api-key

Set to the API key configured for CMAPI. Calls using the incorrect keys are rejected.

mcsReadOnly

mode-set

Sets all ColumnStore nodes to read-only

mcsReadWrite

mode-set

Sets all ColumnStore nodes to read/write

mcsShutdown

shutdown

Shuts down ColumnStore on all nodes

mcsStart

start

Starts ColumnStore on all nodes

Status

systemctl status mariadb-columnstore-cmapi

Start

systemctl start mariadb-columnstore-cmapi

Stop

systemctl stop mariadb-columnstore-cmapi

Restart

systemctl restart mariadb-columnstore-cmapi

Enable startup

systemctl enable mariadb-columnstore-cmapi

Disable startup

systemctl disable mariadb-columnstore-cmapi

Status Code

Reason Phrase

Outcome

200

OK

Successful

200 < x < 300

Varies

Possibly successful

300 <= x < 400

Varies

Request redirected

400 <= x < 500

Varies

Client-side error Check endpoint, API key, and JSON data

Outcome

Content-Type

Success

application/json

Failure

Undefined Depends on specific failure

Outcome

Body

Success

JSON Data

Failure

Undefined Depends on specific failure

node
mcsGetConfig
non-shared local storage
CMAPI logs
HTTP standard

500 <= x < 600

openssl rand -hex 32
93816fa66cc2d8c224e62275bd4f248234dd4947b68d4af2b29671dd7d5532dd
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":120, "node": "192.0.2.1"}' \
   | jq .
sudo systemctl restart mariadb-columnstore-cmapi
sudo systemctl restart mariadb-columnstore-cmapi
[application]
auto_failover = False
sudo journalctl -u mariadb-columnstore-cmapi
curl -k -s https://mcs1:8640/cmapi/0.4.0/cluster/status \
   --header 'Content-Type:application/json' \
   --header 'x-api-key:<CMAPI_API_KEY>' \
   | 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
}
mcsStatus
start
status
status

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.

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