clickhouse集群Distributed表读出多条重复数据
发布于 4 个月前 作者 luotianyang 580 次浏览 来自 问答

各位大神,初学clickhouse遇到一个问题,搭建3个节点的clickhouse集群,设置的是3个分片,3个副本。 建立了local表是megertree引擎,同时建立了一个distribute表,关联local表。 往一个节点的local表中插入数据,但是从distributed表中读出3条数据。这个是怎么回事呢?哪位大神能帮忙解答一下吗?

3 回复

配置如下: <yandex> <clickhouse_remote_servers> <perftest_3shards_1replicas> <shard> <internal_replication>true</internal_replication> <replica> <host>IP1</host> <port>9000</port> </replica> <replica> <host>IP2</host> <port>9000</port> </replica> <replica> <host>IP3</host> <port>9000</port> </replica> </shard> <shard> <internal_replication>true</internal_replication> <replica> <host>IP1</host> <port>9000</port> </replica> <replica> <host>IP2</host> <port>9000</port> </replica> <replica> <host>IP3<host> <port>9000</port> </replica>
</shard> <shard> <internal_replication>true</internal_replication> <replica> <host>IP1</host> <port>9000</port> </replica> <replica> <host>IP2</host> <port>9000</port> </replica> <replica> <host>IP3</host> <port>9000</port> </replica> </shard> </perftest_3shards_1replicas> </clickhouse_remote_servers>

<zookeeper-servers> <node index=“1”> <host>IP1</host> <port>2181</port> </node>

<node index=“2”> <host>IP2</host> <port>2181</port> </node>

<node index=“3”> <host>IP3</host> <port>2181</port> </node>

</zookeeper-servers>

<macros> <shard>01</shard><replica>01</replica> </macros>

<networks> <ip>::/0</ip> </networks>

<clickhouse_compression> <case> <min_part_size>10000000000</min_part_size>
<min_part_size_ratio>0.01</min_part_size_ratio> <method>lz4</method> </case> </clickhouse_compression>

</yandex>

<!--shard part-->

<!–数据分片1–> <shard> <internal_replication>true</internal_replication> <replica> <host>IP1</host> <port>9000</port> </replica> <replica> <host>IP2</host> <port>9000</port> </replica> <replica> <host>IP3</host> <port>9000</port> </replica> </shard> <!–数据分片2–> <shard> <internal_replication>true</internal_replication> <replica> <host>IP4</host> <port>9000</port> </replica> <replica> <host>IP5</host> <port>9000</port> </replica> <replica> <host>IP6</host> <port>9000</port> </replica> </shard> <!–数据分片3–> <shard> <internal_replication>true</internal_replication> <replica> <host>IP7</host> <port>9000</port> </replica> <replica> <host>IP8</host> <port>9000</port> </replica> <replica> <host>IP9</host> <port>9000</port> </replica> </shard>

@bondy 嗯,已经解决,之前没配置的ip有重复,谢谢了~

回到顶部