此命令是在clickhouse 22.7.5版本下执行:
官方文档见:https://clickhouse.com/docs/en/operations/backup#command-summary
参考文档: https://blog.csdn.net/lusklusklusk/article/details/139781360
创建备份目录
mkdir /backups/
修改权限:
chmod 766 /backups/log
sudo chown -R clickhouse:clickhouse /backups/
修改配置:
vim /etc/clickhouse-server/config.d/backup_disk.xml
添加如下记录:
<clickhouse> <storage_configuration> <disks> <backups> <type>local</type> <path>/backups/</path> </backups> </disks> </storage_configuration> <backups> <allowed_disk>backups</allowed_disk> <allowed_path>/backups/</allowed_path> </backups> </clickhouse>
重启生效:
systemctl restart clickhouse-server
进入client命令行:
clickhouse-client -m --user default --password xxxxxxxxxxx
查询配置:
select name,path,type from system.disks;
执行备份:
BACKUP TABLE ehrds.SYS_ESB_LOG to Disk('backups','logs/');
其他备份方式:
https://www.cnblogs.com/hxlasky/p/15801939.html
https://bbs.huaweicloud.com/blogs/389117
标签:备份,server,https,backups,com,clickhouse From: https://www.cnblogs.com/leolzi/p/18469884