ColumnStore Read Replicas

The ColumnStore Read Replica topology is an Alpha release. Do not use it in production without testing in your development environment first.

Overview

The Read Replicas feature in MariaDB ColumnStore enables horizontal scaling of read performance by incorporating read-only nodes into a multi-node cluster. These replicas differ from standard ColumnStore nodes, in that they don't run the WriteEngineServer process. This means Read Replica nodes cannot handle write operations directly — instead, any write queries attempted on a replica are automatically forwarded to a read-write (RW) node.

Replicas utilize shared storage with other nodes in the cluster, ensuring data consistency without duplication. A key requirement is maintaining at least one RW node — a cluster consisting solely of read replicas is not operational and cannot process reads or writes.

Key Features

  • Horizontal Read Scaling: Adds compute power for handling more read-intensive queries without impacting write performance.

  • Write Forwarding: Ensures writes on replicas are redirected to RW nodes, maintaining data integrity.

  • Shared Storage: Replicas access the same DBRoots as RW nodes, promoting efficiency and reducing storage overhead.

Key Commands

These commands require CMAPI.

  • Add Read Replica. To introduce a read-only node for scaling reads, run this command:

sudo mcs node add --read-replica --node <private-ip>
  • Remove Node. To safely remove any node (RW or replica) from the cluster, run this command:

sudo mcs node remove --node <private-ip>

This reassigns resources as needed without cluster disruption.

  • Verify Status. To monitor the cluster's health and node roles, issue:

sudo mcs cluster status

Limitations

  • Node addition is restricted to private IPs only.

  • Incompatible with S3 storage, limiting use to shared file systems.

  • No automatic failover or promotion mechanism if the sole RW node goes down, requiring manual recovery.

  • At least one RW node must always be present for the cluster to function properly, supporting both read and write operations.

How-To

Prerequisites

Ensure shared storage is mounted on all nodes (at /var/lib/columnstore/data1 for non-s3 configuration), to ensure data consistency across RW nodes and read replicas.

Refer to shared storage setup for exact mount points details.

Installation and Setup

1

Set Up MariaDB Repository

Run the following to add the MariaDB repository (adjust "11.4" to the latest stable version):

wget https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup ;
chmod +x mariadb_es_repo_setup;
./mariadb_es_repo_setup --token="xxxxx" --apply --mariadb-server-version="11.4"

See this page for additional details about the ES repo setup.

2

Install Packages

Run the following commands on all nodes.

For RPM-based systems, run this command:

sudo dnf install -y \
MariaDB-server MariaDB-columnstore-engine MariaDB-columnstore-cmapi

Refer to this blog post for additional information.

For DEB-based systems, run these commands:

sudo apt update
sudo apt install -y mariadb-server mariadb-plugin-columnstore mariadb-columnstore-cmapi
3

Start and Enable Services

sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo systemctl start mariadb-columnstore-cmapi
sudo systemctl enable mariadb-columnstore-cmapi
4

Configure the Initial RW Node

On the primary RW node, set up the cluster API key (use a secure API key):

sudo mcs cluster set api-key --key <your-api-key-here>
5

Add the Initial RW Node to the Cluster

Run this from the primary RW node:

sudo mcs node add --node <private-ip-of-rw-node>
6

Add Read Replica Nodes

From the primary RW node, add each read replica:

sudo mcs node add --read-replica --node <private-ip-of-replica>
7

Verify the Cluster

Check the status to ensure nodes are added and the cluster is healthy:

sudo mcs cluster status
8

Configure Replication Between Nodes

See this page for instructions on how to set up replication, and this page for instructions how to create user accounts and configure replication for multi-node local storage.

9

Configure MaxScale

See this page for instructions.

Last updated

Was this helpful?