mode-set
This page is part of MariaDB's Documentation.
The parent of this page is: CMAPI for MariaDB Enterprise ColumnStore
Topics on this page:
Overview
Sets all ColumnStore nodes to read-only or read-write
See CMAPI for detail on REST API endpoint, required headers, and other available actions.
DETAILS
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 |
---|---|
| Maximum time in seconds to wait for completion of |
| Accepted values: |
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_
$ 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 .
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:
$ mcsReadOnly
To set the deployment's mode to read-write:
$ mcsReadWrite
These aliases use jq
produces human-readable output from the returned JSON response.