![]() Use the influxd from the command line to dump the whole new database in the disk.After successfully completing the query, all needed data will be in the database collectd_tmp (and because it just copies the data, it still remains in collectd, do not forget to delete it if not needed). Select all the measurements from the old database collectd where the tag key host has the tag value “” and insert them in the database collectd_tmp. > SELECT * INTO "collectd_tmp"."autogen".:MEASUREMENT FROM "collectd"."default"./.*/ where host='' GROUP BY * Select all the measurements from the original database and insert them in the new database.The retention policy for the collectd database is with the name “default” (shown earlier) and the retention policy for the database collectd_tmp is with the name “autogen”. > SHOW RETENTION POLICIES ON "collectd_tmp" InfluxDB backup and restore functionality is specific and is explained in the process of moving the data one server to the other below and in detail in the official documents – Moving all data selected by a tag value to another server To backup or move all the data of reporting server with the name to another database in another server the backup/dump query should include a WHERE clause with the tag name host and tag value “”. The tag name host is very important for the purpose of this article. Each line is a unique line of measurement, tag set, and a field key. ![]() cpu_value) and all after the first comma are the tags of the measurement. The first column is the measurement name (i.e. To show a little bit more information about the database scheme with the name collectd it is a good idea to print the series in the ~]# influxĬpu_value,host=,instance=0,type=cpu,type_instance=idleĬpu_value,host=,instance=0,type=cpu,type_instance=interruptĬpu_value,host=,instance=0,type=cpu,type_instance=niceĬpu_value,host=,instance=0,type=cpu,type_instance=softirqĬpu_value,host=,instance=0,type=cpu,type_instance=stealĬpu_value,host=,instance=0,type=cpu,type_instance=systemĬpu_value,host=,instance=0,type=cpu,type_instance=userĬpu_value,host=,instance=0,type=cpu,type_instance=waitĬpu_value,host=,instance=1,type=cpu,type_instance=idleĬpu_value,host=,instance=1,type=cpu,type_instance=interrupt The measurements include CPU, disk, network, and many more data. The limit clause could be missed to show the whole list of measurements associated with the database collectd.Īgents gather data on multiple servers and report the data to the InfluxDB server in the collectd database. There is a limit clause – “LIMIT 10” to show only the first 10 measurements because the whole list may be too big. Show all measurements associated with this database (i.e. There are multiple measurements in the collectd database.For example, creating a database without specifying a retention policy will add a retention policy with the default name “autogen”. Always check the retention policy, because it might be with a different name. The retention policy name of the database name “collectd” is “default”. Name duration shardGroupDuration replicaN default The retention policy is used to build the ~]# influx It is important to show the retention policy, too. InfluxDB database with name ~]# influx.So moving the old data from the first InfluxDB server to the other InfluxDB server the historical data is preserved for this reporting server (i.e. hosts) report data to this InfluxDB server and the target is to move all measurement data of a single reporting server to another InfluxDB server, which has already been accepting the new data. ![]() There is the initial setup of the first InfluxDB server. Show series The initial setup – get known the database scheme The whole setup is following this article Monitor and analyze with Grafana, influxdb 1.8 and collectd under CentOS Stream 9 Unfortunately, it is not possible to use the influxd backup command to select only certain data from a database despite it being easily selectable by a unique tag value such as the hostname of the reporting server. All queries are executed in the influx command-line tool, which connects to the default InfluxDB location – It is important to be able to connect to the InfluxDB using the influx command-line tool. All useful InfluxQL queries will be included. The InfluxDB server is version 1.8 and the InfluxQL language is used. This article demonstrates how to move part of the data from one InfluxDB server to another InfluxDB sThect, the data is split by criteria to another server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |