clickhouse-operator icon indicating copy to clipboard operation
clickhouse-operator copied to clipboard

Any support of Clickhouse-keeper?

Open TheXs opened this issue 4 years ago • 16 comments

Hi, there. Is there any plan to support configuring param "clickhouse-keeper: other than "zookeeper" in deployment yaml? Just realized both clickhouse and clickhouse-operator only support hard-coded configs (server-id) for that feature. Which is reasonably inconvinient on cluster scale up(in this way you can change shardCount or replicaCount to achieve). Regards!

TheXs avatar Nov 06 '21 09:11 TheXs

We are investigating the best way to support Keeper. The best practices are yet to be developed.

alex-zaitsev avatar Nov 06 '21 11:11 alex-zaitsev

What's the progress? There is a desire to try with the built-in clickhouse-keeper? )) Any tests/examples of it?

pieceofchalk avatar May 30 '22 15:05 pieceofchalk

Same. I'm currently evaluating clickhouse keeper, but as a seperate deployment to clickhouse itself using the example: https://github.com/Altinity/clickhouse-operator/blob/master/deploy/clickhouse-keeper/clickhouse-keeper-3-nodes.yaml It works but isn't exactly production ready for my use case.

It would be amazing to have it rolled into the operator. Happy to help with testing.

spoofedpacket avatar Jun 23 '22 15:06 spoofedpacket

any progress?

jasine avatar Sep 26 '22 12:09 jasine

I'm testing out an automated setup in with clickhouse keeper. You can see it here.

davidspek avatar Jan 19 '23 11:01 davidspek

@spoofedpacket when using the clickhouse-keeper-3-nodes.yaml do you specify the service clickhouse-keeper.namespace.svc inside the zookeeper setting in the clickhouse server, or do you explicitly specify each of the pod via the headless service like clickhouse-keeper-0.clickhouse-keeper-headless.namespace.svc + clickhouse-keeper-1.clickhouse-keeper-headless.namespace.svc + clickhouse-keeper-2.clickhouse-keeper-headless.namespace.svc?

lazywei avatar Jan 27 '23 01:01 lazywei

@lazywei I suppose it's the latter one using headless service. The first one will make sense when only one instance of keeper is being used.

prashant-shahi avatar Jan 27 '23 11:01 prashant-shahi

@prashant-shahi thanks, that's what i figured. For people who's trying to figure this out: for some reason I'm unable to run the keeper healthily with the clickhouse/clickhouse-keeper image, so I just switch to clickhouse/clickhouse-server image but run the clickhouse-keeper command instead. With very similar config as above, it works.

lazywei avatar Jan 27 '23 17:01 lazywei

@lazywei I suppose it's the latter one using headless service. The first one will make sense when only one instance of keeper is being used.

Yep, that's what I'm doing

spoofedpacket avatar Feb 22 '23 16:02 spoofedpacket

Just thought I'd report back here as well that the setup I describe in https://github.com/Altinity/clickhouse-operator/issues/959#issuecomment-1455956595 is what we are currently using in production to configure ClickHouse-Keeper within the ClickHouse installation CR and it's working well. It should be possible to integrate this into the operator without needing a dedicated CRD with some automated smarts and/or restriction around scaling but I don't think I will have the time to do this any time soon.

davidspek avatar Mar 06 '23 11:03 davidspek

I'm sorry. Could you please help me? I'm trying to use the example: clickhouse-keeper-3-nodes.yaml And I got the keeper deployment but it doesn't connect to ClickHouse. I think, I have bad configuration. Here is the part of my cluster config:

metadata:
  name: "data-warehouse"
spec:
  configuration:
    zookeeper:
      nodes:
        - host: clickhouse-keeper-0
           port: 2181
        - host: clickhouse-keeper-1
           port: 2181
        - host: clickhouse-keeper-2
          port: 2181
    clusters:
      - name: "staging"
        layout:
          shardsCount: 1
          replicasCount: 3

I think I need to put different host for the keeper, but I don't understand. Thanks and sorry for

stasDomb avatar Mar 16 '23 14:03 stasDomb

The problem was fixed when I just put service name as a host:

      nodes:
        - host: clickhouse-keeper
           port: 2181

