1. clickhouse客户端登陆出现 code: 516错误
需要修改users.xml 表
同时也需要修改
default-password.xml文件的
可以使用 这个命令生成123456的 sha256的密文
echo -n 123456 | openssl dgst -sha256
2、clickhouse分片表查询 的时候报516错误 需要修改配置文件metrika.xml
每个分片上添加用户名和密码否则无法访问其他分片的本地表
3.clickhouse Too many simultaneous queries 同时查询数量过多
编辑位于以下位置的主clickhouse配置文件:
/etc/clickhouse-server/config.xml
1
查找:
<max_concurrent_queries>100</max_concurrent_queries>
1
根据需求更改:
<max_concurrent_queries>200</max_concurrent_queries>
4.一次性在集群每个机器上建立本地表
CREATE TABLE database.order_local on cluster cluster01
(
`Type` String COMMENT '数据类型',
`Subtype` String COMMENT '子类',
`Successflag` String COMMENT '0-失败;2-成功',
`Client` String COMMENT 'andriod/IOS',
`Version` String COMMENT '版本信息',
`Macid` String COMMENT 'macid',
`Ip` String COMMENT 'IPV6地址',
`Pin` String COMMENT 'PIN',
`Time` String COMMENT '时间',
`Origindata` String COMMENT 'Origindata',
`Succflag` String COMMENT 'T/F',
`LowerCaseClient` String COMMENT '客户端类型:小写',
`FormatTime` String COMMENT '时间',
`OccurTime` String COMMENT '发生时间',
`IndexTime` String COMMENT '检索时间',
`IpType` String COMMENT 'IPV4/IPV6',
`Code` Int64 COMMENT 'CODE信息',
`Message` String COMMENT 'message',
`Region` String COMMENT '区域信息',
`Province` String COMMENT '省份',
`City` String COMMENT '城市名字',
`District` String COMMENT '区',
`Provinceid` String COMMENT '省会编号',
`Cityid` String COMMENT '城市编号',
`Districtid` String COMMENT '区编号',
`Operators` String COMMENT '操作人',
`Orderdate` Date COMMENT '订单日期',
`OrderTime` DateTime COMMENT '订单时间',
`CreateTime` DateTime DEFAULT now() COMMENT '创建时间'
)
ENGINE = MergeTree()
PARTITION BY toYYYYMMDD(Orderdate)
ORDER BY (Type, Subtype, Successflag, Province, Operators)