使用 DDL/DML 将数据导入流入数据库并设置保留策略

Importing data to influx DB with DDL/DML & setting retention policy

我在文本文件中有如下数据...


 DML
 CONTEXT-DATABASE: import
 CONTEXT-RETENTION-POLICY: oneyear

FO,type=FreshOrders avg_FreshOrders=1479.0840707964599,p95_FreshOrders=2589,FreshOrders=226 1593648000000
FO,type=FreshOrders avg_FreshOrders=2242.86170212766,p95_FreshOrders=5622,FreshOrders=188 1593475200000
FO,type=FreshOrders avg_FreshOrders=1682.3375,p95_FreshOrders=2738,FreshOrders=160 1593734400000

我将这个文本文件放在 influxDB 中一个名为 data 的文件夹中。我的要求是将最后 3 行数据导入 influx DB。我正在导航到 influxDB 文件夹 C:\Users\Administrator\Downloads\influxdb-1.8.0_windows_amd64\influxdb-1.8.0-1 和 运行 命令提示符中的以下命令以将其导入

influx -import -path=C:\Users\Administrator\Downloads\influxdb-1.8.0_windows_amd64\influxdb-1.8.0-1\data\import.txt -precision=ns

但是数据没有被导入并且低于错误。有人可以帮我解决这个问题吗?

C:\Users\Administrator\Downloads\influxdb-1.8.0_windows_amd64\influxdb-1.8.0-1>influx -import -path=C:\Users\Administrator\Downloads\influxdb-1.8.0_windows_amd64\influxdb-1.8.0-1\data\import.txt -precision=s
2020/07/13 16:34:25 error: error parsing query: found DML, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1
2020/07/13 16:34:25 error: error parsing query: found CONTEXT, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1
2020/07/13 16:34:25 error: error parsing query: found CONTEXT, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1
2020/07/13 16:34:25 error: error parsing query: found FO, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1
2020/07/13 16:34:25 error: error parsing query: found FO, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1
2020/07/13 16:34:25 error: error parsing query: found FO, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1 

如下更改文件内容:

# DML
# CONTEXT-DATABASE: import
# CONTEXT-RETENTION-POLICY: oneyear

FO,type=FreshOrders avg_FreshOrders=1479.0840707964599,p95_FreshOrders=2589,FreshOrders=226 1593648000000
FO,type=FreshOrders avg_FreshOrders=2242.86170212766,p95_FreshOrders=5622,FreshOrders=188 1593475200000
FO,type=FreshOrders avg_FreshOrders=1682.3375,p95_FreshOrders=2738,FreshOrders=160 1593734400000