stasDomb avatar Mar 16 '23 15:03 stasDomb

I am also struggling with the same issue,

I have installed clickhouse-operator using helm here without making any change in values files. I have also installed cluster using this with 1 shard and 2 replicas.

Have also configured separate keeper config clickhouse-keeper-3-nodes.yaml and in my clickhouse cluster I have tried nodes:

        - host: clickhouse-keeper-0
           port: 2181
        - host: clickhouse-keeper-1
           port: 2181
        - host: clickhouse-keeper-2
          port: 2181

as well as this

  nodes:
        - host: clickhouse-keeper
           port: 2181

but at the time of creating a table that I want to replicate I get this error,

Received exception from server (version 22.3.19): Code: 999. DB::Exception: Received from localhost:9000. DB::Exception: All connection tries failed while connecting to ZooKeeper. nodes: 100.68.182.175:2181 Code: 999. Coordination::Exception: Keeper server rejected the connection during the handshake. Possibly it's overloaded, doesn't see leader or stale (Connection loss): while receiving handshake from ZooKeeper. (KEEPER_EXCEPTION) (version 22.3.19.6 (official build)), 100.68.182.175:2181 Code: 999. Coordination::Exception: Keeper server rejected the connection during the handshake. Possibly it's overloaded, doesn't see leader or stale (Connection loss): while receiving handshake from ZooKeeper. (KEEPER_EXCEPTION) (version 22.3.19.6 (official build)), 100.68.182.175:2181 Code: 209. DB::NetException: Timeout exceeded while reading from socket (100.68.182.175:2181, 10000 ms): while receiving handshake from ZooKeeper. (SOCKET_TIMEOUT) (version 22.3.19.6 (official build)), 100.68.182.175:2181

How do I tell clickhouse-cluster to use keeper url instead of localhost ?

sourabhaggrawal avatar Mar 28 '23 12:03 sourabhaggrawal

I am also struggling with the same issue,

I have installed clickhouse-operator using helm here without making any change in values files. I have also installed cluster using this with 1 shard and 2 replicas.

Have also configured separate keeper config clickhouse-keeper-3-nodes.yaml and in my clickhouse cluster I have tried nodes:

        - host: clickhouse-keeper-0
           port: 2181
        - host: clickhouse-keeper-1
           port: 2181
        - host: clickhouse-keeper-2
          port: 2181

as well as this

  nodes:
        - host: clickhouse-keeper
           port: 2181

but at the time of creating a table that I want to replicate I get this error,

Received exception from server (version 22.3.19): Code: 999. DB::Exception: Received from localhost:9000. DB::Exception: All connection tries failed while connecting to ZooKeeper. nodes: 100.68.182.175:2181 Code: 999. Coordination::Exception: Keeper server rejected the connection during the handshake. Possibly it's overloaded, doesn't see leader or stale (Connection loss): while receiving handshake from ZooKeeper. (KEEPER_EXCEPTION) (version 22.3.19.6 (official build)), 100.68.182.175:2181 Code: 999. Coordination::Exception: Keeper server rejected the connection during the handshake. Possibly it's overloaded, doesn't see leader or stale (Connection loss): while receiving handshake from ZooKeeper. (KEEPER_EXCEPTION) (version 22.3.19.6 (official build)), 100.68.182.175:2181 Code: 209. DB::NetException: Timeout exceeded while reading from socket (100.68.182.175:2181, 10000 ms): while receiving handshake from ZooKeeper. (SOCKET_TIMEOUT) (version 22.3.19.6 (official build)), 100.68.182.175:2181

How do I tell clickhouse-cluster to use keeper url instead of localhost ?

My keeper nodes were having issues, this issue got sorted after fixing that.

sourabhaggrawal avatar Mar 29 '23 08:03 sourabhaggrawal

@sourabhaggrawal What was the issue with keeper nodes and how did you fix it?

madhur-df avatar Apr 14 '24 14:04 madhur-df

Hi @madhur-df Its been long time now but I vividly remember it was because my keeper was not running healthy. So I guess once that got sorted my issue got sorted.

sourabhaggrawal avatar Apr 15 '24 11:04 sourabhaggrawal