Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alejandro-du/43fe2b65ce5f96fc1d9ca05694da9c7c to your computer and use it in GitHub Desktop.
Save alejandro-du/43fe2b65ce5f96fc1d9ca05694da9c7c to your computer and use it in GitHub Desktop.
MariaDB Server (with added ColumnStore) installation on Red Hat Enterprise Linux
# Set up the MariaDB repository for version 11.1 to ensure the system uses the correct version and receives updates from the official source.
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version=11.1
# Install the necessary MariaDB packages along with ColumnStore for fast and scalable analytics and CMAPI for managing ColumnStore nodes.
sudo dnf -y install MariaDB MariaDB-columnstore-engine MariaDB-columnstore-cmapi
# Automatically start MariaDB and its ColumnStore storage engine when the system boots, ensuring database availability after restarts.
sudo systemctl enable mariadb
sudo systemctl enable mariadb-columnstore-cmapi
# Start the MariaDB server and ColumnStore services, making the database operational immediately.
sudo systemctl start mariadb
sudo systemctl start mariadb-columnstore-cmapi
# Configure the ColumnStore API key for secure communication within the cluster.
sudo mcs cluster set api-key --key somekey123
# Add the local server as a node in the ColumnStore cluster, enabling it to participate in distributed data processing.
sudo mcs cluster node add --node 127.0.0.1
# Establish dedicated database users for cross-engine queries, enhancing security by isolating these operations.
CREATE USER 'cross_engine'@'127.0.0.1' IDENTIFIED BY 'Password123!';
CREATE USER 'cross_engine'@'localhost' IDENTIFIED BY 'Password123!';
# Grant the necessary permissions for cross-engine operations, limiting the scope to SELECT queries for security reasons.
GRANT SELECT ON *.* TO 'cross_engine'@'127.0.0.1';
GRANT SELECT ON *.* TO 'cross_engine'@'localhost';
# Configure cross-engine support in ColumnStore, specifying the database host, port, and credentials for external data access.
mcsSetConfig CrossEngineSupport Host 127.0.0.1
sudo mcsSetConfig CrossEngineSupport Port 3306
sudo mcsSetConfig CrossEngineSupport User cross_engine
sudo mcsSetConfig CrossEngineSupport Password Password123!
# Secure the MariaDB installation by setting a root password, removing anonymous users, and applying other security best practices.
sudo mariadb-secure-installation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment