Return-Path: X-Original-To: apmail-brooklyn-dev-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F1BE1109F6 for ; Mon, 19 Jan 2015 10:34:53 +0000 (UTC) Received: (qmail 28691 invoked by uid 500); 19 Jan 2015 10:34:56 -0000 Delivered-To: apmail-brooklyn-dev-archive@brooklyn.apache.org Received: (qmail 28659 invoked by uid 500); 19 Jan 2015 10:34:55 -0000 Mailing-List: contact dev-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list dev@brooklyn.incubator.apache.org Received: (qmail 28648 invoked by uid 99); 19 Jan 2015 10:34:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jan 2015 10:34:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 19 Jan 2015 10:34:54 +0000 Received: (qmail 26537 invoked by uid 99); 19 Jan 2015 10:34:34 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jan 2015 10:34:34 +0000 Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 0EB631A0041 for ; Mon, 19 Jan 2015 10:34:33 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id em10so4533483wid.1 for ; Mon, 19 Jan 2015 02:34:31 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.185.243 with SMTP id ff19mr8844827wjc.126.1421663671911; Mon, 19 Jan 2015 02:34:31 -0800 (PST) Received: by 10.194.106.97 with HTTP; Mon, 19 Jan 2015 02:34:31 -0800 (PST) In-Reply-To: References: Date: Mon, 19 Jan 2015 10:34:31 +0000 Message-ID: Subject: Re: "force resolution of localhost to be loopback, otherwise we hit problems" From: Richard Downer To: Brooklyn dev Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Sam, I would guess that if the hostname/domain name are properly configured everything should work. Unfortunately, it's easy to *not* quite configure networking correctly. My understanding of the canonical way to set the system hostname and domain name is as follows: /etc/hosts: 127.0.0.1 hostname hostname.domainname localhost # that must be the first non-comment line Configure the system hostname (without domainname); IIRC, on Debian-derivatives you write it to the file /etc/hostname, and on RedHat-derivatives there's a variable in /etc/sysconfig/network Then either run "hostname newhostname" or "service network restart" or reboot. Check it works: # hostname (returns the bare hostname) # hostname --fqdn (returns the hostname and DNS domainname) On 18 January 2015 at 10:32, Sam Corbett wrote: > BrooklynServiceAttributes defines the property and has a comment saying: > > /** in some cases localhost does not resolve correctly > * (e.g. to an interface which is defined locally but not in operation, > * or where multiple NICs are available and java's > InetAddress.getLocalHost() strategy is not doing what is desired); > * use this to supply a specific address (e.g. "127.0.0.1" or a specific IP > on a specific NIC or FW) > */ > > I guess this answers my question but it doesn't give me much assurance. > > On 18 January 2015 at 10:02, Sam Corbett > wrote: > >> Hi, >> >> The `brooklyn` launch script sets >> `-Dbrooklyn.location.localhost.address=127.0.0.1` with the cryptic >> explanation that 'otherwise we hit problems'. Can anybody explain what >> problems are avoided? I have a case in which I'd like the hostname of a >> localhost location to be the hostname of the machine, but I'd also like to >> know what will happen if I change or remove the flag. >> >> Thanks, >> >> Sam >>