You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Andreas Kemkes <a5...@yahoo.com> on 2012/03/21 18:48:56 UTC

Binding to multiple addresses

Is it possible to bind couchdb to multiple networks?

We have an instance that is currently bound to 127.0.0.1 and the need to make it available externally as well for replication.  I don't think we can switch just to external w/o leaving some internal processes in the dust.

I've tried ssh -L, but it seems prohibitively slow.

Any suggestions are welcome.  Thanks in advance.

Re: Binding to multiple addresses

Posted by Keith Gable <zi...@ignition-project.com>.
Also, you won't be able to connect to 0.0.0.0 itself because it is a
special address used by the networking stack in the OS to mean all
adapters. So if 127.0.0.1 and your public address are working, you did it
right.
On Nov 28, 2012 5:28 AM, "Dave Cottlehuber" <dc...@jsonified.com> wrote:

> On 28 November 2012 12:06, Lucas Toulouse <lu...@cozycloud.cc>
> wrote:
> > Hello.
> >
> > It's working for me, Gianfranco.
> > I set 0.0.0.0 in my local.ini conf couchdb file. and restart it.
>
> Hi Lucas,
>
> Yes this is an important point. If you edit the ini file, you will
> need to restart couchb daemon/service. If you use the HTTP API,
> CouchDB will Do The Right Thing for you.
>
> > Couch answer on 127.0.0.1 and 10.0.0.X .
> >
> > But the *.*.*.* do not working. (not a matter)
>
> http://www.erlang.org/doc/man/inet.html covers the spec for IPv4 and
> v6 addresses in Erlang. For IPv4 dotted quad is the requirement.
>
> > So, I follow Gianfranco, any doc improvement could be nice. I'm a new
> and I
> > ask me the question during discover Couchdb.
>
> We'd welcome an update if you'd like. The docs live here:
>
> https://github.com/apache/couchdb/tree/docs/share/doc/src
>
> and there's some notes on doing updates here via github:
> http://wiki.apache.org/couchdb/Documentation
>
> > Moreover,
> > Dave , in the Curl -XPUT , you put '" and " around the 0.0.0.0.
> > What is the correct way ?  I use simplequote double quote  IP double
> > simple. But with some character escape problems, I now use juste
> > doublequote IP double quote.
>
> Assuming you are doing this from a shell, yes you do need them - the
> shell strips off the outer set.
>
> e.g. '  "123.45.67.89"  ' is correct.
>
> If you test with curl -v you'll see that the shell removes the ' '
> single quotes, and what we are sending through to CouchDB is actually
> a JSON string snippet, hence the "" double quotes are required.
>
> The validation of these is tightened up in 1.3.x, so it may be you can
> get away without the quotes on earlier versions.
>
> A+
> Dave
>

Re: Binding to multiple addresses

Posted by Dave Cottlehuber <dc...@jsonified.com>.
On 28 November 2012 12:06, Lucas Toulouse <lu...@cozycloud.cc> wrote:
> Hello.
>
> It's working for me, Gianfranco.
> I set 0.0.0.0 in my local.ini conf couchdb file. and restart it.

Hi Lucas,

Yes this is an important point. If you edit the ini file, you will
need to restart couchb daemon/service. If you use the HTTP API,
CouchDB will Do The Right Thing for you.

> Couch answer on 127.0.0.1 and 10.0.0.X .
>
> But the *.*.*.* do not working. (not a matter)

http://www.erlang.org/doc/man/inet.html covers the spec for IPv4 and
v6 addresses in Erlang. For IPv4 dotted quad is the requirement.

> So, I follow Gianfranco, any doc improvement could be nice. I'm a new and I
> ask me the question during discover Couchdb.

We'd welcome an update if you'd like. The docs live here:

https://github.com/apache/couchdb/tree/docs/share/doc/src

and there's some notes on doing updates here via github:
http://wiki.apache.org/couchdb/Documentation

> Moreover,
> Dave , in the Curl -XPUT , you put '" and " around the 0.0.0.0.
> What is the correct way ?  I use simplequote double quote  IP double
> simple. But with some character escape problems, I now use juste
> doublequote IP double quote.

