由于失误,安装clickhouse时没有修改ck的默认目录,数据保存到了系统盘导致系统盘容量占满(总共100G),现切换到数据盘
1,先将clickhouse关闭:systemctl stop clickhouse-server
2,将系统盘下的数据复制到数据盘路径下:
scp -r /var/lib/clickhouse/* /sdbdisk/var/lib/clickhouse/
3,将原路径下的数据修改别名
[root@node01 clickhouse]# mv access access1
[root@node01 clickhouse]# mv data data1
[root@node01 clickhouse]# mv dictionaries_lib dictionaries_lib1
[root@node01 clickhouse]# mv flags flags1
[root@node01 clickhouse]# mv format_schemas format_schemas1
[root@node01 clickhouse]# mv metadata metadata1
[root@node01 clickhouse]# mv metadata_dropped metadata_dropped1
[root@node01 clickhouse]# mv preprocessed_configs preprocessed_configs1
[root@node01 clickhouse]# mv store store1
[root@node01 clickhouse]# mv tmp tmp1
[root@node01 clickhouse]# mv user_files user_files1
4,建立软连接
ln -s /sdbdisk/var/lib/clickhouse/access /var/lib/clickhouse/access
ln -s /sdbdisk/var/lib/clickhouse/data /var/lib/clickhouse/data
ln -s /sdbdisk/var/lib/clickhouse/dictionaries_lib /var/lib/clickhouse/dictionaries_lib
ln -s /sdbdisk/var/lib/clickhouse/flags /var/lib/clickhouse/flags
ln -s /sdbdisk/var/lib/clickhouse/format_schemas /var/lib/clickhouse/format_schemas
ln -s /sdbdisk/var/lib/clickhouse/metadata /var/lib/clickhouse/metadata
ln -s /sdbdisk/var/lib/clickhouse/metadata_dropped /var/lib/clickhouse/metadata_dropped
ln -s /sdbdisk/var/lib/clickhouse/preprocessed_configs /var/lib/clickhouse/preprocessed_configs
ln -s /sdbdisk/var/lib/clickhouse/store /var/lib/clickhouse/store
ln -s /sdbdisk/var/lib/clickhouse/tmp /var/lib/clickhouse/tmp
ln -s /sdbdisk/var/lib/clickhouse/user_files /var/lib/clickhouse/user_files
5,修改目录权限:
chown -R clickhouse:clickhouse /sdbdisk/var/lib/clickhouse