Deploy a time-series database (Optional)

2023-11-30 06:45:08  Updated

If you need OceanBase Migration Service (OMS) to collect and display historical monitoring data, deploy a time-series database (TSDB). This topic describes how to deploy a TSDB and the limits.

Limits

  • A TSDB can be deployed in OMS V2.1.0 and later. Currently, InfluxDB 1.8 is deployed as a TSDB.

  • You need to use port 8086 to deploy a TSDB.

  • A time series database (TSDB) supports only one-node deployment and does not support high availability. You need to deploy only one TSDB. You can deploy the TSDB and OMS on the same host. When the service fails, monitoring data becomes unavailable.

Procedure

  1. Log on to the host where the TSDB is to be deployed.

  2. Load the image of InfluxDB 1.8.

    Click here to download the InfluxDB image, and upload it to the host where the time-series database is to be deployed.

    sudo docker load -i ${influxdb_image}
    
  3. Start the Docker container and ensure that data can be written to the mounted data disk.

    sudo docker run  -dit -p 8086:8086 -p 14444:14444 \
    -v {Mounted data disk}:/var/lib/influxdb \
    --env INFLUXDB_BIND_ADDRESS=127.0.0.1:14444 \
    --env INFLUXDB_HTTP_AUTH_ENABLED=true \
    --env INFLUXDB_HTTP_PING_AUTH_ENABLED=true \
    --name=oms-influxdb \
    influxdb:1.8
    
  4. To enable authentication for the InfluxDB service, create an account and set the password.

    1. Go to the InfluxDB container.

      docker exec -it ${INFLUXDB_NAME} bash
      
    2. Go to the InfluxDB console.

      cd /usr/bin
      ./influx
      
    3. Create an account, set the password, and grant the admin permissions to the account.

      create user "${USER_NAME}" with password '${PASSWORD}' with all privileges
      

      Notice

      • You must first create the admin user in InfluxDB before you enable authentication.

      • Save the account and password for the configuration of the config.yaml file.

    4. Log on to InfuxDB again and run the following command:

      show users;
      

      To view the database, log on to InfluxDB again and then run the SHOW DATABASES command.

  5. Exit the container where the TSDB resides.

Contact Us