我正在尝试将 clickhouse 数据目录移动到另一个分区/dev/sdb1
。所以这就是我所做的:
sudo systemctl stop clickhouse-server
mv /var/lib/clickhouse /var/lib/clickhouse-orig
mkdir /var/lib/clickhouse
chown clickhouse:clickhouse /var/lib/clickhouse
mount -o user /dev/sdb1 /var/lib/clickhouse
cp -Rv /var/lib/clickhouse-orig/* /var/lib/clickhouse/
chown -Rv clickhouse:clickhouse /var/lib/clickhouse
sudo systemctl start clickhouse-server
但它在启动时显示错误:
Processing configuration file '/etc/clickhouse-server/config.xml'.
Sending crash reports is disabled
Starting ClickHouse 21.6.4.26 with revision 54451, build id: 12B138DBA4B3F1480CE8AA18884EA895F9EAD439, PID 10431
starting up
OS Name = Linux, OS Version = 5.4.0-1044-gcp, OS Architecture = x86_64
Calculated checksum of the binary: 26864E69BE34BA2FCCE2BD900CF631D4, integrity check passed.
Setting max_server_memory_usage was set to 882.18 MiB (980.20 MiB available * 0.90 max_server_memory_usage_to_ram_ratio)
DB::Exception: Settings profile `default` not found
shutting down
Stop SignalListener thread
EDIT
显然即使没有新分区它也不会启动,所以可能 theconfig.xml
或 themacro.xml
是罪魁祸首
检查 /var/lib/clickhouse/preprocessed_configs/users.xml 文件,它应该包含 XPath /yandex/profiles/default
另外,查看源配置
/etc/clickhouse-server/users.xml
和可能的/etc/clickhouse-server/users.d/*.xml
或/etc/clickhouse-server/conf.d/*.xml