CouchDB 1.2.0, Amazon EC@ & Amazon Linux AMI

196 views
Skip to first unread message

Martin Hewitt

unread,
Sep 1, 2012, 8:14:47 AM9/1/12
to us...@couchdb.apache.org
Hi all,

Just wondering if anyone has a successful build script/process for CouchDB 1.2.0 on an Amazon EC2 Linux AMI instance?

It seems to be similar to CentOS, but my usual, hardened, CentOS deployment process isn't working - when I come to make CouchDB, I get the dreaded "couchdb implicit declaration of function ‘INT_FITS_IN_JSVAL’" error and it bails out.

The only difference I'm finding so far is that, in order to compile SpiderMonkey, I'm having to download an .rpm for autoconf-2.13 as the Amazon yum repos don't seem to have it, where the CentOS repos do.

However, all the steps complete satisfactorily, and SpiderMonkey compiles, but by the time I get to make-ing CouchDB, I get the above error.

In pseudo-script, my process is:

* Add RPMForge repo
* Install dependencies: libicu-devel openssl-devel make gcc js-devel libtool which ncurses-devel icu libicu
* Install ERLang
* Install SpiderMonkey deps
* Download SpiderMonkey source
* autoconf-2.13/configure/make && make install
* Download CouchDB source
* configure/make && make install

...which is roughly where I get stuck.

Any advice would be hugely appreciated.

Thanks,

Martin

Martin Hewitt

unread,
Sep 1, 2012, 10:11:20 AM9/1/12
to us...@couchdb.apache.org
Just by way of further info, this is the output of my make && make install command:

https://gist.github.com/3574166

I'm trying with
- CouchDB v1.2.0 from here: http://mirror.rmg.io/apache/couchdb/releases/1.2.0/apache-couchdb-1.2.0.tar.gz
- SpiderMonkey 1.85 from here: http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
- ERLang 14B01 from here: http://www.erlang.org/download/otp_src_R14B01.tar.gz

Martin

CGS

unread,
Sep 1, 2012, 11:31:29 AM9/1/12
to us...@couchdb.apache.org
Two questions:

1. Why do you take js-devel if you have SpiderMonkey (or vice-versa)?
2. When you configure, do you use SpiderMonkey installation?

CGS

Dave Cottlehuber

unread,
Sep 1, 2012, 1:08:22 PM9/1/12
to us...@couchdb.apache.org
On 1 September 2012 16:11, Martin Hewitt <mar...@thenoi.se> wrote:
> Just by way of further info, this is the output of my make && make install command:
>
> https://gist.github.com/3574166
>
> I'm trying with
> - CouchDB v1.2.0 from here: http://mirror.rmg.io/apache/couchdb/releases/1.2.0/apache-couchdb-1.2.0.tar.gz
> - SpiderMonkey 1.85 from here: http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
> - ERLang 14B01 from here: http://www.erlang.org/download/otp_src_R14B01.tar.gz

Martin,

What ./configure params are you using, & what's its output?

You'll only need spidermonkey 1.8.5 and not js-devel. Most likely
that's where things are getting mucked up.

A+
Dave

Martin Hewitt

unread,
Sep 1, 2012, 1:25:45 PM9/1/12
to us...@couchdb.apache.org
Hi Dave, CGS,

Thanks for replying - these lines are copied directly from my CentOS script, which works, and I haven't quite got through unpicking each line yet (if it ain't broke etc).

I'll try without js-devel.

My ./configure command is:
./configure --with-erlang=/usr/local/lib/erlang/usr/include --with-js-lib=/usr/local/lib/ --with-js-include=/usr/local/include/js/


Martin


On Saturday, 1 September 2012 at 18:08, Dave Cottlehuber wrote:

CGS

unread,
Sep 1, 2012, 2:37:40 PM9/1/12
to us...@couchdb.apache.org
...and I suppose you don't have SpiderMonkey there. There may be a problem
if js-devel is too old.

