Skip to main content

Using External Meta Databases

NineData Community Edition supports storing metadata in enterprise-owned MySQL databases, achieving high availability and centralized metadata management.

Prerequisites

  • The version of NineData Community Edition must be at least 4.1.0. The current version number can be viewed by logging into the NineData Community Edition console, located at the top left corner of the page.

    version

  • The version of the enterprise-owned MySQL database should be 8.0 or above, and the account must have the permission to create databases (CREATE DATABASE). If this permission is not available, the following databases should be created in advance and the account should be granted all permissions on the database: meta, scheduler, slow_log, track_event, replication_exec, replication_metastore.

  • Ensure that the server where NineData Community Edition is deployed can access the external MySQL meta database instance.

This option allows NineData to automatically create meta databases without manual creation.

  1. Access the self-built MySQL meta database.

  2. Create a dedicated user for NineData.

    CREATE USER 'ninedata'@'%' IDENTIFIED BY '<Your-Password>';

  3. Grant global permissions.

    GRANT ALL ON *.* TO 'ninedata'@'%';
  4. Pass the following META_DB environment variable in the docker run command when deploying the NineData Community Edition service, in the format of -e META_DB=<database account>:<database password>@<database Host>:<database port number>. Example is as follows:

    docker run -p 9999:9999 --privileged -v /opt/ninedata:/u01 -e META_DB=ninedata:123456@127.0.0.1:3306 --name ninedata -d swr.cn-east-3.myhuaweicloud.com/ninedata/ninedata:4.1.0

Option Two: Manual Database Creation Mode

This option is suitable for scenarios where NineData cannot be granted database creation permissions, and the required databases must be pre-created manually, and the account must be granted full management permissions for these databases.

  1. Access the self-built MySQL meta database.

  2. Create all required meta databases.

    CREATE DATABASE meta;
    CREATE DATABASE scheduler;
    CREATE DATABASE slow_log;
    CREATE DATABASE track_event;
    CREATE DATABASE replication_exec;
    CREATE DATABASE replication_metastore;
  3. Create a user and grant full management permissions for the above databases.

    CREATE USER 'ninedata'@'%' IDENTIFIED BY '<Your-Password>';
    GRANT ALL PRIVILEGES ON meta.* TO 'ninedata'@'%';
    GRANT ALL PRIVILEGES ON scheduler.* TO 'ninedata'@'%';
    GRANT ALL PRIVILEGES ON slow_log.* TO 'ninedata'@'%';
    GRANT ALL PRIVILEGES ON track_event.* TO 'ninedata'@'%';
    GRANT ALL PRIVILEGES ON replication_exec.* TO 'ninedata'@'%';
    GRANT ALL PRIVILEGES ON replication_metastore.* TO 'ninedata'@'%';
    FLUSH PRIVILEGES;
  4. Pass the following META_DB environment variable in the docker run command when deploying the NineData Community Edition service, in the format of -e META_DB=<database account>:<database password>@<database Host>:<database port number>. Example is as follows:

    docker run -p 9999:9999 --privileged -v /opt/ninedata:/u01 -e META_DB=ninedata:123456@127.0.0.1:3306 --name ninedata -d swr.cn-east-3.myhuaweicloud.com/ninedata/ninedata:4.1.0