# Set Up a MariaDB Cluster

## Prerequisites

* Before setting up a database, ensure that you are working within a provisioned [<mark style="color:blue;">Virtual Data Center (VDC)</mark>](https://docs.ionos.com/cloud/support/general-information/glossary-of-terms#virtual-data-center-vdc) that contains at least one VM from which to access the database. The VM you create is counted against the quota allocated in your contract.
* Database Manager is available only for contract administrators, owners, and users with **Access and manage DBaaS** privileges. You can set the privilege through the DCD group privileges. For more information, see [<mark style="color:blue;">Manage User Access</mark>](/cloud/set-up-ionos-cloud/management/identity-access-management/user-management.md).

## Create a Cluster

To create a MariaDB cluster, follow these steps:

{% stepper %}
{% step %}

#### Navigate to the MariaDB Manager

1\. In the **DCD**, go to **Menu** > **Databases** > **MariaDB**.

Click **Create cluster** to create a new MariaDB cluster.
{% endstep %}

{% step %}

#### Define Cluster Properties

Specify the following cluster properties:

1. **Cluster Name:** Enter an appropriate name for your MariaDB cluster.
2. **Cluster Version:** Select a version of MariaDB from the drop-down list. <code class="expression">space.vars.ionos\_cloud</code> only supports *Long-Term Support (LTS) versions*, starting from MariaDB 10.6.
3. **Instances:** Enter the number of MariaDB nodes you want in the cluster. One MariaDB node always manages the data of exactly one database cluster. You can also use the arrows to increase or decrease the number of nodes. Replication is possible only when you define more than one node.

{% hint style="info" %}
**Note:** Here, you will have a **primary** node and one or more standby nodes that run a copy of the active database, so you have **n-1 standby** nodes in the cluster.
{% endhint %}

4. **Location:** Select a location of your preference from the drop-down list.
5. **Replication Type:** The replication type is **Asynchronous** by default for MariaDB. You will see this option only on selecting more than one node (instance). In an asynchronous mode, the primary MariaDB node does not wait for a replica to indicate that the data has been written. The cluster can lose some committed transactions to ensure availability.
6. **CPU Type:** The CPU type is set to **Dedicated Core**, by default.

![Define cluster properties](/files/JQVnT44kplaaAhlcNP9e)
{% endstep %}

{% step %}

#### Select the Required Number of Resources

Specify the number of resources to associate with the MariaDB cluster:

1. **Number of CPUs (per instance):** Increase or decrease the number of CPUs using the slider.
2. **RAM Size (per instance):** Increase or decrease the size of the RAM using the slider to suit your needs.
3. **Storage Type:** Currently, <code class="expression">space.vars.ionos\_cloud</code> supports only [<mark style="color:blue;">SSD Premium</mark>](https://docs.ionos.com/cloud/support/general-information/glossary-of-terms#solid-state-drive-ssd), which is selected by default.
4. **Storage Size:** Enter the storage size, in Gigabytes (GB), either manually or use the arrows to increase or decrease the storage size accordingly based on your needs.

![Associate the required number of resources](/files/I2aS23FeSx8rXnyjRuXd)
{% endstep %}

{% step %}

#### Connect the Data Center with the MariaDB Cluster

1. **Datacenter:** Select a data center from the drop-down list to associate it with the MariaDB cluster. The available data centers in the drop-down list vary according to the chosen **Location**. For more information, see [<mark style="color:blue;">Define cluster properties</mark>](#define-cluster-properties).
2. **Datacenter LAN:** Select a LAN from the drop-down list for the data center.
3. **IP/Subnet:** Enter the private IP or subnet using the available [<mark style="color:blue;">Private IPs</mark>](https://www.ionos.com/help/server-cloud-infrastructure/private-network/private-ip-address-ranges/).

{% hint style="info" %}
**Note:** To know your **private IP address/Subnet**, you must:

* Create a single server connected to an empty private LAN and check the IP assigned to the respective NIC in the selected LAN. The **DHCP** in that LAN always uses a **/24 subnet**, so you must reuse the **first 3 octets** to reach your database.
* To prevent a collision with the DHCP IP range, we recommend using IP addresses ending between **x.x.x.3/24** and **x.x.x.10/24** (which are never assigned by DHCP).
* If you have disabled DHCP on your private LAN, you must discover the IP address on your own.
  {% endhint %}

![Connect the data center to the MariaDB cluster](/files/qgPckmdjwGmkKbcUtVWk)
{% endstep %}

{% step %}

#### Schedule Maintenance (Optional)

Your chosen start time (UTC) plus four hours is the maintenance time.

1. **Day:** Select a day from the drop-down list to set a day for maintenance.
2. **Start Time (UTC):** Enter a time using the pre-defined format (hh:mm:ss) to schedule the maintenance task. You can also click the ![Clock icon](/files/qchgBuxKMLdDjQbH2Vom) icon to set a time.

{% hint style="info" %}
**Note:** We recommend choosing the day and time appropriately because the maintenance occurs in a **4-hour-long window**.
{% endhint %}

![Schedule maintenance](/files/XLM7CDXkzXRNh9muja2D)
{% endstep %}

{% step %}

#### Define Users

The credentials of any user who has previously been created in the backup will be overwritten.

1. **Username:** Enter a username to provide access to the MariaDB cluster for the respective user.
2. **Password:** Enter a password for the respective user.

![Define user](/files/zjAWXsngeowIDaQXQiyK)
{% endstep %}

{% step %}

#### Save the Cluster

Click **Save** to create the MariaDB cluster.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
**Result:** Your MariaDB Cluster is now created. The **STATE** is set to **CREATING** when the operation is in progress.
{% endhint %}

![MariaDB cluster is being created](/files/fzgFAzx6Bji2vNQsYEa0)

{% hint style="info" %}
**Note:** The **Estimated costs** will be displayed based on the input. It is exclusive and certain variables like traffic and backup are not considered.
{% endhint %}

![Estimated costs](/files/4yWsI82Jc28968go8nTx)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/databases/mariadb/dcd-how-tos/set-up-mariadb-cluster.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
