In file etc/vm.args change the line -name couchdb@127.0.0.1 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 couchdb@127.0.0.1
to
-name couchdb@kwantucouchdb02.dedicated.co.za
and add below
-setcookie monster
these lines to manage the ports
-kernel inet_dist_listen_min 9100
-kernel inet_dist_listen_max 9199
see what is current cluster status
curl -X GET "http://xxx.xxx.xxx.xxx:5984/_membership" --user admin-user
curl -X PUT "http://xxx.xxx.xxx.xxx/_node/_local/_nodes/node2@yyy.yyy.yyy.yyy" -d {}
erl -name k9@197.242.158.124 -setcookie 'brumbrum' -kernel inet_dist_listen_min 9100 -kernel inet_dist_listen_max 9100
erl -name k10@197.242.156.57 -setcookie 'brumbrum' -kernel inet_dist_listen_min 9100 -kernel inet_dist_listen_max 9100
net_kernel:connect_node('k9@197.242.158.124').
net_kernel:connect_node('k10@197.242.156.57').
## 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
UDPServerAddress 127.0.0.1
$UDPServerRun 514
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