首页 / 更多教程 / clickhouse踩过的坑-----建表建库on cluster命令使用超时(code:159)distributed_ddl_task_timeout (=180) seconds
clickhouse踩过的坑-----建表建库on cluster命令使用超时(code:159)distributed_ddl_task_timeout (=180) seconds
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了clickhouse踩过的坑-----建表建库on cluster命令使用超时(code:159)distributed_ddl_task_timeout (=180) seconds,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1790字,纯文字阅读大概需要3分钟。
内容图文
![clickhouse踩过的坑-----建表建库on cluster命令使用超时(code:159)distributed_ddl_task_timeout (=180) seconds](/upload/InfoBanner/zyjiaocheng/1027/81ce576550744e97ad4c1e5ab156b3ad.jpg)
建库建表语句
create database test on cluster clickhouse_cluster;
报错信息
↘ Progress: 0.00 rows, 0.00 B (0.00 rows/s., 0.00 B/s.) Received exception from server (version 20.1.4):
Code: 159. DB::Exception: Received from localhost:9000. DB::Exception: Watching task /clickhouse/task_queue/ddl/query-0000000011 is executing longer than distributed_ddl_task_timeout (=180) seconds. There are 2 unfinished hosts (0 of them are currently active), they are going to execute the query in background.
问题解决
在/etc/clickhouse-server/config.xml中修改remote_servers标签
原本标签
<remote_servers incl="clickhouse_remote_servers" >
<!-- Test only shard config for testing distributed storage -->
<test_shard_localhost>
<shard>
<replica>
<host>localhost</host>
<port>9000</port>
</replica>
</shard>
</test_shard_localhost>
<test_cluster_two_shards_localhost>
<shard>
<replica>
<host>localhost</host>
<port>9000</port>
</replica>
</shard>
<shard>
<replica>
<host>localhost</host>
<port>9000</port>
</replica>
</shard>
</test_cluster_two_shards_localhost>
<test_cluster_two_shards>
<shard>
<replica>
<host>127.0.0.1</host>
<port>9000</port>
</replica>
</shard>
<shard>
<replica>
<host>127.0.0.2</host>
<port>9000</port>
</replica>
</shard>
</test_cluster_two_shards>
<test_shard_localhost_secure>
<shard>
<replica>
<host>localhost</host>
<port>9440</port>
<secure>1</secure>
</replica>
</shard>
</test_shard_localhost_secure>
<test_unavailable_shard>
<shard>
<replica>
<host>localhost</host>
<port>9000</port>
</replica>
</shard>
<shard>
<replica>
<host>localhost</host>
<port>1</port>
</replica>
</shard>
</test_unavailable_shard>
</remote_servers>
修改标签
<remote_servers>
<clickhouse_cluster>
<shard>
<replica>
<host>主节点ip</host>
<port>9000</port>
</replica>
<replica>
<host>备份节点ip</host>
<port>9000</port>
</replica>
</shard>
</clickhouse_cluster>
</remote_servers>
内容总结
以上是互联网集市为您收集整理的clickhouse踩过的坑-----建表建库on cluster命令使用超时(code:159)distributed_ddl_task_timeout (=180) seconds全部内容,希望文章能够帮你解决clickhouse踩过的坑-----建表建库on cluster命令使用超时(code:159)distributed_ddl_task_timeout (=180) seconds所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。