Building from source is easiest from the distribution tarball and is recommended for those looking to build on other OSs for which there are no binary releases. Building straight from the repositories and upstream source code projects is recommended if you are a developer who is enhancing Couchbase.
Every Linux and other UNIX distributions have their own organization and default software packages that are included by default.
The following packages are required, and can be installed using the command 'apt-get install <packagelist>'
The following packages are required , and can be installed using the command "yum install <packagelist>'
Many Couchbase developers use MacOS X as their primary development O/S. See the [OSX specific page] for details.
Erlang R14B03 -- please visit http://erlang.org for more information.
Python is used by the couchbase command-line tools (at runtime).
You will first need to unarchive the source distribution file:
Once un-archived, the components that are included with the Couchbase source distribution include:
- memcached - core data networking server
- bucket_engine - multitenancy plug-in to memcached
- ep-engine - persistence plug-in to memcached
- libvbucket - library for elastic key hashing
- libconflate - library to allow moxi to support dynamic configuration
- moxi - proxy for memcached and couchbase
- membase-cli - command-line utiity
- ns_server - cluster management, monitoring and orchestration, with web UI console and REST administration API
- sigar & portsigar - system monitoring library
- couchdb - Apache CouchDB
- memcachetest - a simple test utility for generating a large number of gets and sets
Assuming you are building from the consolidated source tarball, you will simply extract the tarball, cd into the directory and execute "make". If you have dependent components such as libcurl in different locations, you may need to edit the Makefile slightly to use the correct paths at buildtime. See the troubleshooting section below. As couchdb isn't required for the 1.8 or earlier builds, when running make disable it (removes the spidermonkey dependency as well.)
- make DISABLE_COUCH=1
If instead you are building from individual components out of the source repository, you will need to generate the configure script and Makefile using autoconf and automake. In ns_server you will find a sample Makefile, "Makefile.all" which can assist with this.
When building couchbase, the most frequent issues encountered involve not having the correct dependencies or not having them in the right path at the right time.
Things to check:
- Is "erl" in your $PATH ?
- Setting Special Locations
If you have libcurl in a different location, you may need to edit the source tarball Makefile to add the CFLAGS and LDFLAGS. For instance:
- File Descriptor Settings
Couchbase starts a memcached process which allows up to 10,000 open connections. Therefore, it needs to be able to set it's number of open file descriptors to that amount. You will need to adjust the allowable number of file descriptors if you see this in the log:
Port server memcached on node 'email@example.com' exited with status 71. Restarting. Messages: failed to set rlimit for open files. Try running as root or requesting smaller maxconns value.
- Makefile Changes not Picked Up
If after a failed build you make a change to the Makefile but find it does not take effect, you may need to clean up the previous configuration used with that component. Do this by going to the component's directory and running "make dist clean"
To start the couchbase server...
On releases earlier than 1.8, you may have to use...
Next, you can telnet to port 11211 and issue memcached commands...
To see the web console UI go to http://(host):8091/