Replication with ZooKeeper, problem

1,105 views
Skip to first unread message

Eric Mortensen

unread,
Aug 26, 2016, 9:53:10 AM8/26/16
to ClickHouse
Hi,

I am trying to set up 2-node replication with Zookeeper and I was able to create a replicated table on one of the nodes, but when attempting to create the same table/replica on the other node, I get: Code: 225. DB::Exception: Received from 10.1.2.118:9000. DB::Exception: Can't create replicated table without ZooKeeper.

Using ClickHouse  1.1.54010 and Zookeeper 3.4.6. 

I added the following to the config.xml on each node:

<zookeeper-servers>
    <node>
        <host>10.1.2.118</host>
        <port>2181</port>
    </node>
    <node>
        <host>10.1.2.237</host>
        <port>2181</port>
    </node>
</zookeeper-servers>

I installed zookeeper on both nodes, but started it only on 10.1.2.237. I can connect to zookeeper from both nodes. 

I successfully created the replicated table on 10.1.2.237, but  not on 10.1.2.118 (got the error above). Log level is trace, but there is no indication in the server logs about whether or not Zookeeper config is correct, or if the server is able to connect to zookeeper.

Here is the CREATE TABLE command:

CREATE TABLE ontime_replica (     ...   ) ENGINE = ReplicatedMergeTree(     '/clickhouse_perftest/tables/01/ontime',     '01',     FlightDate,     (Year, FlightDate),     8192);

(from the quick start guide)

I could not find a step-by-step guide to setting up replication, so if someone has an idea what I could be doing wrong I would appreciate any help ...

Regards,
Eric

Eric Mortensen

unread,
Aug 26, 2016, 3:16:43 PM8/26/16
to ClickHouse
Rookie mistake! 

<zookeeper-servers> was supposed to be <zookeeper>

Changed it and it worked.

Eric

sunil sunny

unread,
Aug 13, 2018, 6:32:10 AM8/13/18
to ClickHouse
Thanks eric....Same mistake i have also done.. It is solved because of you.

sunil sunny

unread,
Aug 22, 2018, 8:43:53 AM8/22/18
to ClickHouse
Hey Eric,

I am facing problems in replication.could you please help me.


I am able to create replicated tables in one of the engine..BUt they are not rplicating in the other server.


On Saturday, August 27, 2016 at 12:46:43 AM UTC+5:30, Eric Mortensen wrote:
Reply all
Reply to author
Forward
0 new messages