1.先配置好win下的influxdb配置文件并通过配置文件启动
influxd -config influxdb.conf
2.在系统权限下打开cmd窗口,切换到influxdb的安装目录下
3.执行下面命令:
D:\DataBase\influxdb-1.8.3_windows_amd64\influxdb-1.8.3-1>influx_inspect export -datadir "D:/DataBase/influxdb-1.8.3_windows_amd64/data" -waldir "D:/DataBase/influxdb-1.8.3_windows_amd64/wal" -out "test-test" -database test -start 2019-07-2
解析:influx_inspect export
-datadir "/data/influxdb/data" # 勿动,influxdb 默认的数据存储位置
-waldir "/data/influxdb/wal" # 勿动,influxdb 默认的数据交换位置
-out "telemetry_vcdu_time" # 导出数据文件的文件名
-database telemetry_vcdu_time # 指定要导出数据的数据库
-start 2019-07-21T08:00:01Z # 指定要导出的数据的起始时间
4.执行完看到如下窗口即导出成功
1.登录云服务器(CentOs7),上传导出的文件到云服务器上
2.将InfluxDB客户端安装包上传到弹性云服务器,解压客户端工具包,并打开所在目录。
tar -xzf influxdb-1.7.9-static_linux_amd64.tar.gz
3.在root权限执行以下命令:
./influx -ssl -unsafeSsl -host 191.1.1.1 -port 8086 -username xxxxx -password xxxxxxx -import -path=/home/temp/test-test -precision=ns
解析:influx -import -path=telemetry_sat_time -precision=ns
命令解释
influx
-import # 无参,勿动
-path=telemetry_sat_time # 指定导入数据的文件
-precision=ns # 指定导入数据的时间精度
4.见到下图即成功导出
Usage of influx:
-version
Display the version and exit.
-host 'host name'
Host to connect to.
-port 'port #'
Port to connect to.
-socket 'unix domain socket'
Unix socket to connect to.
-database 'database name'
Database to connect to the server.
-password 'password'
Password to connect to the server. Leaving blank will prompt for password (--password '').
-username 'username'
Username to connect to the server.
-ssl
Use https for requests.
-unsafeSsl
Set this when connecting to the cluster using https and not use SSL verification.
-execute 'command'
Execute command and quit.
-type 'influxql|flux'
Type specifies the query language for executing commands or when invoking the REPL.
-format 'json|csv|column'
Format specifies the format of the server responses: json, csv, or column.
-precision 'rfc3339|h|m|s|ms|u|ns'
Precision specifies the format of the timestamp: rfc3339, h, m, s, ms, u or ns.
-consistency 'any|one|quorum|all'
Set write consistency level: any, one, quorum, or all
-pretty
Turns on pretty print for the json format.
-import
Import a previous database export from file
-pps
How many points per second the import will allow. By default it is zero and will not throttle importing.
-path
Path to file to import
-compressed
Set to true if the import file is compressed
Examples:
# Use influx in a non-interactive mode to query the database "metrics" and pretty print json:
$ influx -database 'metrics' -execute 'select * from cpu' -format 'json' -pretty
# Connect to a specific database on startup and set database context:
$ influx -database 'metrics' -host 'localhost' -port '8086'
信息加载中,请等待
微信客服(速回)
微信客服(慢回)