Size: a a a

ClickHouse не тормозит

2021 February 15

K

Kiran in ClickHouse не тормозит
I am trying to config 2 replica and 2 shard in 2 server
источник

K

Kiran in ClickHouse не тормозит
server 1
==========
<remote_servers>
   <test_cluster>
    <shard>
  <weight>1</weight>
               <internal_replication>true</internal_replication>
                  <replica>
                   <host>10.66.210.150</host>
                   <port>9440</port>
               </replica>
           </shard>
 <shard>
  <weight>2</weight>
               <internal_replication>true</internal_replication>
               <replica>
                   <host>10.66.210.149</host>
                   <port>9440</port>
   </replica>
 </shard>
</test_cluster>
</remote_servers>
<macros>
       <shard>01</shard>
<replica>01</replica>
       <cluster>test_cluster</cluster>
</macros>
<macros>
       <shard>02</shard>
<replica>01</replica>
       <cluster>test_cluster</cluster>
</macros>
server 2
=========
<remote_servers>
  <test_cluster>
  <shard>
  <weight>1</weight>
  <internal_replication>true</internal_replication>
  <replica>
   <host>10.66.210.149</host>
   <port>9440</port>
  </replica>
    </shard>
 <shard>
   <weight>2</weight>
  <internal_replication>true</internal_replication>
   <replica>
   <host>10.66.210.150</host>
   <port>9440</port>
  </replica>
 </shard>
</test_cluster>
</remote_servers>
<macros>
       <shard>01</shard>
<replica>02</replica>
       <cluster>test_cluster</cluster>
   </macros>
   <macros>
       <shard>02</shard>
<replica>02</replica>
       <cluster>test_cluster</cluster>
   </macros>
источник

K

Kiran in ClickHouse не тормозит
is this good to proceed
источник

DC

Denny Crane [not a Y... in ClickHouse не тормозит
Kiran
server 1
==========
<remote_servers>
   <test_cluster>
    <shard>
  <weight>1</weight>
               <internal_replication>true</internal_replication>
                  <replica>
                   <host>10.66.210.150</host>
                   <port>9440</port>
               </replica>
           </shard>
 <shard>
  <weight>2</weight>
               <internal_replication>true</internal_replication>
               <replica>
                   <host>10.66.210.149</host>
                   <port>9440</port>
   </replica>
 </shard>
</test_cluster>
</remote_servers>
<macros>
       <shard>01</shard>
<replica>01</replica>
       <cluster>test_cluster</cluster>
</macros>
<macros>
       <shard>02</shard>
<replica>01</replica>
       <cluster>test_cluster</cluster>
</macros>
server 2
=========
<remote_servers>
  <test_cluster>
  <shard>
  <weight>1</weight>
  <internal_replication>true</internal_replication>
  <replica>
   <host>10.66.210.149</host>
   <port>9440</port>
  </replica>
    </shard>
 <shard>
   <weight>2</weight>
  <internal_replication>true</internal_replication>
   <replica>
   <host>10.66.210.150</host>
   <port>9440</port>
  </replica>
 </shard>
</test_cluster>
</remote_servers>
<macros>
       <shard>01</shard>
<replica>02</replica>
       <cluster>test_cluster</cluster>
   </macros>
   <macros>
       <shard>02</shard>
<replica>02</replica>
       <cluster>test_cluster</cluster>
   </macros>
>2 replica and 2 shard in 2 server
Worst idea ever.
Just do 2 replicas 1 shard

OR create 4 VM on 2 servers.
источник

K

Kiran in ClickHouse не тормозит
1shard is good for aggregation query?
источник

DC

Denny Crane [not a Y... in ClickHouse не тормозит
Kiran
1shard is good for aggregation query?
Yes
источник

DC

Denny Crane [not a Y... in ClickHouse не тормозит
Better than circle-replication
источник

K

Kiran in ClickHouse не тормозит
Vm is not a option
источник

K

Kiran in ClickHouse не тормозит
so it is better with 2 replica and 1 shard
источник

DC

Denny Crane [not a Y... in ClickHouse не тормозит
Kiran
so it is better with 2 replica and 1 shard
Definitely
источник

K

Kiran in ClickHouse не тормозит
Create table test1.event_local11 on cluster '{cluster}' (id int)
Engine = ReplicatedMergeTree('/clickhouse/tables/{cluster}/{shard}/test1/tables/event_local11/','{replica}') order by (id);
CREATE TABLE test1.event1 on cluster '{cluster}'
(
   id Int32
)
ENGINE = Distributed('{cluster}', 'test1', 'event_local11', rand())
источник

K

Kiran in ClickHouse не тормозит
distributed table throwing error
источник

K

Kiran in ClickHouse не тормозит
Code: 102. DB::Exception: Received from 10.66.210.149:9440. DB::Exception: Unexpected packet from server 10.66.210.150:9440 (expected Hello or Exception, got Unknown packet): While executing Remote.
источник

K

Kiran in ClickHouse не тормозит
is this because of the setup
источник

K

Kiran in ClickHouse не тормозит
earlier
источник

DC

Denny Crane [not a Y... in ClickHouse не тормозит
Kiran
Code: 102. DB::Exception: Received from 10.66.210.149:9440. DB::Exception: Unexpected packet from server 10.66.210.150:9440 (expected Hello or Exception, got Unknown packet): While executing Remote.
You've missed secure=1
источник

В

Владимир in ClickHouse не тормозит
Denny Crane [not a Yandex bot]
вы неправильно поняли что я написал. В КХ есть две репликации. Детская -- через distributed и настоящая -- через replicated. У вас сейчас обе сразу работают, детская <internal_replication>false , вам дублирует инсерты во все реплики, а потом настроящая снова дублирует, но вам везет что у вас не дублируются записи пока

короче если используете Replicated то internal_replication=true, без обсуждения.
нет у меня ни одной distributed таблицы, настройку internal_replication бесполезно значит трогать (так как “кластера” ни одно нет).
Тогда инетересно откуда эти ошибки в зукипере...
источник

K

Kiran in ClickHouse не тормозит
Denny thanks you very much dear
источник

В

Владимир in ClickHouse не тормозит
также и в кликхаусе нашёл ошибку

2021.02.15 20:42:31.702457 [ 10050 ] {} <Error> fluentbit.log: DB::StorageReplicatedMergeTree::queueTask()::<lambda(DB::StorageReplicatedMergeTree::LogEntryPtr&)>: Code: 235, e.displayText() = DB::Exception: Part 20210215_1670332_1670337_1 (state Committed) already exists, Stack trace (when copying this message, always include the line below):

0. Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x10f1e130 in /usr/bin/clickhouse
...
источник

VR

Vladimir Rudev in ClickHouse не тормозит
Подскажите пожалуйста по storage_policy в Replicated таблицах. В документации написано что на уже созданной таблице это не поменять.
У нас случай когда есть уже много таблиц с данными, и хотелось бы их сделать hot/cold(перекидывать часть текущих данных в hot вовсе не обязательно). Как в данном случае поступают?
Сейчас видится только вариант пересоздать таблицу на зеркале чтоб она все скачала с другого зеркала.. но это будет долго на всей базе(
Нет случайно способа быстрее?
источник