Skip to content

Commit

Permalink
Merge pull request #87 from nixys/feat/77
Browse files Browse the repository at this point in the history
feat(#77): Add MariaDB-backup support
  • Loading branch information
randreev1321 committed Sep 11, 2024
2 parents 1bb722e + 2c63dbf commit 63996a2
Show file tree
Hide file tree
Showing 31 changed files with 116 additions and 849 deletions.
2 changes: 1 addition & 1 deletion .descriptions/nxs-backup-bin.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Supported tags and respective `Dockerfile` links

- [`3.10.0`, `3.10`, `3`, `latest`,](https://github.com/nixys/nxs-backup/blob/main/.docker/Dockerfile-bin)
- [`3.11.0`, `3.11`, `3`, `latest`,](https://github.com/nixys/nxs-backup/blob/main/.docker/Dockerfile-bin)

# What is nxs-backup?

Expand Down
8 changes: 4 additions & 4 deletions .descriptions/nxs-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

# Supported tags and respective `Dockerfile` links

- [`3.10.0`, `3.10`, `3`, `latest`, `3.10.0-debian`, `3.10-debian`, `3-debian`, `debian`](https://github.com/nixys/nxs-backup/blob/main/.docker/Dockerfile-debian)
- [`3.10.0-alpine`, `3.10-alpine`, `3-alpine`, `apline`](https://github.com/nixys/nxs-backup/blob/main/.docker/Dockerfile-alpine)
- [`3.11.0`, `3.11`, `3`, `latest`, `3.11.0-debian`, `3.11-debian`, `3-debian`, `debian`](https://github.com/nixys/nxs-backup/blob/main/.docker/Dockerfile-debian)
- [`3.11.0-alpine`, `3.11-alpine`, `3-alpine`, `apline`](https://github.com/nixys/nxs-backup/blob/main/.docker/Dockerfile-alpine)

# What is nxs-backup?

Expand All @@ -44,7 +44,7 @@ Do the following steps:
```sh
cd nxs-backup/.deploy/docker-compose/
```
- Update provided `nxs-backup.conf` file with your parameters (see [Settings](https://github.com/nixys/nxs-backup/blob/main/docs/settings/README.md) for details)
- Update provided `nxs-backup.conf` file with your parameters (see [docs](https://nxs-backup.io/documentation/stable/3-1-preparing-of-the-main-config/) for details)
- Launch the nxs-backup with command:
```sh
docker compose up -d --pull
Expand All @@ -63,7 +63,7 @@ Do the following steps:
helm repo add nixys https://registry.nixys.io/chartrepo/public
```
- Find examples of `helm values` [here](https://github.com/nixys/nxs-backup/blob/main/docs/example/kubernetes/README.md)
- Fill up your `values.yaml` with correct nxs-backup [Settings](https://github.com/nixys/nxs-backup/blob/main/docs/settings/README.md)
- Fill up your `values.yaml` with correct nxs-backup [configs](https://nxs-backup.io/documentation/stable/3-1-preparing-of-the-main-config/)
- Launch nxs-backup with command:
```sh
helm -n $NAMESPACE_SERVICE_NAME install nxs-backup nixys/nxs-universal-chart -f values.yaml
Expand Down
5 changes: 4 additions & 1 deletion .docker/Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ FROM nixyslab/nxs-backup-bin AS bin

FROM alpine:3

RUN apk update --no-cache && apk add --no-cache tar mysql-client postgresql-client mongodb-tools redis
RUN apk update --no-cache && apk add --no-cache tar mysql-client mariadb-backup postgresql-client mongodb-tools redis
COPY --from=bin /nxs-backup /usr/local/bin/nxs-backup

VOLUME /etc/nxs-backup
VOLUME /var/nxs-backup

CMD nxs-backup start
4 changes: 4 additions & 0 deletions .docker/Dockerfile-debian
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN apt update \
wget \
gnupg \
default-mysql-client \
mariadb-backup \
postgresql-client \
redis

Expand All @@ -31,4 +32,7 @@ RUN apt update \

COPY --from=bin /nxs-backup /usr/local/bin/nxs-backup

VOLUME /etc/nxs-backup
VOLUME /var/nxs-backup

CMD nxs-backup start
10 changes: 10 additions & 0 deletions .docker/mariadb/Dockerfile-mariadb10
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM nixyslab/nxs-backup-bin AS bin

FROM mariadb:10

COPY --from=bin /nxs-backup /usr/local/bin/nxs-backup

VOLUME /etc/nxs-backup
VOLUME /var/nxs-backup

CMD nxs-backup start
16 changes: 0 additions & 16 deletions .docker/mariadb/Dockerfile-mariadb10_10

This file was deleted.

16 changes: 0 additions & 16 deletions .docker/mariadb/Dockerfile-mariadb10_11

This file was deleted.

16 changes: 0 additions & 16 deletions .docker/mariadb/Dockerfile-mariadb10_5

This file was deleted.

16 changes: 0 additions & 16 deletions .docker/mariadb/Dockerfile-mariadb10_6

This file was deleted.

16 changes: 0 additions & 16 deletions .docker/mariadb/Dockerfile-mariadb10_9

This file was deleted.

10 changes: 10 additions & 0 deletions .docker/mariadb/Dockerfile-mariadb11
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM nixyslab/nxs-backup-bin AS bin

FROM mariadb:11

COPY --from=bin /nxs-backup /usr/local/bin/nxs-backup

VOLUME /etc/nxs-backup
VOLUME /var/nxs-backup

CMD nxs-backup start
16 changes: 0 additions & 16 deletions .docker/mariadb/Dockerfile-mariadb11_0

This file was deleted.

16 changes: 0 additions & 16 deletions .docker/mariadb/Dockerfile-mariadb11_1

This file was deleted.

16 changes: 0 additions & 16 deletions .docker/mariadb/Dockerfile-mariadb11_2

This file was deleted.

31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ GNU/Linux distributions.
- Discrete files backups
- Incremental files backups
- Database backups:
- Regular backups of MySQL/Mariadb/Percona (5.7/8.0/_all versions_)
- Xtrabackup (2.4/8.0) of MySQL/Percona (5.7/8.0/all versions)
- Regular backups of PostgreSQL (9/10/11/12/13/14/15/16/_all versions_)
- Basebackups of PostgreSQL (9/10/11/12/13/14/15/_all versions_)
- Backups of MongoDB (3.0/3.2/3.4/3.6/4.0/4.2/4.4/5.0/6.0/7.0/_all versions_)
- Logical backups of MySQL/Percona (5.7/8.0/_all versions_)
- Logical backups of MariaDB (10/11/_all versions_)
- Physical backups by Xtrabackup (2.4/8.0) of MySQL/Percona (5.7/8.0/_all versions_)
- Physical backups by MariaDB-backup of MariaDB (10/11/_all versions_)
- Logical backups of PostgreSQL (9/10/11/12/13/14/15/16/_all versions_)
- Physical backups by Basebackups of PostgreSQL (9/10/11/12/13/14/15/16/_all versions_)
- Backups of MongoDB (4.0/4.2/4.4/5.0/6.0/7.0/_all versions_)
- Backups of Redis (_all versions_)
- Support of user-defined scripts that extend functionality
- Upload and manage backups to the remote storages:
Expand All @@ -32,10 +34,11 @@ GNU/Linux distributions.
- WebDAV
- Fine-tune the database backup process with additional options for optimization purposes
- Notifications about events of the backup process via email and webhooks
- Built-in generator of the configuration files to expedite initial setup
- Easy to read and maintain configuration files with clear transparent structure
- Possibility to restore backups by standard file/database tools (nxs-backup is not required)
- Support of Environment variables in configuration files
- Collect, export, and save metrics in Prometheus-compatible format
- Limiting resource consumption:
- CPU usage
- local disk rate
- remote storage rate

### Who can use the tool?

Expand Down Expand Up @@ -65,14 +68,14 @@ GNU/Linux distributions.
sudo chown root:root /usr/sbin/nxs-backup
```
> [!NOTE]
> nxs-backup is built for the following processor architectures: amd64 (x86_64), arm (armv7/armv8), arm64 (aarch64).
> nxs-backup is built for the following processor architectures: amd64 (x86_64), arm (armv8), arm64 (aarch64).
> If you need specific version of nxs-backup, or different architecture, you can find it on [release page](https://github.com/nixys/nxs-backup/releases).
- Check that installation successful:
```sh
sudo nxs-backup --version
```
- Generate configuration files like described [here](docs/USEFUL_INFO.md#generate-configuration-files) or update
provided `nxs-backup.conf` and jobs configs in `cond.d` dir with your parameters (see [Settings](/docs/settings/README.md) for details)
- Generate configuration files like described [here](https://nxs-backup.io/documentation/stable/2-3-1-on-premise/) or update
provided `nxs-backup.conf` and jobs configs in `cond.d` dir with your parameters (see [docs](https://nxs-backup.io/documentation/stable/3-1-preparing-of-the-main-config/) for details)
- For starting nxs-backup process run:
```sh
sudo nxs-backup start
Expand All @@ -84,7 +87,7 @@ GNU/Linux distributions.
```sh
cd nxs-backup/.deploy/docker-compose/
```
- Update provided `nxs-backup.conf` file with your parameters (see [Settings](/docs/settings/README.md) for details)
- Update provided `nxs-backup.conf` file with your parameters (see [docs](https://nxs-backup.io/documentation/stable/3-1-preparing-of-the-main-config/) for details)
- Launch the nxs-backup with command:
```sh
docker compose up -d --pull
Expand All @@ -101,7 +104,7 @@ GNU/Linux distributions.
helm repo add nixys https://registry.nixys.io/chartrepo/public
```
- Find examples of `helm values` [here](/docs/example/kubernetes/README.md)
- Fill up your `values.yaml` with correct nxs-backup [Settings](/docs/settings/README.md)
- Fill up your `values.yaml` with correct nxs-backup [configs](https://nxs-backup.io/documentation/stable/3-1-preparing-of-the-main-config/)
- Launch nxs-backup with command:
```sh
helm -n $NAMESPACE_SERVICE_NAME install nxs-backup nixys/nxs-universal-chart -f values.yaml
Expand Down
6 changes: 1 addition & 5 deletions ctx/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func appInit(c *Ctx, cfgPath string) (app, error) {
switch job.GetType() {
case "desc_files", "inc_files":
a.fileJobs = append(a.fileJobs, job)
case "mysql", "mysql_xtrabackup", "postgresql", "postgresql_basebackup", "mongodb", "redis":
case "mysql", "mysql_xtrabackup", "mariadb_backup", "postgresql", "postgresql_basebackup", "mongodb", "redis":
a.dbJobs = append(a.dbJobs, job)
case "external":
a.extJobs = append(a.extJobs, job)
Expand Down Expand Up @@ -302,7 +302,3 @@ func getRateLimit(limit *string) (rl int64, err error) {

return
}

func checkDeprecated(o ConfOpts) {

}
Loading

0 comments on commit 63996a2

Please sign in to comment.