背景
在基于文章一的基础上,多余的话我就不多赘述。直接上clickhouse部署过程中的一些问题。
clickhouse 创建kafka引擎表
CREATE TABLE default.kafka_clickhouse_inner_log ON CLUSTER clickhouse_cluster (
log_uuid String ,
date_partition UInt32 ,
event_name String ,
activity_name String ,
activity_type String ,
activity_id UInt16
) ENGINE = Kafka SETTINGS
kafka_broker_list = 'kafka1:9092,kafka2:9092,kafka3:9092',
kafka_topic_list = 'data_clickhouse',
kafka_group_name = 'clickhouse_xxx',
kafka_format = 'JSONEachRow',
kafka_row_delimiter = '\n',
kafka_num_consumers = 1;
问题1:clikhouse客户端无法查询 kafka引擎表:
Direct select is not allowed. To enable use setting stream_like_engine_allow_direct_select
. (QUERY_NOT_ALLOWED) (version 22.5.2.53 (official build))
解决方案:
需要在clickhouse client 创建加上 --stream_like_engine_allow_direct_select 1
clickhouse-client --stream_like_engine_allow_direct_select 1 --password xxxxx