My understanding is that a node resolves zk dns every time it reconnect
(after it lost older zk connection). So, unless one have dumb dns cache new
instance zk should be picked after older one drop. There's a subtle detail
that dns should be repeated for faster rotation eg ZK_HOST=
zk-headless:2181,zk-headless:2181
Happy scaling!

On Thu, Sep 26, 2019 at 1:58 PM LEE Ween Jiann <wjlee.2...@phdcs.smu.edu.sg>
wrote:

> SMU Classification: Restricted
>
> Yes zookeeper supports dynamic change from 3.5.x.
> I am referring to Solr here.
>
> You would need to specify the list of zookeeper servers in solr.in.sh or
> solr.in.cmd or as -z param.
>
> https://lucene.apache.org/solr/guide/8_1/setting-up-an-external-zookeeper-ensemble.html
> But scaling zookeeper after helm deployment does not change this list of
> ZK_HOST automatically, this is intended as helm/k8s does not do this for
> you and you should not change this manually.
>
> K8s has DNS that allow you to resolve a single domain name to multiple IP.
> Let say this domain is zk-headless. Then ZK_HOST="zk-headless:2181".
> Solr should resolve all instance of zookeeper from a single domain name.
>
> nslookup zk-headless
> Server:  xxx
> Address:  xxx
> Non-authoritative answer:
> Name:    zk-headless
> Addresses:
>           10.0.0.11
>           10.0.0.12
>           10.0.0.13
>
> This three addresses will be the zookeeper servers.
>
> -----Original Message-----
> From: Jörn Franke <jornfra...@gmail.com>
> Sent: Thursday, September 26, 2019 6:41 PM
> To: solr-user@lucene.apache.org
> Subject: Re: How to resolve a single domain name to multiple zookeeper IP
> in Solr
>
> The newest zk version supports dynamic change of the zk instances:
>
> https://zookeeper.apache.org/doc/r3.5.3-beta/zookeeperReconfig.html
>
> However, for that to work properly in case of a Solr restart you always
> need a minimal set of servers that do not change and just increase/decrease
> additional ones.
>
> > Am 26.09.2019 um 12:22 schrieb LEE Ween Jiann <
> wjlee.2...@phdcs.smu.edu.sg>:
> >
> > I'm trying to modify the helm chart for solr such that it works for
> kubernetes (k8s) deployment correctly. There needs to be a particular
> change in the way solr resolves zookeepers hostname in order for this to
> happen.
> >
> > Let me explain...
> > The standard way to configure solr is by listing all the zookeeper
> hostname/IP in either:
> >
> >  *   solr.in.sh or solr.in.cmd
> >  *   zoo.cfg
> >  *   -z param
> > For example: ZK_HOST="zk1:2181,zk2:2181,zk3:2181".
> >
> > However, when it comes to cloud deployment, in particular on k8s using
> helm chart, this is not an ideal situation as the user is required to
> modify zk_host each time they scale the number of zookeeper up/down.
> >
> >  *   For example (scale down): ZK_HOST="zk1:2181,zk2:2181".
> >  *   For example (scale up):
> ZK_HOST="zk1:2181,zk2:2181,zk3:2181,zk4:2181".
> >
> > This cannot be done automatically using in helm/k8s. In k8s, this
> parameter should remain static, meaning that it should not be changed after
> deployment of the chart.
> >
> >  *   For example (k8s): ZK_HOST="zk-headless:2181".
> >
> > What a chart can do is to create a service with a DNS name such as
> zk-headless that contains all the IP of the zookeepers, and as zookeeper
> scales, the number of IP resolved from zk-headless changes. Could solr to
> resolve multiple zookeeper IPs from a single name?
> >
> > Cheers,
> > Ween Jiann
>


-- 
Sincerely yours
Mikhail Khludnev

Reply via email to