Assuming you are doing this from a shell, yes you do need them - the
shell strips off the outer set.

e.g. '  "123.45.67.89"  ' is correct.

If you test with curl -v you'll see that the shell removes the ' '
single quotes, and what we are sending through to CouchDB is actually
a JSON string snippet, hence the "" double quotes are required.

The validation of these is tightened up in 1.3.x, so it may be you can
get away without the quotes on earlier versions.

A+
Dave

Re: Binding to multiple addresses

Posted by Lucas Toulouse <lu...@cozycloud.cc>.
Hello.

It's working for me, Gianfranco.
I set 0.0.0.0 in my local.ini conf couchdb file. and restart it.

Couch answer on 127.0.0.1 and 10.0.0.X .

But the *.*.*.* do not working. (not a matter)

So, I follow Gianfranco, any doc improvement could be nice. I'm a new and I
ask me the question during discover Couchdb.

Moreover,
Dave , in the Curl -XPUT , you put '" and " around the 0.0.0.0.
What is the correct way ?  I use simplequote double quote  IP double
simple. But with some character escape problems, I now use juste
doublequote IP double quote.

Thank's


Lucas

2012/11/28 Dave Cottlehuber <dc...@jsonified.com>

> On 28 November 2012 08:43, Gianfranco Cecconi <gi...@giacec.co> wrote:
> > That actually did not work to me with CouchDB 1.2.0. 0.0.0.0 appears to
> be
> > binding locally as much as 127.0.0.1 . Could not find any documentation
> about it
> > in the CouchDB wiki at http://wiki.apache.org/couchdb/ .
> >
> > G.
> >
>
> Hi Gianfranco,
>
> bind_address = 0.0.0.0 is a very common customisation.
>
> How are you setting it?
> Can you check that the config change is active in the current config?
>
>     curl  http://admin:passwd@localhost:5984/_config/httpd/bind_address
>
> & optionally set it again via:
>
>     curl  -XPUT
> http://admin:passwd@localhost:5984/_config/httpd/bind_address -d
> '"0.0.0.0"
>
> You can also use `couchdb -c` to see what config files are being used
> and in what order.
>
> A+
> Dave
>

Re: Binding to multiple addresses

Posted by Dave Cottlehuber <dc...@jsonified.com>.
On 28 November 2012 08:43, Gianfranco Cecconi <gi...@giacec.co> wrote:
> That actually did not work to me with CouchDB 1.2.0. 0.0.0.0 appears to be
> binding locally as much as 127.0.0.1 . Could not find any documentation about it
> in the CouchDB wiki at http://wiki.apache.org/couchdb/ .
>
> G.
>

Hi Gianfranco,

bind_address = 0.0.0.0 is a very common customisation.

How are you setting it?
Can you check that the config change is active in the current config?

    curl  http://admin:passwd@localhost:5984/_config/httpd/bind_address

& optionally set it again via:

    curl  -XPUT
http://admin:passwd@localhost:5984/_config/httpd/bind_address -d
'"0.0.0.0"

You can also use `couchdb -c` to see what config files are being used
and in what order.

A+
Dave

Re: Binding to multiple addresses

Posted by Gianfranco Cecconi <gi...@giacec.co>.
That actually did not work to me with CouchDB 1.2.0. 0.0.0.0 appears to be 
binding locally as much as 127.0.0.1 . Could not find any documentation about it 
in the CouchDB wiki at http://wiki.apache.org/couchdb/ .

G.


Re: Binding to multiple addresses

Posted by CGS <cg...@gmail.com>.
Yes, 0.0.0.0 binds CouchDB on all IPv4 interfaces.

CGS




On Wed, Mar 21, 2012 at 7:00 PM, Dave Cottlehuber <da...@muse.net.nz> wrote:

