Installation Couchdb Cluster - kwantu/platformconfiguration GitHub Wiki

back to installation

migrated to new wiki

#Couchdb Cluster Configuration

Install and firewall

  1. Install couchdb on each server that will form part of the cluster.
  2. Make sure that each server in the cluster is part of the trusted firewalld zone to communicate with each other

Set up the cluster

In file etc/vm.args change the line -name [email protected] to -name couchdb@<reachable-ip-address|fully-qualified-domain-name> which defines the name of the node. Each node must have an identifier that allows remote systems to talk to it. The node name is of the form @<reachable-ip-address|fully-qualified-domain-name>.

vim /opt/couchdb/etc/vm.args

change the name from 
-name [email protected]
to
-name [email protected]

and add below 
-setcookie monster
these lines to manage the ports
-kernel inet_dist_listen_min 9100
-kernel inet_dist_listen_max 9199

Verify that the cluster can communicate with each other

erl -name [email protected] -setcookie 'brumbrum' -kernel inet_dist_listen_min 9100 -kernel inet_dist_listen_max 9100
erl -name [email protected] -setcookie 'brumbrum' -kernel inet_dist_listen_min 9100 -kernel inet_dist_listen_max 9100

net_kernel:connect_node('[email protected]').
net_kernel:connect_node('[email protected]').


## Preparing CouchDB nodes to be joined into a cluster

Make sure the following are set
<br/>
1. etc/vm.args settings as described in the previous two sections
2. At least one server administrator user (and password)
3. Bind the node’s clustered interface (port 5984) to a reachable IP address
4. A consistent UUID. The UUID is used in identifying the cluster when replicating. If this value is not consistent across all nodes in the cluster, replications may be forced to rewind the changes feed to zero, leading to excessive memory, CPU and network use.
5. A consistent httpd secret. The secret is used in calculating and evaluating cookie and proxy authentication, and should be set consistently to avoid unnecessary repeated session cookie requests.
<br/>




https://www.monitis.com/blog/a-guide-to-couchdb-installation-configuration-and-monitoring/
https://docs.couchdb.org/en/master/setup/cluster.html

## Install haproxy

[root@kwantuapp01 ~]# yum install haproxy
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

### to turn on the logging use rsyslog

vim /etc/rsyslog.d/haproxy.conf

Collect log with UDP

$ModLoad imudp $UDPServerAddress 127.0.0.1 $UDPServerRun 514

Creating separate log files based on the severity

local0.* /var/log/haproxy-traffic.log local0.notice /var/log/haproxy-admin.log


systemctl restart rsyslog

### Troubleshooting. Make sure selinux is not blocking it
setsebool -P haproxy_connect_any=1
⚠️ **GitHub.com Fallback** ⚠️