> For the complete documentation index, see [llms.txt](https://asus-isg-aidc.gitbook.io/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asus-isg-aidc.gitbook.io/guide/latest/portal/overview/service-catalog/mariadb.md).

# MariaDB

| Developer | Last modified |
| --------- | ------------- |
| AIDC Team | 2026/08/21    |

## Service Introduction

**MariaDB Galera Cluster** is a synchronous multi-master replication cluster solution that provides high availability and data consistency. All nodes are master nodes, supporting simultaneous read and write operations.

![](https://pub-f334ff01208c4e6195b80133ac6e6030.r2.dev/portal/marketplace/service-catalog-mariadb.png)

### Quick Summary

| Item                          | Details                                          |
| ----------------------------- | ------------------------------------------------ |
| ⏱️ **Estimated Time**         | 10-20 minutes                                    |
| 💻 **Supported Platforms**    | See the **Supported Platforms Matrix**           |
| 🔧 **Minimum Nodes Required** | 3 nodes (odd number recommended)                 |
| 📦 **Included Components**    | MariaDB Server, Galera Replication Plugin, wsrep |

***

## Prerequisites

Before starting the deployment, ensure the following requirements are met:

### Hardware Requirements

| Role            | Minimum Spec                 | Recommended Spec              |
| --------------- | ---------------------------- | ----------------------------- |
| **Galera Node** | 2 vCPU / 4GB RAM / 50GB Disk | 4 vCPU / 8GB RAM / 200GB Disk |

### Network Requirements

* ✅ All nodes must be in the **same network segment** or have routing enabled
* ✅ Low latency network between nodes (< 10ms recommended)

### Other Requirements

* ✅ Nodes have been provisioned and are in **Ready** state

***

## Deployment Dialog Introduction

MariaDB Galera Cluster deployment is divided into **2 steps**:

```mermaid
flowchart LR
    Step1["Step 1: Node & Password Configuration"]
    Review["Step 2: Review and Deploy"]

    Step1 --> Review
```

[Step 1: Node & Password Configuration](#step-1-cluster-node-selection-and-password-configuration) | [Step 2: Review and Deploy](#step-2-review-and-deploy)

***

### Step 1: Cluster Node Selection and Password Configuration

![](https://pub-f334ff01208c4e6195b80133ac6e6030.r2.dev/portal/marketplace/service-catalog-mariadb-step1.png)

| Parameter Name           | Type   | Description                      |   Required  | Validation Rules                                   | Example           |
| ------------------------ | ------ | -------------------------------- | :---------: | -------------------------------------------------- | ----------------- |
| **MariaDB Galera Group** | string | Group for database cluster nodes | 🔴 Required | **Must contain 3+ nodes (odd number recommended)** | `mariadb-cluster` |
| **MariaDB Password**     | string | Database root password           | 🔴 Required | **At least 6 characters; use strong password**     | `MariaDB@2026!`   |

{% hint style="warning" %}
**⚠️ Important Security Note**

The password is used for the database root account. This account has full privileges and can be used to connect to the database after deployment. **Please keep it safe and do not share it.**
{% endhint %}

{% hint style="info" %}
**💡 Why odd number of nodes?**

Galera Cluster uses a Quorum mechanism. An **odd number of nodes** (3, 5, 7...) helps avoid Split Brain issues and ensures the cluster can make decisions when network partitions occur.
{% endhint %}

***

### Step 2: Review and Deploy

![](https://pub-f334ff01208c4e6195b80133ac6e6030.r2.dev/portal/marketplace/service-catalog-mariadb-step2.png)

***

## Post-Deployment Status

After successful deployment, you can view in **Status Monitor**:

* Task status progress
* Execution status of each node
* Error logs (if any)

### Deployment Verification

After the deployment status shows **Completed**, perform the following checks:

**1. Connect to Database**

```bash
mysql -h <node_ip> -u root -p
```

✅ **Expected Result:** Successfully connected to MariaDB

**2. Check Cluster Size**

```sql
SHOW STATUS LIKE 'wsrep_cluster_size';
```

✅ **Expected Result:** Value should match number of nodes (e.g., `3`)

**3. Check Cluster Status**

```sql
SHOW STATUS LIKE 'wsrep_cluster_status';
```

✅ **Expected Result:** `Primary`

**4. Check Node State**

```sql
SHOW STATUS LIKE 'wsrep_local_state_comment';
```

✅ **Expected Result:** `Synced`

**5. Full Cluster Health Check**

```sql
SHOW STATUS LIKE 'wsrep_%';
```

Key values to verify:

* `wsrep_ready` = `ON`
* `wsrep_connected` = `ON`
* `wsrep_cluster_status` = `Primary`

## Troubleshooting Checklist

| Check Item            | Command                                                    | Expected Result     |
| --------------------- | ---------------------------------------------------------- | ------------------- |
| MariaDB running?      | `systemctl status mariadb`                                 | Active (running)    |
| Cluster size correct? | `mysql -e "SHOW STATUS LIKE 'wsrep_cluster_size';"`        | Expected node count |
| Node synced?          | `mysql -e "SHOW STATUS LIKE 'wsrep_local_state_comment';"` | Synced              |
| Cluster ready?        | `mysql -e "SHOW STATUS LIKE 'wsrep_ready';"`               | ON                  |

***

## Frequently Asked Questions

### Q: Why is an odd number of nodes recommended?

A: Galera Cluster uses a Quorum mechanism. An odd number of nodes helps avoid Split Brain issues when network partitions occur.

### Q: How to add nodes after deployment?

A: Currently requires redeploying the cluster. Future versions will support dynamic scaling.

### Q: What if I lose the password?

A: You can view deployment details in Status Monitor, or contact the system administrator.

### Q: Can I connect to any node in the cluster?

A: Yes! All nodes are active and can handle read and write traffic, but write conflicts may occur due to synchronous replication.

### Q: What happens if one node fails?

A: The cluster continues to operate normally as long as a majority of nodes (quorum) are available.

***

## Related References

* [Service Catalog](/guide/latest/portal/overview/service-catalog.md)
* [Status Monitor User Guide](/guide/latest/portal/overview/status-monitor.md#mariadb-status-card)
* [MariaDB Galera Cluster Documentation](https://mariadb.com/kb/en/galera-cluster/)
