Verifying InfluxDB Installed Using Source Code
- Initialize the database. Enter the user name, password, organization name, bucket (database) name, and retention (data retention period, in hours) in sequence.
Enter the actual values.
1 2
cd /opt/db/influxdb ./influx setup

If repeated initialization is required, delete the files in the data directory first. For example, if the data directory shown in the RPM CLI output is /root/.influxdbv2/, run the following commands to delete files in the data directory:
1 2 3
ll /root/.influxdbv2/ cd /root/.influxdbv2/ rm -rf *
- Check the creation result.
1 2 3
./influx bucket list ./influx user list ./influx config list

- Add data and query the data. (Change the bucket name based on the site requirements.)
1 2 3
./influx write --bucket tst "m,host=host1 field1=1.2" ./influx write --bucket tst "m,host=host2 field1=1.3" ./influx query 'from(bucket:"tst") |> range(start:-1m)'

- Delete the data and confirm the result. (Change the bucket and organization names based on the site requirements.)
1 2
./influx delete --bucket tst --start 2021-10-15T18:10:28Z --stop $(date +"%Y-%m-%dT%H:%M:%SZ") --predicate '_measurement="m"' --org=softstone ./influx query 'from(bucket:"tst") |> range(start:-1m)'

Parent topic: Verifying InfluxDB