Important Note: to run CouchDB 0.9, you must have the erlang emulator 5.6 or higher installed (erlang 12.b.3 that comes with Ubuntu 8.10 / Intrepid will work). To see which version of the emulator you are running, issue the following at the command prompt:
erl +V
One of the requirements for EEE Cooks is full text searching. So, for my chain tonight, I wanted to give couchdb-lucene a try. Since it only works on 0.9 (latest trunk), I need to do a bit of yak shaving.
The install of couchdb-lucene is straight-forward. On my Ubuntu system, all that was needed was:
sudo apt-get install maven2Installing couchdb from subversion incurred a thin slice of dependency hell. After checking it out and bootstrapping:
git clone git://github.com/rnewson/couchdb-lucene.git
cd couchdb-lucene/
mvn
svn co http://svn.apache.org/repos/asf/couchdb/trunk couchdbI give configuration a try only to hit this:
cd couchdb
./bootstrap
checking for icu-config... noOn Ubuntu, this is resolved with
*** The icu-config script could not be found. Make sure it is
*** in your path, and that taglib is properly installed.
*** Or see http://ibm.com/software/globalization/icu/
configure: error: Library requirements (ICU) not met.
cstrom@jaynestown:~/repos/couchdb$ sudo apt-get install libicu-devBut then I get:
checking for curl-config... noMan, I hope this doesn't take too long. Resolve this dependency with:
*** The curl-config script could not be found. Make sure it is
*** in your path, and that curl is properly installed.
*** Or see http://curl.haxx.se/
configure: error: Library requirements (curl) not met.
cstrom@jaynestown:~/repos/couchdb$ sudo apt-get install libcurl-devGreat. Not looking good. Well, I'll pick one. let's say the gnutls one:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libcurl-dev is a virtual package provided by:
libcurl4-openssl-dev 7.18.2-1ubuntu4.3
libcurl4-gnutls-dev 7.18.2-1ubuntu4.3
You should explicitly select one to install.
cstrom@jaynestown:~/repos/couchdb$ sudo apt-get install libcurl4-gnutls-devHave I reached my yak yet?
./configureNope, have not quite reached the yak.
...
checking for erl... /usr/bin/erl
checking for erlc... /usr/bin/erlc
checking erl_driver.h usability... no
checking erl_driver.h presence... no
checking for erl_driver.h... no
configure: error: Could not find the `erl_driver.h' header.
Are the Erlang headers installed? Use the `--with-erlang' option to specify the
path to the Erlang include directory.
cstrom@jaynestown:~/repos/couchdb$ sudo apt-get install erlang-devPlease let that be it:
./configureWoo hoo!
...
You have configured Apache CouchDB, time to relax.
Run `make && make install' to install.
I am not one for running downloaded, unsigned code as root, so after making the code, run the local development mode to verify that it is functional:
make && ./utils/runNext up: full text indexing.
Apache CouchDB 0.9.0a756286 (LogLevel=info) is starting.
Apache CouchDB has started. Time to relax.
Sigh. I got all the way to the last step and got:
ReplyDeletechecking for erl... /usr/bin/erl
configure: error: The installed Erlang version is less than 5.6.0 (R12B).
Sadness.
Ouch. Sorry to hear these instructions didn't work for you. I will update the article to indicate that you need to be running at least Ubuntu 8.10 (Intrepid).
ReplyDeleteSounds like you have even more yak shaving than I did :(
I finally got it shaved.
ReplyDelete* Built erlang R12B-5 from source (that was its own yak shaving adventure :-) )
* Added ~/lib/erlang/bin to PATH
* Used "--with-erlang" switch (e.g., ./configure --prefix=$HOME --with-erlang=/home/pubuntu/lib/erlang/erts-5.6.5/include
et, voila:
You have configured Apache CouchDB, time to relax.
Run `make && make install' to install.
Thanks for the blog. It got me most of the way there!
First of all, I want to thank you so much for posting this. After spending hours trying to work through it, I found your post and I sped right through, up until the last part, where I encountered this error:
ReplyDeleteApache CouchDB 0.10.0a768140 (LogLevel=error) is starting.
{"init terminating in do_boot",{{badmatch {error,shutdown}},[{couch_server_sup,start_server,1}, {erl_eval,do_apply,5},{erl_eval,exprs,5}, {init,start_it,1},{init,start_em,1}]}}
Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
Any ideas what it might be? Thanks ahead of time for your tremendous help!
Any reason you need couchdb version 0.10? These instructions should work with 0.9, but I haven't had reason to try them with 0.10.
ReplyDeleteReplace the svn checkout of couchdb with a download and `tar zxf apache-couchdb-0.9.0.tar.gz` of 0.9 from http://couchdb.apache.org/downloads.html and this ought to work.
Thanks for the help again. I just re-ran these steps with the 0.9 download and I'm still getting the same error! The errors are being written out to erl_crash.dump, but the file is all Greek to me.
ReplyDeleteSorry for the wild-goose chase. Seemed like the most obvious difference...
ReplyDeleteYou error look suspiciously like this one: http://wiki.apache.org/couchdb/Error_messages#IncorrectPermissions.
Where did you unpack? How did run? I have the code in my own user's folder. I run with ./utils/run (*not* the couchdb command) from the directory in which I unpacked and built the code:
cd ~/repos/couchdb
./utils/run
I unpacked it in my home folder ~/apache-couchdb-0.9.0 then did './configure' and then 'make && ./utils/run'. I tried running as myself and with 'sudo ./utils/run' and had the same result. The permissions are 755 for '/usr/local/var/lib/couchdb' and '/usr/local/var/log/couchdb', so root should be able to write to them. I don't see any couchdb processes, so I don't think it's a problem with trying to bind with an in-use port. Any other ideas?
ReplyDeleteI'm afraid I'm running out of ideas. You might try over on #couchdb on freenode.
ReplyDeleteAFAIK when running ./utils/run, the only thing that needs to be writable is ~/apache-couchdb-0.9.0/couchdb/tmp/lib/ (where data is written).
If anything is running on port 5984, this should show it:
netstat -nlp | grep 5984
Whenever I have something else running on 5984, I get the Mochiweb error as well (as described on the Error_messages page)
Hi Again! It's all working now. I followed the steps on this blog post and everything worked fine.
ReplyDeletehttp://aimee.mychores.co.uk/2008/09/07/post/322/
I created a couchdb user and ran couchdb with that user and everything seems to be just fine. Thanks for your help!
CouchDB 0.9.0 and the correct version of Erlang are now in Ubuntu Karmic. You can now simply backport those 2 packages to Jaunty (using `apt-get source` and `apt-get build-dep`).
ReplyDelete