clickhouse重启,以及修改数据存储目录后重启失败的解决办法
1.clickhouse重启,查看重启之后的状态systemctl restart clickhouse-server #重启systemctl start clickhouse-server # 启动systemctl status clickhouse-server #查看状态2. 修改数据文件存储路径vim /etc/clickhouse-server/config.xml将/var/lib
·
1.clickhouse重启,查看重启之后的状态
systemctl restart clickhouse-server #重启
systemctl start clickhouse-server # 启动
systemctl status clickhouse-server #查看状态
2. 修改数据文件存储路径
vim /etc/clickhouse-server/config.xml
将/var/lib/clickhouse默认存储路径,改为/data/clickhouse
cp -r /var/lib/clickhouse /data/
将原来的数据库迁移到新的存储位置
注意:/var/lib/clickhouse目录下所有文件都是clickhouose:clickhouse这个用户用户组下的,上述步骤迁移数据的结果,
df -h # 查看挂载
systemctl restart clickhouse-server
重启,使修改的数据存储路径生效,
可以看到,重启失败,
报错:Unit clickhouse-server.service entered failed state.
journalctl -xe 查看报错:
:filesystem::filesystem_error, e.what() = filesystem error: in create_directories: Permission denied [/data/clickhouse/preprocessed_configs]
问题在于,新的存储路径的权限不是在clickhouse:clickhouse之下
chown -R clickhouse:clickhouse /data # 修改/data所属用户组即可
补充:
1.查看日志
tail -f /var/log/clickhouse-server/clickhouse-server.log
2.查看clickhouse服务相关权限
vim /usr/lib/systemd/system/clickhouse-server.service
3.系统日志查看命令journalctl
journalctl -xe # -x表示目录,-e表示从结尾查看
更多推荐
所有评论(0)