From user-return-12564-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Wed Jan 22 10:03:54 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id F3EC618064C for ; Wed, 22 Jan 2020 11:03:53 +0100 (CET) Received: (qmail 94287 invoked by uid 500); 22 Jan 2020 10:03:52 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 94275 invoked by uid 99); 22 Jan 2020 10:03:52 -0000 Received: from Unknown (HELO mailrelay1-lw-us.apache.org) (10.10.3.159) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jan 2020 10:03:52 +0000 Received: from [172.30.64.162] (unknown [185.63.45.212]) by mailrelay1-lw-us.apache.org (ASF Mail Server at mailrelay1-lw-us.apache.org) with ESMTPSA id 2FE191077 for ; Wed, 22 Jan 2020 10:03:52 +0000 (UTC) From: Andor Molnar Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Zookeeper resolving to old host IP addresses Date: Wed, 22 Jan 2020 11:03:50 +0100 References: To: user@zookeeper.apache.org In-Reply-To: Message-Id: <0839EC0C-7087-41E6-A0EC-2A3966A65FBD@apache.org> X-Mailer: Apple Mail (2.3445.104.11) Hi Ram, As far as I can see from the code, ZooKeeper uses the standard Java = calls getByName() and getAllByName() every time it=E2=80=99s trying to = connect to a server. =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 // zookeeper.ipReachableTimeout is not defined if (ipReachableTimeout <=3D 0) { address =3D InetAddress.getByName(this.hostname); } else { address =3D getReachableAddress(this.hostname, ipReachableTimeout); } =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 ZK doesn=E2=80=99t (and definitely should not) cache IP addresses. = It=E2=80=99s either the cache of JVM or your DNS server. Dynamic reconfig is available in 3.5.x versions which are already stable = now and I think with that you don=E2=80=99t need to reuse existing = hostnames. Instead use reconfig commands to properly remove old nodes = and add new ones. Sounds like more cumbersome, but maybe more reliable. Andor > On 2020. Jan 21., at 23:14, rammohan ganapavarapu = wrote: >=20 > But still happening for me, is there any config on zookeeper side to = make > this fix to work? >=20 > Ram >=20 > On Tue, Jan 21, 2020 at 2:12 PM Michael Han wrote: >=20 >> Could be ZOOKEEPER-1506, though this should be fixed already in = 3.4.14. >>=20 >> On Tue, Jan 21, 2020 at 2:01 PM rammohan ganapavarapu < >> rammohanganap@gmail.com> wrote: >>=20 >>> Hi Enrico, >>>=20 >>> I see same with both 3.4.5 and 3.4.14 >>>=20 >>> Ram >>>=20 >>> On Tue, Jan 21, 2020 at 1:53 PM Enrico Olivelli = >>> wrote: >>>=20 >>>> Hi, >>>> Which version of ZK are you using? >>>> Enrico >>>>=20 >>>>=20 >>>> Il mar 21 gen 2020, 22:51 rammohan ganapavarapu < >> rammohanganap@gmail.com >>>>=20 >>>> ha scritto: >>>>=20 >>>>> Hi, >>>>>=20 >>>>> Does zookeeper cache the host IP? if so how long does it cache? I >> have >>> a >>>>> zk cluster in autoscaling groups and when a new node comes up, = other >>>> nodes >>>>> still resolving to old IP. Is there any setting to invalidate dns >> cache >>>> for >>>>> zookeeper? or is it jvm dns cache? until other nodes resolves to = new >>> IP, >>>>> this node not able to join the cluster. >>>>>=20 >>>>> Thanks, >>>>> Ram >>>>>=20 >>>>=20 >>>=20 >>=20