版本: clickhouse version 20.12.5
将hdfs-site.xml文件拷贝到:/etc/clickhouse-server/hdfs-site.xml
并且将dfs.ha.namenodes
别名更改为小写
编辑 /etc/init.d/clickhouse-server
文件,增加一行:
export LIBHDFS3_CONF=/etc/clickhouse-server/hdfs-site.xml
加到开机启动:
chkconfig clickhouse-server on
配置修改完毕后,重启 ClickHouse
服务
service clickhouse-server start
验证:
第一步,在clickhouse客户端建表:
CREATE TABLE bigdata.int_itv_sp_d_ckh_temp(`sp_id` String, `sp_name` String) ENGINE=HDFS('hdfs://HN/user/hive/warehouse/nginxlogdb.db/int_itv_sp_d_ckh_temp/*', 'ORC');
第二步:
select * from bigdata.int_itv_sp_d_ckh_temp;