Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga3M8-0000gz-AJ for pgsql-general@arkaria.postgresql.org; Thu, 20 Dec 2018 18:47:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ga3M5-0000Wr-Is for pgsql-general@arkaria.postgresql.org; Thu, 20 Dec 2018 18:47:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga3M5-0000WV-2g for pgsql-general@lists.postgresql.org; Thu, 20 Dec 2018 18:47:33 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga3M1-0001pQ-VE for pgsql-general@lists.postgresql.org; Thu, 20 Dec 2018 18:47:31 +0000 Received: by mail-qt1-x844.google.com with SMTP id l11so2986397qtp.0 for ; Thu, 20 Dec 2018 10:47:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=bBcMr7/WvsebcxApX4vf4C3kFOAU+mjv2eBlpiF5vDs=; b=DgvPoFJY5yAlWif8x9K/ZUb3PRsD65LZBlXLvftz/nEyG2r7lt92iSftHQW+P+/gAY NguJaCmgV2pGfGuamBjaqIU2HRh0XsCRAtOD8fJuFnUbk+tR4aHg1MZSWo7qHWYD1gW3 RPHnhHQypYNFomVdQXbluXFVXHoP2XSyM2QonAX+QL429+qYBwGAyX3xv6Gaen7aT1lt 8wOGTEmNFkyCn/Hz3eSgnPVy+CzsDp/b8GwVa7MubT3HSzJPRfnmkh6anWTxIbq6qmvE Vd92WCNqxDKG1lDvA+FWKO3bfkojEX7OC1HWBQSiXGwz6I5CP69WCU9f/I61YBzoeT9c plgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=bBcMr7/WvsebcxApX4vf4C3kFOAU+mjv2eBlpiF5vDs=; b=mSe8K1HJza+EauIeeY5l+5AVdjGZYm+yavarkf6fNE0PiRV26WMg9Xvx00mSFuAnEd S3qeVVInEwtb64M1YQFjk4Sku0eT2ZPucMGdXLIq9n1AUCF5DsuvRONq2d/Rgl8UCmP/ mCsJuj5NSPDyfZAyN6udDsTQ5WGxdLajnzNvnq1Mm5r6nushccYAETrUHMz58ETymJO4 YLWMFzzJaYOQPNncygdmG1attpKsBA/H3r8qQJmNLkMKOQbHZohlIupEo5la8xV9De+g UBvsx82d1iiC+0PcRzHeD1ldZTYWI5vITUyJ/7RvR2tkbKkF5PBBeKi7CkEggXoUjLfH SP/g== X-Gm-Message-State: AA+aEWZQi07DmdeKhoQNrJnzUHL7UhFZqAyNrWpSK4lGXMKUuRhp+bP+ jWiTTrbOTVsBIBNFNW6xIBzSMQ== X-Google-Smtp-Source: AFSGD/UIc8JY+HqTW6RsR+Gnsn5VzqHtpBTIZ+VZnoMRzAecDATyRMt2BKMA9YdgBmvt/g75FcTRZg== X-Received: by 2002:aed:2663:: with SMTP id z90mr27097528qtc.100.1545331649078; Thu, 20 Dec 2018 10:47:29 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id p48sm4720312qtp.62.2018.12.20.10.47.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Dec 2018 10:47:28 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id AB6326A7; Thu, 20 Dec 2018 15:47:26 -0300 (-03) Date: Thu, 20 Dec 2018 15:47:26 -0300 From: Alvaro Herrera To: "Kumar, Virendra" Cc: "pgsql-general@lists.postgresql.org" Subject: Re: Multiple LDAP Servers for ldap Authentication Message-ID: <20181220184726.o2famnw2hucj734a@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello Virendra On 2018-Dec-20, Kumar, Virendra wrote: > I am going through ldap authentication documents in PostgreSQL and found that we can specify multiple ldap servers but sure how. I have put two entries in double quotes like below: > -- > host all all 0.0.0.0/0 ldap ldapserver="server1.com server2.com" ldapprefix=PROD01\ > > There is no complain when reloading the pg_hba.conf file however when server1.com is down the connection just times out instead of trying server2. Does anybody have idea how to configure it or how to make this work. Reading the server code, I find this rather surprising. The ldapserver string is passed directly to ldap_init(), which per its manual should use the multiple servers: "The host parameter may contain a blank-separated list of hosts to try to connect to, and each host may optionally by of the form host:port." ( quoted from https://linux.die.net/man/3/ldap_init ) Maybe the library you have does not behave in the same way? It would be good to confirm that the LDAP library you have is OpenLDAP and not something else. Can you run an `ldd` on the postgres binary and see what the output says about ldap? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services