Skip to main content
Version: 4.0.0

Database

Database is the core component of an application, Sealos provides a database cluster deployment management tool, can help you quickly deploy database clusters. It supports MySQL, PostgreSQL, MongoDB, Redis, Kafka, and more. Currently the database supports the following features.

  • Elastic expansion
  • Support multi-version and multi-type databases
  • Database connection: one-click connection, external network access
  • Database connection: manual backup, automatic backup
  • Database monitoring: resource, status, and performance monitoring
  • Database migration: public network migration and file migration
  • Database high availability: Supports multiple database instances
  • Visual database management: Create, delete, update, pause, restart the database

Quick start

Take deploying a PostgreSQL database as an example to experience the convenience of a database.

Deployment and access in just 6 steps:

  1. Enter the Database application from the Sealos desktop:

start_1

  1. Click on the creation of a new cluster.:

start_2

  1. Select the corresponding database and parameters:

start_3

  1. Click on deployment:

start_4

  1. Enter DB to view details:

start_5

  1. Database details:

start_6

start_7

start_8

start_9

start_10

start_11

start_12

Database connection

One-click connection

  1. Enter database , click Connect:

connect_1

  1. Manipulate the database at the terminal:

connect_2

Extranet access

  1. Enter database , click Connect:

connect_3

  1. Confirm open database

connect_4

  1. Copy the database connection information:

connect_5

  1. Connect to the database in the Database Connection tool:

connect_6

connect_7

Database backup

Manual backup

  1. Enter the database backup page, click Backup:

backup_1

  1. Enter the backup information to start the backup:

backup_2

  1. Check Backup status:

backup_3

backup_4

Automatic backup

  1. Enter the database backup page, click Backup:

backup_5

  1. Enable automatic backup and enter backup information:

backup_6

Database migration

This section uses the MySQL database as an example to describe how to migrate a database.

Public network migration

Public network migration involves two databases: the source database and the target database. The source database is the data source for migration, and the target database is the data destination for migration. The following introduction demonstrates the local database as the source database.

  1. Enter the target database and connect to the target database:

migration_1

  1. Create the corresponding database in the terminal interface (skip this step if the corresponding database already exists):

migration_2

# Example of creating a database sql statement:
$ create database testmysql;
  1. Enter the public network migration page of the target database, click the Migrate button:

migration_3

  1. View migration configuration information:

migration_4

Copy the migration configuration information as follows:

# Example of an sql statement for setting configuration information:
$ set global binlog_format=ROW;
$ set binlog_row_image ='FULL';
  1. Set the configuration information in the source database (MySQL and Postgres require manual configuration information, Mongo does not require configuration):
# xample of an sql statement for setting configuration information:
$ set global binlog_format=ROW;
$ set binlog_row_image ='FULL';

migration_5

  1. Enter the target database, fill in the migration information of the source database, which tables to migrate, and fill in which database in the target database to migrate:

migration_6

If you need to continuously migrate data from the source database, enable continuous migration in the advanced configuration as follows:

migration_7

  1. View migration task information:

migration_8

  1. Enter the target database, connect to the target database, and check whether the migration data is complete:

migration_9

File migration

  1. Enter the target database and connect to the target database:

migration_10

  1. Create the corresponding database in the terminal interface (skip this step if the corresponding database already exists):
# Example of creating a database sql statement:
$ create database testmysql;

migration_11

  1. Upload the migration file, enter the database name, and start the migration:

migration_12

  1. File migrating, Wait for the migration result:

migration_13

migration_14

  1. Connect to the database to check whether the migrated data is complete:

migration_15