See the official documentation here
In CentOS open the following yum package repository
#
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://couchdb.apache.org/repo/couchdb.repo
Edit the repo
vim /etc/yum.repos.d/couchdb.repo
Place the following text into the repo
[couchdb]
name=couchdb
baseurl=https://apache.jfrog.io/artifactory/couchdb-rpm/el$releasever/$basearch/
gpgkey=https://couchdb.apache.org/repo/keys.asc https://couchdb.apache.org/repo/rpm-package-key.asc
gpgcheck=1
repo_gpgcheck=1
enabled=1
In RedHat/CentOS run the command:
sudo yum -y install couchdb
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://couchdb.apache.org/repo/couchdb.repo
# Enable EPEL for the SpiderMonkey dependency
sudo dnf config-manager --set-enabled crb
sudo dnf install epel-release epel-next-release
sudo yum install -y mozjs78
sudo yum install -y couchdb
https://docs.couchdb.org/en/latest/install/upgrading.html
CouchDB 2.x and 3.x are explicitly designed to allow “mixed clusters” during the upgrade process. This allows you to perform a rolling restart across a cluster, upgrading one node at a time, for a zero downtime upgrade.
The update will update couchdb, make sure that the vm.args and local.ini are up to date.
Run the following snippet
erl -noshell -eval 'erlang:display(erlang:system_info(system_version))' -eval 'init:stop()'
sudo yum install erlang-reltool
sudo yum clean all
sudo yum -y install epel-release
sudo yum -y update
# if new kernel installed be sure it reboots
reboot now
wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
wget --proxy=proxy_url 'http://proxy.dpw.gov.za:3128' https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
yum install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git wget wxBase.x86_64
# now get the latest erlang package - we use 24 because clouseau needs it
wget https://packages.erlang-solutions.com/erlang/rpm/centos/7/x86_64/esl-erlang_24.3.4.1-1~centos~7_amd64.rpm
rpm -i esl-erlang_24.3.4.1-1~centos~7_amd64.rpm
# If you get conflicts manually remove erlang 16
yum erase erlang-erts-R16B-03.18.el7.x86_64
# then install erlang again
rpm -i esl-erlang_24.3.4.1-1~centos~7_amd64.rpm
# in one case libodbc.so.2 needed, fix with
#error: Failed dependencies:
# libodbc.so.2()(64bit) is needed by esl-erlang-24.3.4.1-1.x86_64
yum install unixODBC
Configure couchdb installation
sudo vim /etc/systemd/system/clouseau.service
Add the following content, and remember to change the -Xmx parameter to the correct maximum memory that you require:
[Unit]
Description=Clouseau Search Engine
[Service]
User=couchdb
WorkingDirectory=/opt/clouseau
Environment="CLASSPATH=/opt/clouseau/*"
ExecStart=/usr/local/java/bin/java -server -Xmx12G -Dsun.net.inetaddr.ttl=30 -Dsun.net.inetaddr.negative.ttl=30 -Dlog4j.configuration=file:/opt/clouseau/log4j.properties -classpath '/opt/clouseau/*' com.cloudant.clouseau.Main /opt/clouseau/clouseau.ini
Restart=always
[Install]
WantedBy=multi-user.target
Reload and enable to start up automatically
sudo systemctl daemon-reload
sudo systemctl start clouseau
sudo systemctl enable clouseau
Check that it is working using:
sudo systemctl status clouseau
If the service fails with a message that the Unit clouseau.service could not be found, the problem may be with selinux
If SELinux is enforcing, it might block access. Temporarily test with SELinux disabled:
sudo setenforce 0
sudo systemctl start clouseau
If this works, restore SELinux and fix the context:
sudo restorecon -Rv /etc/systemd/system/clouseau.service
sudo setenforce 1