Skip to content

nats envs #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 86 additions & 32 deletions apps/docs/content/mariadb/how-to/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import data from '@site/static/data.json';
import UnorderedList from '@site/src/components/UnorderedList';
import ResourceTable from '/src/components/ResourceTable';

MariaDB is the open source relational database loved by developers all over the world. Created by MySQL’s original developers, MariaDB is compatible with MySQL and guaranteed to stay open source forever.

Zerops provides the MariaDB Community Server edition as a managed database service.
MariaDB is the open source relational database loved by developers all over the world. Created by MySQL's original developers, MariaDB is compatible with MySQL and guaranteed to stay open source forever.

## Create MariaDB using Zerops GUI

:::note
If you're migrating from another database system such as MySQL, please review the [migration information](#migrating-from-other-database-systems) section first, as some critical settings must be configured at creation time.
:::

First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new MariaDB service:

<Video
Expand Down Expand Up @@ -116,33 +118,6 @@ Vertical auto scaling has following default configuration:
}
}} />

<table className="w-full my-1.5">
<thead>
<tr>
<th className="w-fit"><strong>Resources Type</strong></th>
<th className="w-fit"><strong>Minimum resource</strong></th>
<th className="w-fit"><strong>Maximum resource</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td className="w-fit"><strong>CPU cores</strong></td>
<td className="w-fit">1</td>
<td className="w-fit">5</td>
</tr>
<tr>
<td className="w-fit"><strong>RAM</strong></td>
<td className="w-fit">0.5 GB</td>
<td className="w-fit">32 GB</td>
</tr>
<tr>
<td className="w-fit"><strong>Disk</strong></td>
<td className="w-fit">1 GB</td>
<td className="w-fit">100 GB</td>
</tr>
</tbody>
</table>

For most cases, the default parameters will work without issues. If you need to limit the cost of the MariaDB service, lower the maximal resources. Zerops will never scale above the selected maximums.

When you are experiencing problems with insufficient MariaDB performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
Expand All @@ -161,6 +136,10 @@ You can change the auto scaling parameters later.

## Create MariaDB using zCLI

:::note
If you're migrating from another database system such as MySQL, please review the [migration information](#migrating-from-other-database-systems) section first, as some critical settings must be configured at creation time.
:::

zCLI is the Zerops command-line tool. To create a new MariaDB service via the command-line, follow these steps:

1. [Install & setup zCLI](/references/cli)
Expand Down Expand Up @@ -227,6 +206,9 @@ services:
startCpuCoreCount: 3
minFreeRamGB: 0.5
minFreeRamPercent: 20
# optional: system variables configuration
envSecrets:
lower_case_table_names: "1"
- # second service hostname
hostname: mariadb2
# service type and version number in mariadb@{version} format
Expand All @@ -237,7 +219,7 @@ services:

The yaml file describes your future project infrastructure. The project will contain two MariaDB 10.4 services.

