You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by "Mad, Pink and Dangerous to Know" <pi...@mad.pink> on 2018/09/27 19:01:00 UTC

Configuration manager help for clusters

I have a small cluster setup. I need a for dummies guide to using a
configuration manager to change configurations. Don't care which one.
Can anyone give an example of how to: 

1. create a user "raspberry" 

2. create a role "friend" to user "raspberry"  

3. change the config for UUID's algorithm to "utc_random" 

Thanks in advance!

Re: Configuration manager help for clusters

Posted by Joan Touzet <wo...@apache.org>.
Hi Pink,

> -the users database gets replicated on all nodes? So a single API
> call
> creates a new user for the entire cluster?

If they're going in the _users database, yes.

If you're declaring a server-wide admin that goes in the [admins]
section of local.ini, that needs to be done separately on every node.

> -configurations need to be done separately on every node?

Yes!

> Ultimately, as far as configuration goes, I foresee very very few
> config
> changes. and if I only have 4 nodes, what are the disadvantages to
> making 4
> API calls for each change to be made? Or writing a simple script to
> iterate
> my changes across each node?

Only that if you replace a node (due to failure) or grow your cluster,
your CM system won't have the built-in support to handle that situation.
If you automate handling cluster setup by deploying your local.ini
file, you'll be sure to get those settings right across all nodes
in the cluster, present *and* future.
 
> I'm
> trying
> to suss out the dangers of making the calls myself? What can I break?

For these changes...nothing.
 
> To be even more blunt... as far as learning a configuration manager
> goes...  I'm lacking in both gumption and resolve. That just leaves
> necessity. Before I assign a higher value to necessity, I'd like to
> get a
> better understanding of the risks and benefits of each method.

Using scripts by hand for now is fine. Later, when you may want to do
things like automated deployment, you'll need the power of one of those
CM tools.
 
> One last tangentially related question: does the couch per user
> setting
> work on a cluster?

Yes, that's another setting for your local.ini file, so you need to set
it on every node separately.

-Joan

Re: Configuration manager help for clusters

Posted by "Mad, Pink and Dangerous to Know" <pi...@mad.pink>.
Just so I'm clear:
-the users database gets replicated on all nodes? So a single API call
creates a new user for the entire cluster?
-configurations need to be done separately on every node?

Ultimately, as far as configuration goes, I foresee very very few config
changes. and if I only have 4 nodes, what are the disadvantages to making 4
API calls for each change to be made? Or writing a simple script to iterate
my changes across each node?

In other words... maybe some day I will have uses for Ansible or Chef, but
right now I would only be learning one of them for this purpose. I'm trying
to suss out the dangers of making the calls myself? What can I break?

To be even more blunt... as far as learning a configuration manager
goes...  I'm lacking in both gumption and resolve. That just leaves
necessity. Before I assign a higher value to necessity, I'd like to get a
better understanding of the risks and benefits of each method.

One last tangentially related question: does the couch per user setting
work on a cluster?

On Thu, Sep 27, 2018 at 5:37 PM Joan Touzet <wo...@apache.org> wrote:

> Hi Pink,
>
> CouchDB's native configuration interface is the HTTP API. You'll have
> to read through the documentation for e.g. Ansible, Chef, Puppet, etc.
> to understand how it can be made to make HTTP requests.
>
> All three of the operations below can be done with HTTP requests, with
> the first two being single requests to the /_users database. However,
> in a cluster, changing config values must be done *per machine*, so
> it's better to make this change in the local.ini file on each machine.
> All config management tools have easy ways to template/deploy a file to
> the file system, so you'll want to use this approach instead.
>
> I'm sorry that I don't have the time to share an explicit implementation
> for these 3 specific requests, but I hope the above points you in the
> right direction.
>
> I do maintain the Chef cookbook for CouchDB at
>
> https://github.com/wohali/couchdb-cookbook
>
> but it doesn't provide native facilities to do any of the things
> mentioned above, sorry. You'll have to use basic Chef functionality to
> achieve what you're looking for in that tool.
>
> Creating users with roles are just documents in the /_users db; docs
> on that document format are here:
>
>
> http://docs.couchdb.org/en/stable/intro/security.html#authentication-database
>
> -Joan
>
>
> ----- Original Message -----
> > From: "Pink and Dangerous to Know Mad" <pi...@mad.pink>
> > To: user@couchdb.apache.org
> > Sent: Thursday, September 27, 2018 3:01:00 PM
> > Subject: Configuration manager help for clusters
> >
> > I have a small cluster setup. I need a for dummies guide to using a
> > configuration manager to change configurations. Don't care which one.
> > Can anyone give an example of how to:
> >
> > 1. create a user "raspberry"
> >
> > 2. create a role "friend" to user "raspberry"
> >
> > 3. change the config for UUID's algorithm to "utc_random"
> >
> > Thanks in advance!
>

Re: Configuration manager help for clusters

Posted by Joan Touzet <wo...@apache.org>.
Hi Pink,

CouchDB's native configuration interface is the HTTP API. You'll have
to read through the documentation for e.g. Ansible, Chef, Puppet, etc.
to understand how it can be made to make HTTP requests.

All three of the operations below can be done with HTTP requests, with
the first two being single requests to the /_users database. However,
in a cluster, changing config values must be done *per machine*, so
it's better to make this change in the local.ini file on each machine.
All config management tools have easy ways to template/deploy a file to
the file system, so you'll want to use this approach instead.

I'm sorry that I don't have the time to share an explicit implementation
for these 3 specific requests, but I hope the above points you in the
right direction.

I do maintain the Chef cookbook for CouchDB at

https://github.com/wohali/couchdb-cookbook

but it doesn't provide native facilities to do any of the things
mentioned above, sorry. You'll have to use basic Chef functionality to
achieve what you're looking for in that tool.

Creating users with roles are just documents in the /_users db; docs
on that document format are here:

http://docs.couchdb.org/en/stable/intro/security.html#authentication-database

-Joan


----- Original Message -----
> From: "Pink and Dangerous to Know Mad" <pi...@mad.pink>
> To: user@couchdb.apache.org
> Sent: Thursday, September 27, 2018 3:01:00 PM
> Subject: Configuration manager help for clusters
> 
> I have a small cluster setup. I need a for dummies guide to using a
> configuration manager to change configurations. Don't care which one.
> Can anyone give an example of how to:
> 
> 1. create a user "raspberry"
> 
> 2. create a role "friend" to user "raspberry"
> 
> 3. change the config for UUID's algorithm to "utc_random"
> 
> Thanks in advance!