-
Notifications
You must be signed in to change notification settings - Fork 56
Building CouchDB
The instructions provided below specify the steps to build CouchDB version 3.3.3 on Linux on IBM Z for the following distributions:
- RHEL (7.8, 7.9)
On RHEL (8.x, 9.x) and Ubuntu (20.04, 22.04), binary packages for CouchDB version 3.3.3 are available and can be installed using steps given here
- When following the steps below please use a standard permission user unless otherwise specified.
- A directory
/<source_root>/
will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.
If you'd like to build CouchDB using the manual steps, please go to STEP 1.2.
Use the following commands to build CouchDB using the build script. Please make sure you have wget installed.
wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/CouchDB/3.3.3/build_couchdb.sh
# Build CouchDB
bash build_couchdb.sh [Provide -t option for executing build with tests]
If the build completes successfully, go to STEP 2.2. In case of any errors, check logs
for more details or go to STEP 1.2 to follow the manual build steps.
export SOURCE_ROOT=/<source_root>
sudo yum install -y libicu-devel libcurl-devel wget tar m4 pkgconfig make libtool which rh-git227-git.s390x gcc-c++ gcc openssl-devel patch js-devel java-11-openjdk-devel perl-devel gettext-devel unixODBC-devel python3-devel ncurses-devel procps-ng
#Enable git 2.27
source /opt/rh/rh-git227/enable
sudo pip3 install --upgrade wheel sphinx==5.3.0 sphinx_rtd_theme docutils==0.17 nose requests hypothesis virtualenv jinja2
cd $SOURCE_ROOT
wget https://github.com/erlang/otp/releases/download/OTP-24.3.4.10/otp_src_24.3.4.10.tar.gz
tar zxf otp_src_24.3.4.10.tar.gz
cd otp_src_24.3.4.10
export ERL_TOP="${SOURCE_ROOT}/otp_src_24.3.4.10"
./configure --prefix=/usr
make
sudo make install
cd $SOURCE_ROOT
git clone https://github.com/elixir-lang/elixir.git
cd elixir
git checkout v1.13.4
export LANG=en_US.UTF-8
make
sudo make install
elixir -v
cd $SOURCE_ROOT
sudo mkdir -p /usr/local/lib/nodejs
wget https://nodejs.org/dist/v14.21.3/node-v14.21.3-linux-s390x.tar.gz
sudo tar xzvf node-v14.21.3-linux-s390x.tar.gz -C /usr/local/lib/nodejs
sudo ln -s /usr/local/lib/nodejs/node-v14.21.3-linux-s390x/bin/* /usr/bin/
node -v
npm -v
cd $SOURCE_ROOT
git clone -b 105.0.0 https://github.com/giggio/node-chromedriver.git
cd node-chromedriver
sed -i "s#process.arch === 'arm64' || process.arch === 'x64'#process.arch === 'arm64' || process.arch === 's390x' || process.arch === 'x64'#g" install.js
npm ci
npm pack
cd $SOURCE_ROOT
git clone -b 3.3.3 https://github.com/apache/couchdb.git
cd $SOURCE_ROOT/couchdb
export LD_LIBRARY_PATH=/usr/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
./configure
cd src/fauxton/
npm i $SOURCE_ROOT/node-chromedriver/chromedriver-105.0.0.tgz
cd ../../
make release
sudo groupadd couchdb
sudo usermod -aG couchdb $(whoami)
sudo cp -r "${SOURCE_ROOT}/couchdb/rel/couchdb" /opt/
sudo chown "$(whoami)":couchdb -R /opt/couchdb
sudo find /opt/couchdb -type d -exec chmod 0770 {} \;
chmod 0644 /opt/couchdb/etc/*
sed -i 's/;admin = mysecretpassword/admin = mysecretpassword/' /opt/couchdb/etc/local.ini
cd "${SOURCE_ROOT}"/couchdb
make check
All tests should pass.
/opt/couchdb/bin/couchdb &
- Verify that the server is up and running by using the
curl http://127.0.0.1:5984/
command. The output should be similar to the following:
{"couchdb":"Welcome","version":"3.3.3","git_sha":"40afbcf","uuid":"27f2fbbab3e00326314af161c525677d","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}
- To load Fauxton web UI in your browser, visit
http://127.0.0.1:5984/_utils/
Note:
To connect to CouchDB from a different Machine, stop your CouchDB server and edit the /opt/couchdb/etc/local.ini
file. Change the bind_address
from 127.0.0.1
to 0.0.0.0
.
The information provided in this article is accurate at the time of writing, but on-going development in the open-source projects involved may make the information incorrect or obsolete. Please open issue or contact us on IBM Z Community if you have any questions or feedback.