The hostname of the first service will be set to `mariadb1`. The [high availability](#highly-available) mode will be chosen and the custom [auto scaling configuration](/mariadb/how-to/scale) will be set.
The hostname of the first service will be set to `mariadb1`. The [high availability](#highly-available) mode will be chosen and the custom [auto scaling configuration](/mariadb/how-to/scale) will be set. The `lower_case_table_names` system variable will be set to "1".

The hostname of the second service will be set to `mariadb2`. The [single container](#single-container) mode will be chosen and the default [auto scaling configuration](/mariadb/how-to/scale) will be set.

Expand Down Expand Up @@ -360,6 +342,11 @@ At least one service in `services:` section is required. You can create a projec
<td className="w-fit">Set the minDisk or maxDisk in GB (float).</td>
<td className="w-fit"></td>
</tr>
<tr>
<td className="w-fit"><strong>envSecrets</strong></td>
<td className="w-fit">Defines [secret environment variables](/features/env-variables#2-secret-variables) for the service</td>
<td className="w-fit"></td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -415,9 +402,12 @@ services:
type: mariadb@10.4
# mode of operation "HA"/"NON_HA"
mode: NON_HA
# optional: system variables configuration
envSecrets:
lower_case_table_names: "1"
```

The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one MariaDB 10.4 service in the [single container mode](#single-container) with default [auto scaling](/mariadb/how-to/scale) configuration will be added to your project. Hostname of the new service will be set to `mariadb1`.
The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one MariaDB 10.4 service in the [single container mode](#single-container) with default [auto scaling](/mariadb/how-to/scale) configuration will be added to your project. Hostname of the new service will be set to `mariadb1`. The `lower_case_table_names` system variable will be set to "1".

The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.

Expand All @@ -436,3 +426,67 @@ Flags:
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.

Maximum size of the `import.yaml` file is 100 kB.

## Migrating from other database systems

### Configure system variables

When migrating to MariaDB on Zerops from other database systems, you may need to configure specific system variables to maintain compatibility with your existing applications.

#### Setting `lower_case_table_names` for MySQL compatibility

The `lower_case_table_names` system variable determines how MariaDB handles table name case sensitivity:

<table className="w-full my-1.5">
<thead>
<tr>
<th className="w-fit"><strong>Value</strong></th>
<th className="w-fit"><strong>Table Name Storage</strong></th>
<th className="w-fit"><strong>Comparison Behavior</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td className="w-fit"><strong>0</strong></td>
<td className="w-fit">Stored as specified (preserves case)</td>
<td className="w-fit">Case-sensitive</td>
</tr>
<tr>
<td className="w-fit"><strong>1</strong></td>
<td className="w-fit">Stored in lowercase</td>
<td className="w-fit">Case-insensitive</td>
</tr>
<tr>
<td className="w-fit"><strong>2</strong></td>
<td className="w-fit">Stored as specified (preserves case)</td>
<td className="w-fit">Case-insensitive</td>
</tr>
</tbody>
</table>

:::caution
This variable must be configured when the MariaDB instance is first created and cannot be changed afterward. This is a limitation of MariaDB itself, not specific to Zerops.
:::

When configuring this in Zerops:

- **Using GUI**: Set the `lower_case_table_names` parameter in the advanced options section when creating a new MariaDB service
- **Using YAML**: Include it in your service configuration under the `envSecrets` section (see examples in the [Create MariaDB using zCLI](#create-mariadb-using-zcli) section)

##### Migration considerations

If you're migrating from MySQL to MariaDB and your application relies on a specific table name case handling:

1. Determine the value used in your source MySQL installation
2. Configure the same value in your Zerops MariaDB configuration before initializing the database
3. For most migrations from MySQL 5.7, setting the value to "1" is recommended for compatibility

After deploying your MariaDB service, you can verify the settings with this SQL command:

```sql
SELECT @@lower_case_file_system, @@lower_case_table_names;
```

:::important
If you need to change this setting after the database has been initialized, you'll need to create a new MariaDB service with the correct configuration and migrate your data.
:::
79 changes: 58 additions & 21 deletions apps/docs/static/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16639,9 +16639,11 @@ zCLI commands are interactive, when you press enter after `zcli service start`,

# Mariadb > How To > Create

MariaDB is the open source relational database loved by developers all over the world. Created by MySQL’s original developers, MariaDB is compatible with MySQL and guaranteed to stay open source forever.
Zerops provides the MariaDB Community Server edition as a managed database service.
MariaDB is the open source relational database loved by developers all over the world. Created by MySQL's original developers, MariaDB is compatible with MySQL and guaranteed to stay open source forever.
## Create MariaDB using Zerops GUI
:::note
If you're migrating from another database system such as MySQL, please review the [migration information](#migrating-from-other-database-systems) section first, as some critical settings must be configured at creation time.
:::
First, set up a project in Zerops GUI. Then go to the project dashboard page and choose **Add new service** in the left menu in the **Services** block. Then add a new MariaDB service:

Parameter
Expand Down Expand Up @@ -16691,23 +16693,6 @@ See the [pricing](https://zerops.io/#pricing) for the difference between CPU mod
Choose the CPU mode when starting a new service or change it later. The CPU mode doesn't change automatically.
#### Vertical auto scaling
Vertical auto scaling has following default configuration:

Resources Type
Minimum resource
Maximum resource

CPU cores
1
5

RAM
0.5 GB
32 GB

Disk
1 GB
100 GB

For most cases, the default parameters will work without issues. If you need to limit the cost of the MariaDB service, lower the maximal resources. Zerops will never scale above the selected maximums.
When you are experiencing problems with insufficient MariaDB performance or capacity, increase the minimal resources. Zerops will never scale below the selected minimums.
:::tip
Expand All @@ -16720,6 +16705,9 @@ You can change the auto scaling parameters later.
[Learn more](/mariadb/how-to/scale) about MariaDB auto scaling.
:::
## Create MariaDB using zCLI
:::note
If you're migrating from another database system such as MySQL, please review the [migration information](#migrating-from-other-database-systems) section first, as some critical settings must be configured at creation time.
:::
zCLI is the Zerops command-line tool. To create a new MariaDB service via the command-line, follow these steps:
1. [Install & setup zCLI](/references/cli)
2. [Create a project description file](#create-a-project-description-file)
Expand Down Expand Up @@ -16776,6 +16764,9 @@ services:
startCpuCoreCount: 3
minFreeRamGB: 0.5
minFreeRamPercent: 20
# optional: system variables configuration
envSecrets:
lower_case_table_names: "1"
- # second service hostname
hostname: mariadb2
# service type and version number in mariadb@{version} format
Expand All @@ -16784,7 +16775,7 @@ services:
mode: NON_HA
```
The yaml file describes your future project infrastructure. The project will contain two MariaDB 10.4 services.
The hostname of the first service will be set to `mariadb1`. The [high availability](#highly-available) mode will be chosen and the custom [auto scaling configuration](/mariadb/how-to/scale) will be set.
The hostname of the first service will be set to `mariadb1`. The [high availability](#highly-available) mode will be chosen and the custom [auto scaling configuration](/mariadb/how-to/scale) will be set. The `lower_case_table_names` system variable will be set to "1".
The hostname of the second service will be set to `mariadb2`. The [single container](#single-container) mode will be chosen and the default [auto scaling configuration](/mariadb/how-to/scale) will be set.
#### Description of description.yaml parameters
The `project:` section is required. Only one project can be defined.
Expand Down Expand Up @@ -16864,6 +16855,9 @@ At least one service in `services:` section is required. You can create a projec
- minDisk/maxDisk
Set the minDisk or maxDisk in GB (float).

envSecrets
Defines [secret environment variables](/features/env-variables#2-secret-variables) for the service

:::caution
The MariaDB service **hostname** and **mode** are fixed after the service is created. They can't be changed later.
:::
Expand Down Expand Up @@ -16896,8 +16890,11 @@ services:
type: mariadb@10.4
# mode of operation "HA"/"NON_HA"
mode: NON_HA
# optional: system variables configuration
envSecrets:
lower_case_table_names: "1"
```
The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one MariaDB 10.4 service in the [single container mode](#single-container) with default [auto scaling](/mariadb/how-to/scale) configuration will be added to your project. Hostname of the new service will be set to `mariadb1`.
The yaml file describes the list of one or more services that you want to add to your existing project. In the example above, one MariaDB 10.4 service in the [single container mode](#single-container) with default [auto scaling](/mariadb/how-to/scale) configuration will be added to your project. Hostname of the new service will be set to `mariadb1`. The `lower_case_table_names` system variable will be set to "1".
The content of the `services:` section of `import.yaml` is identical to the [project description file](#create-a-project-description-file). The `import.yaml` never contains the `project:` section because the project already exists.
When you have your `import.yaml` ready, use the `zcli project service-import` command to add one or more services to your existing Zerops project.
```sh
Expand All @@ -16910,6 +16907,46 @@ Flags:
```
zCLI commands are interactive, when you press enter after `zcli project service-import importYamlPath`, you will be given a list of your projects to choose from.
Maximum size of the `import.yaml` file is 100 kB.
## Migrating from other database systems
### Configure system variables
When migrating to MariaDB on Zerops from other database systems, you may need to configure specific system variables to maintain compatibility with your existing applications.
#### Setting `lower_case_table_names` for MySQL compatibility
The `lower_case_table_names` system variable determines how MariaDB handles table name case sensitivity:

Value
Table Name Storage
Comparison Behavior

0
Stored as specified (preserves case)
Case-sensitive

1
Stored in lowercase
Case-insensitive

2
Stored as specified (preserves case)
Case-insensitive

:::caution
This variable must be configured when the MariaDB instance is first created and cannot be changed afterward. This is a limitation of MariaDB itself, not specific to Zerops.
:::
When configuring this in Zerops:
- **Using GUI**: Set the `lower_case_table_names` parameter in the advanced options section when creating a new MariaDB service
- **Using YAML**: Include it in your service configuration under the `envSecrets` section (see examples in the [Create MariaDB using zCLI](#create-mariadb-using-zcli) section)
##### Migration considerations
If you're migrating from MySQL to MariaDB and your application relies on a specific table name case handling:
1. Determine the value used in your source MySQL installation
2. Configure the same value in your Zerops MariaDB configuration before initializing the database
3. For most migrations from MySQL 5.7, setting the value to "1" is recommended for compatibility
After deploying your MariaDB service, you can verify the settings with this SQL command:
```sql
SELECT @@lower_case_file_system, @@lower_case_table_names;
```
:::important
If you need to change this setting after the database has been initialized, you'll need to create a new MariaDB service with the correct configuration and migrate your data.
:::

----------------------------------------

Expand Down
Loading