> On 21 March 2012 18:48, Andreas Kemkes <a5...@yahoo.com> wrote:
> > Is it possible to bind couchdb to multiple networks?
> >
> > We have an instance that is currently bound to 127.0.0.1 and the need to
> make it available externally as well for replication.  I don't think we can
> switch just to external w/o leaving some internal processes in the dust.
> >
> > I've tried ssh -L, but it seems prohibitively slow.
> >
> > Any suggestions are welcome.  Thanks in advance.
>
> Does using 0.0.0.0 work to bind on all IPv4 interfaces? I'm not in a
> position to check more than loopback + eth0 but it seems sufficient to
> me.
>
> A+
> Dave
>

Re: Binding to multiple addresses

Posted by Dave Cottlehuber <da...@muse.net.nz>.
On 21 March 2012 18:48, Andreas Kemkes <a5...@yahoo.com> wrote:
> Is it possible to bind couchdb to multiple networks?
>
> We have an instance that is currently bound to 127.0.0.1 and the need to make it available externally as well for replication.  I don't think we can switch just to external w/o leaving some internal processes in the dust.
>
> I've tried ssh -L, but it seems prohibitively slow.
>
> Any suggestions are welcome.  Thanks in advance.

Does using 0.0.0.0 work to bind on all IPv4 interfaces? I'm not in a
position to check more than loopback + eth0 but it seems sufficient to
me.

A+
Dave

Re: Binding to multiple addresses

Posted by Andreas Kemkes <a5...@yahoo.com>.
Yes, thanks that works - shows that i'm not a network guy.  Much appreciated.


________________________________
 From: Martin Hewitt <ma...@thenoi.se>
To: user@couchdb.apache.org 
Sent: Wednesday, March 21, 2012 10:54 AM
Subject: Re: Binding to multiple addresses
 
Have you tried binding your install to 0.0.0.0? That works for us, and we then use whatever domain we need to use to get to the sever, simply addressing it on port 5984.  

Martin 

-- 
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Wednesday, 21 March 2012 at 17:48, Andreas Kemkes wrote:

> Is it possible to bind couchdb to multiple networks?
> 
> We have an instance that is currently bound to 127.0.0.1 and the need to make it available externally as well for replication.  I don't think we can switch just to external w/o leaving some internal processes in the dust.
> 
> I've tried ssh -L, but it seems prohibitively slow.
> 
> Any suggestions are welcome.  Thanks in advance. 

Re: Binding to multiple addresses

Posted by CGS <cg...@gmail.com>.
0.0.0.0 will bind CouchDB to all the IP's defined for your machine. If you
want for a specific IP, replace 127.0.0.1 with that specific IP.

CGS



On Wed, Mar 21, 2012 at 6:54 PM, Martin Hewitt <ma...@thenoi.se> wrote:

> Have you tried binding your install to 0.0.0.0? That works for us, and we
> then use whatever domain we need to use to get to the sever, simply
> addressing it on port 5984.
>
> Martin
>
> --
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
>
>
> On Wednesday, 21 March 2012 at 17:48, Andreas Kemkes wrote:
>
> > Is it possible to bind couchdb to multiple networks?
> >
> > We have an instance that is currently bound to 127.0.0.1 and the need to
> make it available externally as well for replication.  I don't think we can
> switch just to external w/o leaving some internal processes in the dust.
> >
> > I've tried ssh -L, but it seems prohibitively slow.
> >
> > Any suggestions are welcome.  Thanks in advance.
>
>

Re: Binding to multiple addresses

Posted by Martin Hewitt <ma...@thenoi.se>.
Have you tried binding your install to 0.0.0.0? That works for us, and we then use whatever domain we need to use to get to the sever, simply addressing it on port 5984.  

Martin 

-- 
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Wednesday, 21 March 2012 at 17:48, Andreas Kemkes wrote:

> Is it possible to bind couchdb to multiple networks?
> 
> We have an instance that is currently bound to 127.0.0.1 and the need to make it available externally as well for replication.  I don't think we can switch just to external w/o leaving some internal processes in the dust.
> 
> I've tried ssh -L, but it seems prohibitively slow.
> 
> Any suggestions are welcome.  Thanks in advance.