You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Antoine Duchâteau <ad...@gmail.com> on 2015/08/18 11:39:31 UTC

Starting couchd 2.0 under diverse network infrastructures

Hi list,

I've got the following problem with CouchDB 2.0

If I create a database when the computer has one hostname and 
subsequently start the database again when the hostname is different, 
the database exposed on 5984 appears empty because there is a mismatch 
in the node name and fabric does not find the shards anymore.

What is the best way to handle this situation ?
I tried using hostname to force the hostname before launching couchdb 
but it only works if I first disconnect all network connections... Which 
is not really acceptable.

Is there a way to force the hostname CouchDB is going to use ?

Thanks in advance,
Antoine

-- 
*Antoine Duchâteau*
Managing Director
Email : ad@taktik.be <ma...@taktik.be>
GSM : +32 499 534 536

_______________
*TAKTIK SA*
Parc de l'Alliance
Avenue de Finlande 8
1420 Braine l'Alleud
Tel : +32 2 333.58.40
<http://www.taktik.be/>http://www.taktik.be


Re: Starting couchd 2.0 under diverse network infrastructures

Posted by Antoine Duchâteau <ad...@gmail.com>.
That's brilliant. I just wanted to be able to start CouchDB 2.0 in 
single node mode on a laptop.

So, I changed -name couchdb to -name couchdb@127.0.0.1 in vm.args.

I then deleted my _metadata db and the metadata shards manually, got rid 
of the couchdb@mymachine.domain.com in 127.0.0.1:5986/_nodes, replaced 
couchdb@mymachine.domain.com by couchdb@127.0.0.1 in all _dbs documents 
and recreated the _metadata db.

It works great.

That was actually the last piece missing for being able to embed couchdb 
in my OS X app.
Thanks a lot,
Antoine

> Adam Kocoloski <ma...@apache.org>
> 19 août 2015 00:18
> Good question. The node name is set by the vm.args file. It defaults 
> to “-name couchdb” which will cause CouchDB to try to discover the 
> system hostname, but you could set that value directly as “-name 
> couchdb@<FQDN>” or even “-name couchdb@<IPV4>”. The key point is to 
> set it to something that can be routed from other nodes if you ever 
> plan to exercise the clustering capability.
>
> Does that make sense? Cheers,
>
> Adam
>
>
> Antoine Duchâteau <ma...@gmail.com>
> 18 août 2015 11:39
> Hi list,
>
> I've got the following problem with CouchDB 2.0
>
> If I create a database when the computer has one hostname and 
> subsequently start the database again when the hostname is different, 
> the database exposed on 5984 appears empty because there is a mismatch 
> in the node name and fabric does not find the shards anymore.
>
> What is the best way to handle this situation ?
> I tried using hostname to force the hostname before launching couchdb 
> but it only works if I first disconnect all network connections... 
> Which is not really acceptable.
>
> Is there a way to force the hostname CouchDB is going to use ?
>
> Thanks in advance,
> Antoine
>


Re: Starting couchd 2.0 under diverse network infrastructures

Posted by Adam Kocoloski <ko...@apache.org>.
Good question. The node name is set by the vm.args file. It defaults to “-name couchdb” which will cause CouchDB to try to discover the system hostname, but you could set that value directly as “-name couchdb@<FQDN>” or even “-name couchdb@<IPV4>”. The key point is to set it to something that can be routed from other nodes if you ever plan to exercise the clustering capability.

Does that make sense? Cheers,

Adam

> On Aug 18, 2015, at 5:39 AM, Antoine Duchâteau <ad...@gmail.com> wrote:
> 
> Hi list,
> 
> I've got the following problem with CouchDB 2.0
> 
> If I create a database when the computer has one hostname and subsequently start the database again when the hostname is different, the database exposed on 5984 appears empty because there is a mismatch in the node name and fabric does not find the shards anymore.
> 
> What is the best way to handle this situation ?
> I tried using hostname to force the hostname before launching couchdb but it only works if I first disconnect all network connections... Which is not really acceptable.
> 
> Is there a way to force the hostname CouchDB is going to use ?
> 
> Thanks in advance,
> Antoine
> 
> -- 
> *Antoine Duchâteau*
> Managing Director
> Email : ad@taktik.be <ma...@taktik.be>
> GSM : +32 499 534 536
> 
> _______________
> *TAKTIK SA*
> Parc de l'Alliance
> Avenue de Finlande 8
> 1420 Braine l'Alleud
> Tel : +32 2 333.58.40
> <http://www.taktik.be/>http://www.taktik.be
>