Deploy a time-series database (Optional)

2024-09-18 01:56:08  Updated

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

Limits

  • A time-series database can be deployed in OMS V2.1.0 and later. Currently, InfluxDB 1.8 is deployed as a time-series database.

  • You need to use port 8086 to deploy a time-series database.

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

Procedure

  1. Log on to the host where the time-series database 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. Access the InfluxDB container.

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

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

      Notice:

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

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

      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. Run the auth command.

    5. Run the show users command.

      To view the database, run the show databases command.

  5. Exit the container where the TSDB resides.

Contact Us