【问题标题】:Cannot restore data because of dot in database name由于数据库名称中的点,无法恢复数据
【发布时间】:2018-10-02 08:41:10
【问题描述】:

InfluxDB 版本:1.6.3

我使用旧备份格式创建了名为“test.mydb”的数据库的备份:

influxd backup -database <mydatabase> <path-to-backup>

备份很顺利,但是当我尝试恢复时:

sudo influxd restore -db "test.mydb" -newdb "test.mydb" -datadir /var/lib/influxdb/data /home/ubuntu/influxdb/test.mydb/

我收到了错误:backup tarfile name incorrect format

搜索后我认为是因为influxdb/cmd/influxd/restore/restore.go中的这段代码:

// should get us ["db","rp", "00001", "00"] 
    pathParts := strings.Split(filepath.Base(tarFile), ".") 
    if len(pathParts) != 4 { 
        return fmt.Errorf("backup tarfile name incorrect format") 
} 

它检查备份文件名中有多少个点。数量需要为 4,但由于我的数据库名称,文件有 5 个点。

有什么解决方法吗?

【问题讨论】:

    标签: influxdb database-backups


    【解决方案1】:

    我没有找到解决此问题的最佳解决方案,因此我手动将数据复制并粘贴到 InfluxDB。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-17
      • 2015-12-12
      • 2016-03-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-03
      相关资源
      最近更新 更多