Martin Hewitt

unread,
Sep 1, 2012, 3:33:51 PM9/1/12
to us...@couchdb.apache.org
Looks like the js-devel/compiling from source conflict was the compilation issue.

I've removed js-devel from the yum install line and CouchDB compiles without a problem, and starts up and runs as expected.

However, when I come to generate views, I get lots of the following error:

[Sat, 01 Sep 2012 19:30:59 GMT] [error] [<0.236.0>] OS Process Error <0.23368.0> :: {os_process_error,
{exit_status,127}}


Which seems to indicate that my SpiderMonkey installation is "not correct"[1], but I'm not sure how my install differs from a "correct" install.

Martin

[1] http://wiki.apache.org/couchdb/Error_messages#OS_Process_Error_.7Bos_process_error.2C.7Bexit_status.2C127.7D.7D


On Saturday, 1 September 2012 at 19:37, CGS wrote:

> ...and I suppose you don't have SpiderMonkey there. There may be a problem
> if js-devel is too old.
>
>
>
> On Sat, Sep 1, 2012 at 7:25 PM, Martin Hewitt <mar...@thenoi.se (mailto:mar...@thenoi.se)> wrote:
>
> > Hi Dave, CGS,
> >
> > Thanks for replying - these lines are copied directly from my CentOS
> > script, which works, and I haven't quite got through unpicking each line
> > yet (if it ain't broke etc).
> >
> > I'll try without js-devel.
> >
> > My ./configure command is:
> > ./configure --with-erlang=/usr/local/lib/erlang/usr/include
> > --with-js-lib=/usr/local/lib/ --with-js-include=/usr/local/include/js/
> >
> >
> > Martin
> >
> >
> > On Saturday, 1 September 2012 at 18:08, Dave Cottlehuber wrote:
> >
> > > On 1 September 2012 16:11, Martin Hewitt <mar...@thenoi.se (mailto:mar...@thenoi.se) (mailto:

Wendall Cada

unread,
Sep 1, 2012, 5:52:28 PM9/1/12
to us...@couchdb.apache.org
I created an rpm spec for 1.2.0 and instructions for building
spidermonkey 1.8.5 https://github.com/wendall911/couchdb-rpm. We
currently use this in production on Amazon Linux. Build the rpms. Update
spidermonkey. Install couchdb. Done.

Wendall

Thomas Hommers

unread,
Sep 1, 2012, 11:43:45 PM9/1/12
to us...@couchdb.apache.org
Hi,

just saw that CouchDB is also available as Turnkey Appliance, also for Amazon EC2 !

http://www.turnkeylinux.org/couchdb

I haven't tried it yet, but from my experience with other TC appliances this could be great.

Thomas
________________________________________
From: Wendall Cada [wend...@83864.com]
Sent: Sunday, September 02, 2012 5:52 AM
To: us...@couchdb.apache.org
Subject: Re: CouchDB 1.2.0, Amazon EC@ & Amazon Linux AMI

Martin Hewitt

unread,
Sep 2, 2012, 8:39:38 PM9/2/12
to us...@couchdb.apache.org
Hi CGS,

I've just run

curl http://127.0.0.1:5984/_config/query_servers

Which gave me:

{"coffeescript":"/usr/local/bin/couchjs /usr/local/share/couchdb/server/main-coffee.js","javascript":"/usr/local/bin/couchjs /usr/local/share/couchdb/server/main.js"}

If I try and run:

/usr/local/bin/couchjs

I get:

/usr/local/bin/couchjs: error while loading shared libraries: libmozjs185.so.1.0: cannot open shared object file: No such file or directory

My ./configure command is:

./configure --with-erlang=/usr/local/lib/erlang/usr/include --with-js-lib=/usr/local/lib/ --with-js-include=/usr/local/include/js/

And libmozjs185.so.1.0 exists in /usr/local/lib/:

[ec2-user@ip-xx-xxx-xx-xx apache-couchdb-1.2.0]$ ls /usr/local/lib
couchdb erlang libmozjs185-1.0.a libmozjs185.so libmozjs185.so.1.0 libmozjs185.so.1.0.0 pkgconfig


The output of my ./configure command is here: https://gist.github.com/3605914

Martin


On Saturday, 1 September 2012 at 19:37, CGS wrote:

> ...and I suppose you don't have SpiderMonkey there. There may be a problem
> if js-devel is too old.
>
>
>
> On Sat, Sep 1, 2012 at 7:25 PM, Martin Hewitt <mar...@thenoi.se (mailto:mar...@thenoi.se)> wrote:
>
> > Hi Dave, CGS,
> >
> > Thanks for replying - these lines are copied directly from my CentOS
> > script, which works, and I haven't quite got through unpicking each line
> > yet (if it ain't broke etc).
> >
> > I'll try without js-devel.
> >
> > My ./configure command is:
> > ./configure --with-erlang=/usr/local/lib/erlang/usr/include
> > --with-js-lib=/usr/local/lib/ --with-js-include=/usr/local/include/js/
> >
> >
> > Martin
> >
> >
> > On Saturday, 1 September 2012 at 18:08, Dave Cottlehuber wrote:
> >
> > > On 1 September 2012 16:11, Martin Hewitt <mar...@thenoi.se (mailto:mar...@thenoi.se) (mailto:

CGS

unread,
Sep 3, 2012, 8:54:10 AM9/3/12
to us...@couchdb.apache.org
Where do you have SpiderMonkey installed? You need to provide the path
toward your SpiderMonkey (libs and headers). During runtime, you can use
all the time LD_LIBRARY_PATH to add new searching paths for libraries.

CGS

Martin Hewitt

unread,
Sep 3, 2012, 9:37:56 AM9/3/12
to us...@couchdb.apache.org
My SpiderMonkey libs are in /usr/local/lib/ and my header files in /usr/local/include/js as per the ./configure command.

I'll try playing around with LD_LIBRARY_PATH and see if that helps.

Martin

Technical Director
Thenoi.se

w: http://www.thenoi.se
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> > > On Sat, Sep 1, 2012 at 7:25 PM, Martin Hewitt <mar...@thenoi.se (mailto:mar...@thenoi.se) (mailto:
> > mar...@thenoi.se (mailto:mar...@thenoi.se))> wrote:
> > >
> > > > Hi Dave, CGS,
> > > >
> > > > Thanks for replying - these lines are copied directly from my CentOS
> > > > script, which works, and I haven't quite got through unpicking each
> > > >
> > >
> > >
> >
> > line
> > > > yet (if it ain't broke etc).
> > > >
> > > > I'll try without js-devel.
> > > >
> > > > My ./configure command is:
> > > > ./configure --with-erlang=/usr/local/lib/erlang/usr/include
> > > > --with-js-lib=/usr/local/lib/ --with-js-include=/usr/local/include/js/
> > > >
> > > >
> > > > Martin
> > > >
> > > >
> > > > On Saturday, 1 September 2012 at 18:08, Dave Cottlehuber wrote:
> > > >
> > > > > On 1 September 2012 16:11, Martin Hewitt <mar...@thenoi.se (mailto:mar...@thenoi.se) (mailto:
> > mar...@thenoi.se (mailto:mar...@thenoi.se)) (mailto:

CGS

unread,
Sep 3, 2012, 9:58:56 AM9/3/12
to us...@couchdb.apache.org
I don't know in your Linux distro how it is, but there are few distros
which do not have /usr/local/lib in the dynamic linking path. So, use
either LD_LIBRARY_PATH or, for more permanent solution, see ldconfig (
http://linux.die.net/man/8/ldconfig).

To see if you have that path in your dynamic linking environment, check the
output of "echo $LD_LIBRARY_PATH" or the content of /etc/ld.so.conf (and
follow the paths there to see if any .conf file contains your path). If you
prefer ldconfig, just add the path in a .conf file and execute ldconfig
after.

CGS

Martin Hewitt

unread,
Sep 3, 2012, 10:57:42 AM9/3/12
to us...@couchdb.apache.org
That was the problem! My LD_LIBRARY_PATH value was empty, so I did:

export LD_LIBRARY_PATH=/usr/local/lib

And restarted CouchDB and the view loaded without the {exit_status,127} errors.

Phew, very pleased to have finally got this fixed.

Now working on EC2 Amazon Linux AMI release 2012.03

Martin


On Monday, 3 September 2012 at 14:58, CGS wrote:

> I don't know in your Linux distro how it is, but there are few distros
> which do not have /usr/local/lib in the dynamic linking path. So, use
> either LD_LIBRARY_PATH or, for more permanent solution, see ldconfig (
> http://linux.die.net/man/8/ldconfig).
>
> To see if you have that path in your dynamic linking environment, check the
> output of "echo $LD_LIBRARY_PATH" or the content of /etc/ld.so.conf (and
> follow the paths there to see if any .conf file contains your path). If you
> prefer ldconfig, just add the path in a .conf file and execute ldconfig
> after.
>
> CGS
>
>
>
>
> On Mon, Sep 3, 2012 at 3:37 PM, Martin Hewitt <mar...@thenoi.se (mailto:mar...@thenoi.se)> wrote:
>
> > My SpiderMonkey libs are in /usr/local/lib/ and my header files in
> > /usr/local/include/js as per the ./configure command.
> >
> > I'll try playing around with LD_LIBRARY_PATH and see if that helps.
> >
> > Martin
> >
> > Technical Director
> > Thenoi.se (http://Thenoi.se)
> >
> > w: http://www.thenoi.se
> > Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> >
> >
> > On Monday, 3 September 2012 at 13:54, CGS wrote:
> >
> > > Where do you have SpiderMonkey installed? You need to provide the path
> > > toward your SpiderMonkey (libs and headers). During runtime, you can use
> > > all the time LD_LIBRARY_PATH to add new searching paths for libraries.
> > >
> > > CGS
> > >
> > >
> > >
> > mar...@thenoi.se (mailto:mar...@thenoi.se)) (mailto:
> > > > mar...@thenoi.se (mailto:mar...@thenoi.se))> wrote:
> > > > >
> > > > > > Hi Dave, CGS,
> > > > > >
> > > > > > Thanks for replying - these lines are copied directly from my
> > CentOS
> > > > > > script, which works, and I haven't quite got through unpicking each
> > > > >
> > > >
> > > >
> > > > line
> > > > > > yet (if it ain't broke etc).
> > > > > >
> > > > > > I'll try without js-devel.
> > > > > >
> > > > > > My ./configure command is:
> > > > > > ./configure --with-erlang=/usr/local/lib/erlang/usr/include
> > > > > > --with-js-lib=/usr/local/lib/
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
> > --with-js-include=/usr/local/include/js/
> > > > > >
> > > > > >
> > > > > > Martin
> > > > > >
> > > > > >
> > > > > > On Saturday, 1 September 2012 at 18:08, Dave Cottlehuber wrote:
> > > > > >
> > > > > > > On 1 September 2012 16:11, Martin Hewitt <mar...@thenoi.se (mailto:mar...@thenoi.se)(mailto:

CGS

unread,
Sep 3, 2012, 12:55:49 PM9/3/12
to us...@couchdb.apache.org
So, now, you can relax and let CouchDB to do the work for you. :)

CGS
> > > > On Mon, Sep 3, 2012 at 2:39 AM, Martin Hewitt <mar...@thenoi.se(mailto:
Reply all
Reply to author
Forward
0 new messages