1Panel
1Panel copied to clipboard
[FEATURE] 快照或者备份应用时,同步备份应用存储卷
联系方式
issue联系
1Panel 版本
v1.10.7-lts
问题描述
快照时,如果应用有存储卷,则不会备份存储卷,恢复时报错
快照前:
在另外一台vps上恢复快照后:
重现步骤
备份一个带有存储卷的快照
在新vps上恢复快照
期待的正确结果
正确恢复
相关日志输出
[2024-05-13 16:59:29] [INFO] init logger successfully
[2024-05-13 16:59:29] [INFO] init monitor db successfully
[2024-05-13 16:59:29] [INFO] init db successfully
[2024-05-13 16:59:29] [INFO] Migration run successfully
[2024-05-13 16:59:29] [INFO] init cache successfully
[2024-05-13 16:59:29] [INFO] init session successfully
[2024-05-13 16:59:44] [ERROR] load remote time with [pool.ntp.org] failed, err: failed to read server response: read udp 192.168.19.130:47003->162.159.200.123:123: i/o timeout
[2024-05-13 16:59:47] [INFO] Starting synchronization with App Store...
[2024-05-13 16:59:47] [INFO] [xpack] init db successfully
[2024-05-13 16:59:47] [INFO] [xpack] migration run successfully
[2024-05-13 16:59:47] [ERROR] init waf error openresty not found
[2024-05-13 16:59:47] [INFO] listen at http://0.0.0.0:10086 [tcp4]
[2024-05-13 16:59:47] [INFO] [AppStore] download file from https://apps-assets.fit2cloud.com/stable/1panel.json.zip
[2024-05-13 16:59:47] [INFO] Starting synchronization of application details...
[2024-05-13 16:59:57] [INFO] Synchronization of application details Success
[2024-05-13 16:59:57] [INFO] Synchronization with the App Store was successful!
[2024-05-13 17:02:31] [INFO] init logger successfully
[2024-05-13 17:02:31] [INFO] init monitor db successfully
[2024-05-13 17:02:31] [INFO] init db successfully
[2024-05-13 17:02:31] [INFO] Migration run successfully
[2024-05-13 17:02:32] [INFO] init cache successfully
[2024-05-13 17:02:32] [INFO] init session successfully
[2024-05-13 17:02:31] [DEBUG] synchronize system time with [pool.ntp.org] successful!
[2024-05-13 17:02:34] [INFO] Starting synchronization with App Store...
[2024-05-13 17:02:34] [INFO] [xpack] init db successfully
[2024-05-13 17:02:34] [INFO] [xpack] migration run successfully
[2024-05-13 17:02:34] [ERROR] init waf error openresty not found
[2024-05-13 17:02:34] [INFO] listen at http://0.0.0.0:10086 [tcp4]
[2024-05-13 17:02:34] [INFO] [AppStore] download file from https://apps-assets.fit2cloud.com/stable/1panel.json.zip
[2024-05-13 17:02:34] [INFO] Starting synchronization of application details...
[2024-05-13 17:02:44] [INFO] Synchronization of application details Success
[2024-05-13 17:02:44] [INFO] Synchronization with the App Store was successful!
[2024-05-13 17:05:42] [INFO] start to recover panel by snapshot now
[2024-05-13 17:05:42] [DEBUG] tar --warning=no-file-changed --ignore-failed-read -zcf /opt/1panel_original/original_1panel_v1.10.7-lts_amd64_20240513151208/1panel/1panel_backup.tar.gz --exclude ./system --exclude ./system_snapshot --exclude *.sock -C /opt/1panel/backup .
[2024-05-13 17:05:42] [DEBUG] tar --warning=no-file-changed --ignore-failed-read -zcf /opt/1panel_original/original_1panel_v1.10.7-lts_amd64_20240513151208/1panel/1panel_data.tar.gz --exclude ./tmp --exclude ./log --exclude ./cache --exclude ./db/1Panel.db-* --exclude .*.sock --exclude ./backup/system_snapshot --exclude *.sock -C /opt/1panel .
[2024-05-13 17:05:42] [DEBUG] handle backup before recover successful!
[2024-05-13 17:05:56] [DEBUG] download snapshot file to /opt/1panel/tmp/system/1panel_v1.10.7-lts_amd64_20240513151208 successful!
[2024-05-13 17:05:56] [DEBUG] tar zxvfC /opt/1panel/tmp/system/1panel_v1.10.7-lts_amd64_20240513151208/1panel_v1.10.7-lts_amd64_20240513151208.tar.gz /opt/1panel/tmp/system/1panel_v1.10.7-lts_amd64_20240513151208
[2024-05-13 17:06:28] [DEBUG] decompress snapshot file successful!/opt/1panel/tmp/system/1panel_v1.10.7-lts_amd64_20240513151208
[2024-05-13 17:07:34] [DEBUG] recover app data from snapshot file successful!
[2024-05-13 17:07:35] [DEBUG] recover daemon.json from snapshot file successful!
[2024-05-13 17:07:36] [DEBUG] recover 1panel binary from snapshot file successful!
[2024-05-13 17:07:36] [DEBUG] recover 1pctl from snapshot file successful!
[2024-05-13 17:07:36] [DEBUG] recover 1panel service from snapshot file successful!
[2024-05-13 17:07:36] [DEBUG] tar -zxf /opt/1panel/tmp/system/1panel_v1.10.7-lts_amd64_20240513151208/1panel_v1.10.7-lts_amd64_20240513151208/1panel/1panel_backup.tar.gz -C /opt/1panel/backup .
[2024-05-13 17:07:37] [DEBUG] recover 1panel backups from snapshot file successful!
[2024-05-13 17:07:37] [DEBUG] tar -zxf /opt/1panel/tmp/system/1panel_v1.10.7-lts_amd64_20240513151208/1panel_v1.10.7-lts_amd64_20240513151208/1panel/1panel_data.tar.gz -C /opt/1panel .
[2024-05-13 17:08:15] [DEBUG] recover 1panel data from snapshot file successful!
[2024-05-13 17:08:15] [DEBUG] start to rebuild all app
[2024-05-13 17:08:17] [DEBUG] restart all compose successful!
[2024-05-13 17:08:17] [INFO] recover successful
[2024-05-13 17:08:17] [DEBUG] remove the file /opt/1panel/tmp/system/1panel_v1.10.7-lts_amd64_20240513151208 after the operation is successful
[2024-05-13 17:08:18] [INFO] init logger successfully
[2024-05-13 17:08:18] [INFO] init monitor db successfully
[2024-05-13 17:08:18] [INFO] init db successfully
[2024-05-13 17:08:18] [INFO] Migration run successfully
[2024-05-13 17:08:18] [INFO] init cache successfully
[2024-05-13 17:08:18] [INFO] init session successfully
[2024-05-13 17:08:18] [DEBUG] synchronize system time with [ntp.aliyun.com] successful!
[2024-05-13 17:08:21] [INFO] add shell job 更新tailscale与cloudflared successful
[2024-05-13 17:08:21] [INFO] start cronjob entryID: 5
[2024-05-13 17:08:21] [INFO] add shell job 更新github successful
[2024-05-13 17:08:21] [INFO] start cronjob entryID: 6
[2024-05-13 17:08:21] [INFO] add shell job 本地app successful
[2024-05-13 17:08:21] [INFO] start cronjob entryID: 7
[2024-05-13 17:08:21] [INFO] add shell job 监控博客邮件 successful
[2024-05-13 17:08:21] [INFO] start cronjob entryID: 8
[2024-05-13 17:08:21] [INFO] add database job 备份所有数据库 successful
[2024-05-13 17:08:21] [INFO] start cronjob entryID: 9
[2024-05-13 17:08:21] [INFO] Starting synchronization with App Store...
[2024-05-13 17:08:21] [INFO] [xpack] init db successfully
[2024-05-13 17:08:21] [INFO] [xpack] migration run successfully
[2024-05-13 17:08:21] [INFO] listen at http://0.0.0.0:10086 [tcp4]
[2024-05-13 17:08:21] [INFO] [AppStore] download file from https://apps-assets.fit2cloud.com/stable/1panel.json.zip
[2024-05-13 17:08:21] [ERROR] unmarshalling json for unbind licence failed, err: invalid character '<' looking for beginning of value
[2024-05-13 17:08:21] [INFO] Starting synchronization of application details...
[2024-05-13 17:08:31] [INFO] Synchronization of application details Success
[2024-05-13 17:08:31] [INFO] Synchronization with the App Store was successful!
[2024-05-13 17:08:52] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:09:21] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:09:52] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:10:22] [INFO] start to handle remove expired, retain copies: 7
time="2024-05-13T17:10:47+08:00" level=warning msg="docker-compose.yml: `version` is obsolete"
[2024-05-13 17:10:52] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:11:22] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:11:52] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:12:22] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:12:52] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:13:21] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:13:51] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:14:22] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:14:51] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:15:22] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:15:51] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:16:21] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:16:52] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:17:22] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:17:51] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:18:21] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:18:51] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:19:21] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:19:52] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:20:22] [INFO] start to handle remove expired, retain copies: 7
[2024-05-13 17:20:52] [INFO] start to handle remove expired, retain copies: 7
附加信息
No response
当前版本中如果应用有持久化设置,首先推荐使用本地磁盘存储。
1Panel 系统备份应用或者创建快照时,是备份的应用安装目录(不会备份 docker volume 存储卷)
在后续版本中会考虑支持备份应用关联的存储卷。
其实把数据集的路径设置到 1panel的安装目录就行了。 或者想办法提示或者智能地帮忙修改docker compose中数据卷的位置