Adds a ColumnStore node.
See CMAPI for detail on REST API endpoint, required headers, and other available actions.
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:
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:
Shuts down ColumnStore on all nodes
See for detail on REST API endpoint, required headers, and other available actions.
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:
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.
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.
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.
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 .mcsShutdowncurl -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"
}Sets all ColumnStore nodes to read-only or read-write.
See CMAPI for detail on REST API endpoint, required headers, and other available actions.
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:
Bash aliases mcsReadOnly and mcsReadWrite are available starting with Enterprise ColumnStore 5.5.2.
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.
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.
Removes a ColumnStore node.
See for detail on REST API endpoint, required headers, and other available actions.
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.
Starts ColumnStore on all nodes.
See for detail on REST API endpoint, required headers, and other available actions.
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:
timeout
Maximum time in seconds to wait for completion of add-node operation
node
IP address of the node to remove
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:
JSON data required for this call:
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.
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.
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.
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 .mcsStartcurl -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 .mcsReadOnlymcsReadWriteChecks the status of ColumnStore.
See CMAPI for detail on REST API endpoint, required headers, and other available actions.
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.
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:
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 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.
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.
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
Method and required data vary by CMAPI endpoint path.
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.
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:
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:
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:
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:
The systemctl command is used to start and stop the CMAPI service.
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:
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.
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 responds to client requests with standard HTTP response messages.
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.
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.
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
PUT
Sets all ColumnStore nodes to read-only or read-write
DELETE
Removes a ColumnStore node
PUT
Adds a ColumnStore node
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
Sets all ColumnStore nodes to read-only
mcsReadWrite
Sets all ColumnStore nodes to read/write
mcsShutdown
Shuts down ColumnStore on all nodes
mcsStart
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
500 <= x < 600
openssl rand -hex 32
93816fa66cc2d8c224e62275bd4f248234dd4947b68d4af2b29671dd7d5532ddcurl -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-cmapisudo systemctl restart mariadb-columnstore-cmapi[application]
auto_failover = Falsesudo journalctl -u mariadb-columnstore-cmapicurl -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
}mcsStatusThis 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.