我正在使用涌入并创建备份使用
influxd backup -database grpcdb /opt/data
Run Code Online (Sandbox Code Playgroud)
我可以看到文件是在/ opt/data目录下创建的
现在,我想在同一台机器上恢复具有不同数据库名称的相同数据文件.
influxd restore -database grpcdb1 /opt/data
Run Code Online (Sandbox Code Playgroud)
但得到以下提到的错误
restore: -datadir is required to restore
Run Code Online (Sandbox Code Playgroud)
在这里,我提供相同的数据路径.不确定缺少什么.
我找到了一种方法.
重要的事情:
只有在Influxdb实例运行时才能导出数据.只有在Influxdb实例未运行时才能导入数据.
出口数据:
sudo service influxdb start (Or leave this step if service is already running)
influxd backup -database grpcdb /opt/data
Run Code Online (Sandbox Code Playgroud)
导入数据:
sudo service influxdb stop
influxd restore -metadir /var/lib/influxdb/meta /opt/data
influxd restore -database grpcdb -datadir /var/lib/influxdb/data /opt/data
sudo service influxdb start
Run Code Online (Sandbox Code Playgroud)