Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1BCF2200BA7 for ; Fri, 7 Oct 2016 03:57:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1A3D5160AE0; Fri, 7 Oct 2016 01:57:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 56C08160ADB for ; Fri, 7 Oct 2016 03:57:56 +0200 (CEST) Received: (qmail 77698 invoked by uid 500); 7 Oct 2016 01:57:55 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 77686 invoked by uid 99); 7 Oct 2016 01:57:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Oct 2016 01:57:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id AF71718023E for ; Fri, 7 Oct 2016 01:57:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=messagingengine.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ogCl9FqLKcQ0 for ; Fri, 7 Oct 2016 01:57:52 +0000 (UTC) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 5EB195F253 for ; Fri, 7 Oct 2016 01:57:52 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A39962060E for ; Thu, 6 Oct 2016 21:57:45 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Thu, 06 Oct 2016 21:57:45 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=bXNikxV8+bGJXwxWLy1vQMsZugU=; b=DTpgG U0VFCk2vdB43o2ZH37bB3ytVMndirnaruzVmJ9ABjE7vUq6YC//9jF8KOiqY2/6d LrHOkIKBeOA5nC4xHvEFjgvU9ixV2beJCruER+AjnmVm6Cn8K9/dbL83yhhUc6Dh XOS8vwNere0/mkazbqSVUFABSotJGN2Lf9DGMA= X-Sasl-enc: xJd4XaQvg7ImjDNNq67sTSrVMq/kC43s6Zj1IIBkyIg0 1475805465 Received: from [192.168.1.111] (c-50-157-191-33.hsd1.ma.comcast.net [50.157.191.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 60400CC080 for ; Thu, 6 Oct 2016 21:57:45 -0400 (EDT) From: Adam Kocoloski Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\)) Subject: Checking for cluster peers using SRV records on startup Message-Id: <38F54B23-2D65-463E-9768-323C9CB6AEE2@apache.org> Date: Thu, 6 Oct 2016 21:57:44 -0400 To: dev@couchdb.apache.org X-Mailer: Apple Mail (2.3226) archived-at: Fri, 07 Oct 2016 01:57:57 -0000 Hi all, Lately I=E2=80=99ve been thinking about how to ease the onramp for users = to get a clustered CouchDB setup running. I think the Kubernetes work = shows a lot of promise. One of the aspects of that work is the service = discovery element; each node in a cluster should be able to = automatically find its peers and connect to them. Kubernetes = accomplishes this using SRV records; a DNS lookup for a given named = service will return the FQDNs of all the live members of the =E2=80=9CPet = Set=E2=80=9D. The SRV approach is enough of a standard[1] that I wonder if we ought to = code for it directly in mem3. It=E2=80=99d eliminate the need for a = =E2=80=9Csidecar=E2=80=9D container in Kubernetes deployments and I can = imagine that it will prove more generally useful. The idea would be for = mem3 to check if the CouchDB node is running in distributed node, and if = it is, fire off a DNS lookup on the domain name, then attempt to connect = with any other targets that are included in the record set in the DNS = response. What do you think? If no one objects I=E2=80=99ll file a JIRA and see = what we come up with. Adam [1]: https://tools.ietf.org/html/rfc2782=