clickhouse修改默认数据目录和log目录

修改数据目录

创建数据文件夹

/opt/aspire/product/isp_cert
/opt/aspire/product/isp_cert/log

安装时生成的默认文件迁移

mv /var/lib/clickhouse /opt/aspire/product/isp_cert/
mv /var/log/clickhouse-server /opt/aspire/product/isp_cert/log/

进入/var/lib下建立链接

cd /var/lib

ln -s /opt/aspire/product/isp_cert/clickhouse .

cd /var/log

ln -s /opt/aspire/product/isp_cert/log/clickhouse-server .

注:如果是自己创建的目录,不是从/var/lib下拷过去,有时会遇到权限问题,这里需要把 /opt/aspire/product/isp_cert/下的文件授权给clickhouse用户:

chown -Rc clickhouse:clickhouse /opt/aspire/product/isp_cert/clickhouse

chown -Rc clickhouse:clickhouse /opt/aspire/product/isp_cert/log/clickhouse-server

 

注:目录搬迁不能搬迁到/home/xx用户下,就算chown也不行,猜测原因是clickhouse用户没权限进入/home/xx用户这个目录。 

你可能感兴趣的:(clickhouse笔记)