clickhouse 运维中遇到的问题

1、Not enough privileges. To execute this query it's necessary to have the grant MYSQL ON *.* (version 20.12.3.3 (official build))

clickhouse 文档里没说 有个隐藏的权限 mysql 用来赋予从mysql 同步数据的权限  这是系统级别的 无法赋予给某个库  grant mysql on *.* to xxx即可

2,clickhouse+ superset报错 

sqlalchemy.exc.NoSuchModuleError: Can’t load plugin: sqlalchemy.dialects:clickhouse

网上说下载py里的sqlalchemy连接clickhouse插件,这个没错,但是sqlalchemy版本号可能有问题,一定要选高版本的

3,clickhouse+ superset报错 

DB::Exception: default: Authentication failed: password is
incorrect or there is no user with such name

这个报错不是因为账号密码不对,又是因为包版本号问题
这里需要把infi.clickhouse_orm降级

pip3 install infi.clickhouse_orm==1.0.4

4,给表改名 

RENAME TABLE  map_ch_goodssearch_goods to map_ch_goodssearch_goods_20210514

5、 DB::Exception: Memory limit (for query) exceeded: would use 9.32 GiB (attempt to allocate chunk of 8388608 bytes), maximum: 9.31 GiB: While executing AggregatingTransform. (MEMORY_LIMIT_EXCEEDED)

这个网络上的文档比较多。。临时的方案是直接set ,永久的方案是user.xml里增加配置 ,不过不知道是有意还是无意, 都漏了一个非常重要的点 

<profiles> 里的参数也需要调整 。这个直接限制了用户的内存用量。单纯调用户内存是无效,默认情况下是10000000000就是9.31gb    这里调整完了再去<users>下调整 

即
    <profiles>
        <!-- Default settings. -->
        <default>
            <!-- Maximum memory usage for processing single query, in bytes. -->
            <max_memory_usage>100000000000</max_memory_usage>

这里也要调整  我直接复用了default  你可以根据你本身的调整
然后再调整user
    <users>
      <admin>
        <password>pwd</password>
        <access_management>1</access_management>
        <networks incl="networks" replace="replace">
                <ip>::/0</ip>
        </networks>
        <profile>default</profile>
        <quota>default</quota>
        <max_memory_usage>100000000000</max_memory_usage>
        <use_uncompressed_cache>0</use_uncompressed_cache>
      </admin>
</users>

6、DB::Exception: default: Authentication failed: password is incorrect or there is no user with such name.

clickhouse 创建分布式表(distributed)报错

需要在config.xml里给所有节点配上账密

举例

<enic_cluster>
            <shard>
                <replica>
                    <host>190.***.***.175</host>
                    <port>9000</port>
                    <user>default</user>
                    <password>okE7heh7</password>
                </replica>
            </shard>
            <shard>
                <replica>
                    <host>190.***.***.176</host>
                    <port>9000</port>
                    <user>default</user>
                    <password>okE7heh7</password>
                </replica>
            </shard>
            <shard>
                <replica>
                    <host>190.***.***.177</host>
                    <port>9000</port>
                    <user>default</user>
                    <password>okE7heh7</password>
                </replica>
            </shard>
        </enic_cluster>

7、<Error> Application: DB::Exception: Listen [::]:8123 failed: Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = DNS error: EAI: Address family for hostname not supported 

这不是因为服务器上端口被占用了 是因为你没有注释掉ipv6的地址

注释掉就行了


8、no Zookeeper configuration in server config. (NO_ELEMENTS_IN_CONFIG)

zk的链接没问题  这是因为ck要求用主机名的原因,换成主机名就行了

例子

<zookeeper>
    <node>
        <host>zoo01.yandex.ru</host>
        <port>2181</port>
    </node>
    <node>
        <host>zoo02.yandex.ru</host>
        <port>2181</port>
    </node>
    <node>
        <host>zoo03.yandex.ru</host>
        <port>2181</port>
    </node>
</zookeeper>

9、导入csv格式的文件时,因行格式不统一时报错的临时解决办法,列的数量和列属性不一致时

指定容错参数:

--input_format_allow_errors_num arg       指定允许存在错误的行数或次数(忽略错误,执行下一行)
  --input_format_allow_errors_ratio arg         (百分比)            

举个例子      

cat xab | clickhouse-client -h 10.20.2.18 -u admin --password 123.com   --ignore-error  --input_format_allow_errors_num 100 --format_csv_delimiter "#" --query="insert into ai_datalake.t_tencent_statistic_all FORMAT CSVWithNames"

当然最终还是需要去排查具体什么问题

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值