Setup¶
CouchDB 3.x can be deployed in either a single-node or a clustered setup. This section covers the first-time setup steps required for each of these configuration.
Single Node¶
A single node cluster is nothing more than a cluster extended to a single node, ie the local one. To configure it, run:
Enable-CouchDBCluster -SingleNode -Authorization "admin:password"
Cluster¶
Same thing of the single node, but with two or more nodes. By default the nodes are 3.
Enable-CouchDBCluster -Authorization "admin:password"
Nodes¶
Nodes are the single elements of a cluster. by element we mean a server, local or remote. To verify the active cluster nodes, run:
Get-CouchDBNode -Authorization "admin:password"
Add a node¶
To manually add a node to the cluster, simply run:
Add-CouchDBNode -BindAddress 127.0.1.1 -Authorization "admin:password"
Remove a node¶
To manually add a node to the cluster, simply run:
Get-CouchDBNode -Authorization "admin:password"
Remove-CouchDBNode -Node couchdb@127.0.1.1 -Authorization "admin:password"
Configuration¶
The CouchDB Server Configuration API provide an interface to query and update the various configuration values within a running CouchDB instance.
Get configuration¶
To get the entire CouchDB server configuration. The structure is organized by different configuration sections, with individual values.
Get-CouchDBConfiguration -Authorization "admin:password"
Modify configuration¶
To modify configuration, see help of this cmdlet:
Set-CouchDBConfiguration -?
help Set-CouchDBConfiguration
Get-Help Set-CouchDBConfiguration
Modify an element¶
For example, to change SSL port 6984 with 443:
Set-CouchDBConfiguration -Element ssl -Key port -Value 443 -Authorization "admin:password"
Note
This cmdlet return the old value. To verify the changed value, run:
Get-CouchDBConfiguration -Authorization "admin:password" | Select-Object ssl | Format-List
Reload configuration¶
Reloads the configuration from disk. This has a side effect of flushing any in-memory configuration changes that have not been committed to disk.
Submit-CouchDBConfiguration -Authorization "admin:password"