Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

Couchbase Source

The latest source is available via the github repositories or you can get a source tarball of the latest Community Release from the download page for the latest release.

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.

Prerequisites

Every Linux and other UNIX distributions have their own organization and default software packages that are included by default.

Ubuntu Ubuntu 11.04

The following packages are required, and can be installed using the command 'apt-get install <packagelist>'

  • make
  • gcc
  • g++
  • libcurl3-dev
  • libevent-dev
  • libicu-dev
  • erlang
Cent OS 5.4 (work in progress)

The following packages are required , and can be installed using the command "yum install <packagelist>'

  • make
  • gcc
  • g++
  • gcc-c++
  • curl-devel
  • libevent-devel
  •  
MacOS X

Many Couchbase developers use MacOS X as their primary development O/S. See the [OSX specific page] for details.

Erlang

Erlang R14B03 -- please visit http://erlang.org for more information.

Python

Python is used by the couchbase command-line tools (at runtime).

Inside the source package

You will first need to unarchive the source distribution file:

tar -xvzf couchbase{$ver}_src.tar.gz

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

Building Membase

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.

Troubleshooting The Build

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 ?
Other Troubleshooting
  • 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:
LIBCONFLATE_CONFIGURE_FLAGS=$(CONFIGURE_FLAGS) CFLAGS=-I/var/tmp/curl/include LDFLAGS=-L/var/tmp/curl/lib
  • 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 'ns_1@127.0.0.1' 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"

Running Couchbase

To start the couchbase server...

./install/bin/couchbase-server

On releases earlier than 1.8, you may have to use...

./install/bin/membase-server

Next, you can telnet to port 11211 and issue memcached commands...

$ telnet localhost 11211
    set some_greeting 0 0 5
    hello
    STORED
    get some_greeting
    VALUE some_greeting 0 5
    hello
    END

To see the web console UI go to http://(host):8091/

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.