Installing CouchDB in AWS EC2 Free Tier - amazon-ec2

Does anyone know of a step by step installation guide for CouchDB in the free tier 32bit AWS EC2 instance?
Keep in mind that YUM is limited by default and I would need to add yum.repos to get extra stuff. I've tried all different articles and RPMs but none seem to work.
I also tried couchbase but it has extremely poor post-install instructions. The server start but then what? I couldn't find the files, configs, or install directories. And, how do I access it?
CouchDB sounds like such a great database but it really needs to break these barriers of entry. MongoDb has better docs, although I couldn't get that to work either (I spent a fraction of the time trying, though).
Thanks :)

The apache team put together this quick script that installs CouchDB (thanks #_jhs
for build-couchdb!) on an Amazon Linux AMI:
https://gist.github.com/1171217
If you are using cloudinit + the EC2 command line tools, simply use
ec2-run-instances with --user-data-file (you will need some mods to
the script to save the password or locally generate one) and voila'.
Relaxing FTW.
Worked like a charm for me!

Enable the EPEL repository first and then install it with yum install couchdb
You can enable EPEL using the instructions here.
EDIT:
More information at http://wiki.apache.org/couchdb/Installing_on_RHEL5. Keep in mind that the Linux EC2 AMI is a cut down version of CentOS and you can add custom repositories and install as you wish.

Here is a quick run down of the steps I use to install couchdb 1.5.1 on Amazon Linux 2014.03.1. See also this post on my blog http://www.everyhaironyourhead.com/installing-couchdb-1-5-1-on-amazon-linux-ami-2014-03-1/.
Core deps and dev tools.
Enable the EPEL Repo by editing the file /etc/yum.repos.d/epel.repo and setting it to enabled.
Next install the deps and tools.
sudo yum install gcc gcc-c++ libtool libicu-devel openssl-devel autoconf-archive erlang python27 python-sphinx help2man
Get the SpiderMonkey JS Engine and build it...
wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
tar xvfz js185-1.0.0.tar.gz
cd js-1.8.5/js/src
./configure
make
sudo make install
You should see it installed under /usr/local/lib
Build CouchDB.
Download the source package for CouchDB, unpack it and cd in.
Point it to the required libs and configure.
./configure --with-erlang=/usr/lib64/erlang/usr/include --with-js-lib=/usr/local/lib/ --with-js-include=/usr/local/include/js/
make
sudo make install
Prepare the CouchDB installation.
Make a couchdb user.
sudo useradd -r -d /usr/local/var/lib/couchdb -M -s /bin/bash couchdb
Set the file ownerships.
sudo chown -R couchdb:couchdb /usr/local/etc/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/lib/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/log/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/run/couchdb
sudo chmod 0775 /usr/local/etc/couchdb
sudo chmod 0775 /usr/local/var/lib/couchdb
sudo chmod 0775 /usr/local/var/log/couchdb
sudo chmod 0775 /usr/local/var/run/couchdb
Prepare the init scripts.
Link the init script and copy the log rotate script to /etc.
sudo cp /usr/local/etc/logrotate.d/couchdb /etc/logrotate.d
sudo ln -s /usr/local/etc/rc.d/couchdb /etc/init.d/couchdb
This and most other linux distros don’t include /usr/local/lib in ld, so CouchDB will have problems finding the SpiderMonkey libs we installed there earlier. One way to solve this is to add the following line to the top of the /etc/init.d/couchdb startup script.
export LD_LIBRARY_PATH=/usr/local/lib
See man page for ldconfig for more info, and please comment with a better solution.
You may want to edit /usr/local/etc/default/couchdb to turn off the auto respawn.
To get it to autostart, just use the standard linux setup tools for running service scripts.
sudo chkconfig --add couchdb
It should pick up the default run levels needed from the script, but in case it doesn’t, you can do it manually like this...
sudo chkconfig --level 3 couchdb on
sudo chkconfig --level 4 couchdb on
sudo chkconfig --level 5 couchdb on
You can sudo chkconfig —list to confirm its there. See man chkconfig for more details.
Relax.
Finally reboot (or just start couchdb from the script) and confirm its running with curl http://127.0.0.1:5984/
Comments, corrections, improvements, and criticisms are appreciated.

Add the EPEL repository first and then install it with yum install couchdb
Yeah, not exactly. I'm running AWS Free Tier standard and installing couch has been hell on earth - lots and lots of dependency issues around erland various graphics libs, I'll report back here when I get a process that works
okay, the issue for me was wxGTK.x86_64 - It had a list of 15 or so dependencies that wouldn't install through yum (even with epel) and I had to manually install the rpms and dependencies before yum install couchdb would work.
Not sure the default AMI is a good idea if you want couch!

I googled: "build couchdb"
and followed the steps
I am installing it.
I can tell you it is very painful. After pressing "rake", you need to wait 2, maybe 3 hours until all the dependencies are compiled. I am still installing it right now in my free tier server. You have to make sure you have that time to keep your terminal busy out there!
However, it is the only working solution so far for me. It is installing automatically for real.

I also tried couchbase but it has extremely poor post-install instructions. The server start but then what? I couldn't find the files, configs, or install directories. And, how do I access it?
Sorry for hearing about the experience you are having! We have been focused on making Couchbase highly performant and scalable recently so understand the developer experience pain such as documentations. Hopefully these two step by step guides would help!
This is on how to install the Couchbase Server and Couchbase Sync Gateway Amazon AMI on AWS and then how to connect Couchbase Sync Gateway to a mobile application:
Part 1 : Database on Amazon: Installing Couchbase AMI on AWS
The first part goes over how to install and access the Couchbase Web Console.
Part 2 : Database on Amazon: Connecting Couchbase Sync Gateway to Couchbase AMI on AWS
The second part goes over how to access the Couchbase contents/directory
You mentioned CouchDB and Couchbase together in this thread and they have different APIs but the Couchbase Sync Gateway component would be able to sit in front of CouchDB through the REST APIs as another option.

For those specifically installing on AWS Linux 2
Installing Couchdb on AWS Linux 2
This page uses Apache Couchdb binary installation
Instructions
Using the Centos installation instructions.
Create the bintray-apache-couchdb-rpm.repo file in the /etc/yum.repos.d directory
Fill in the full path to the repository list rather than using the Relver and Architecture macros.
[bintray--apache-couchdb-rpm] name=bintray--apache-couchdb-rpm baseurl=http://apache.bintray.com/couchdb-rpm/el7/x86_64/
gpgcheck=0
repo_gpgcheck=0
enabled=1
Yum install after enabling epel
sudo yum update && sudo yum install -y couchdb
Continue with the Couchdb and configuration as normal

Related

FSL installation in Ubuntu FAILED message

I am a traditional Windows user and therefore you have to excuse me for my lack of experience with other OS. I installed Ubuntu in order to install FSL in my computer (seems the Windows installation failed so I tried this). However, the download goes right, but at the end it says "[FAILED] Unable to unpack FSL".
How can I solve it?
Thanks a lot
First of all, this is not a programming question. If it can still be moved to AskUbuntu (or SuperUser) it may be better appreciated.
In Ubuntu the easy way to install software is through the package manager. This is by far the least amount of work and installs binary packages in default locations (FSL is in the path straight away), plus it takes care of all the dependencies!
FSL is in the NeuroDebian repository, and if you add this to one of your 'software sources' then you can install it via Ubuntu's package manager, APT:
go to https://neuro.debian.net and find out how to add the right repository, e.g.
$ wget -O- http://neuro.debian.net/lists/focal.de-fzj.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
$ sudo apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
update the list of packages APT can find:
$ sudo apt update
install the fsl packages you want, e.g.
$ sudo apt install fsl-5.0 fsl-harvard-oxford-cortical-lateralized-atlas

Install Redis server in CentOS6 , how?

How to install redis server in CentOS 6 that installed DirectAdmin in it?
Did test several methods but no success!
I want use Redis for Magento Cache
Assuming you have already installed redis, it is running and you are able to run rediscli MONITOR (which should say OK), you are probably missing the phpredis extension.
Usually this is easy to install, but in combination with DirectAdmin it requires some additional attention:
First, install igbinary, which will greatly improve your object serialisation experience.
pecl install igbinary igbinary-devel should do the trick, -but- on many CentOS systems the /tmp dir is mounted with nosuid,noexec which will prevent phpize from completing during the installation, because pecl will use /tmp/pear/temp/ as the build-dir.
I fixed this by editing /etc/fstab:
--- /dev/mapper/vg_directadmin-lv_tmp /tmp ext4 defaults,noatime,noexec,nosuid,errors=continue 1 2
+++ /dev/mapper/vg_directadmin-lv_tmp /tmp ext4 defaults,noatime,errors=continue 1 2
and remounting /tmp with mount -o remount /tmp. After that pecl install igbinary igbinary-devel should work.
Next, download and install phpredis, using the --enable-redis-igbinary option. On my DirectAdmin installation the CLI php version as a different path than the one from DirectAdmin, so we'll explicitly use the DirectAdmin version which lives in /usr/local/php5/:
cd /tmp
wget https://github.com/nicolasff/phpredis/tarball/0ae592b
tar xzvf 0ae592b
cd nicolasff-phpredis-0ae592b/
/usr/local/php5/bin/phpize
./configure --enable-redis-igbinary --with-php-config=/usr/local/php5/bin/php-config
make
make install
After that, your extension should be installed under /usr/local/php5/lib/php/extensions/ .
Last thing that remains is to edit /usr/local/etc/php5/cgi/php.ini and add your new extensions to be loaded. Add:
extension=igbinary.so
extension=redis.so
Restart apache afterwards, and you should be done.

Setup Macports on an offline machine

I need to install dpkg for my mac and the easiest way I have seen for doing that is to install Macports. Unfortunately the machine I want to install it on is not connected to the internet.
Is there a way to download dpkg and its dependencies for macports and install the packages on the offline machine?
I have seen people mention to set it up on an online machine and move the whole macports folder, however the only machine I have online is running a different OSX version which could cause issues.
Thanks in advance.
You could try to download all sourcefiles using
sudo port fetch rdepof:dpkg
and then copy everything in (/opt/local/var/macports/distfiles/) to the offline machine and put it in the same folder there.
Then you should be able to build dpkg using
sudo port install -s dpkg
The -s option forces macports to build from source. (Prevent MacPorts from installing pre-built package?)

Getting the Error "Required option '-K, --private-key KEY' missing (-h for usage)"

I am using an Ubuntu 12.04. I have downloaded the EC2 CLI tools from the Amazon website. The following are the steps that I have done..
Unzipped the file and put it in a directory.
Set the Java class path properly (My Tomcat is working).
Set the EC2 home path, after that set the EC2 Home and bin path in bashrc
Set the access and secret key in bashrc.
When I am trying to trying to start an instance or do anything for that matter from the terminal, I am getting the error
Required option '-K, --private-key KEY' missing (-h for usage)
Could someone please help me with this?
Posting this so it might be helpful for others. The problem was happening because when I installed Ubuntu I had installed the ec2-tools using the apt-get from terminal.
This version of ec2 which Ubuntu has is an outdated version (it was last updated in 2011).
When I found this out, I removed it. And reconfigured the path to the current version of ec2 cli tools I had downloaded and it worked!!! :)
The way to install newer versions of the ec2-api-tools, as suggested by https://help.ubuntu.com/community/EC2StartersGuide, is to simply add the aws-tools PPA:
sudo apt-add-repository ppa:awstools-dev/awstools
sudo apt-get upgrade
and then a simple apt-get install ec2-api-tools will install the correct version. :)

Having trouble configuring sphinx search

I downloaded sphinx 0.9.9 to my ubuntu 10.4 machine.
I ran cd ~/sphinx-0.9.9 then ./configure, then make then make install.
Make install gave me errors so I ran sudo make install and then there were no errors.
I am going through the documentation. I am at 2.6. Quick Sphinx usage tour.
It says:
All the example commands below assume that you installed Sphinx in /usr/local/sphinx, so searchd can be found in /usr/local/sphinx/bin/searchd.
I do have /usr/local/sphinx but there is no bin folder in it, just etc and var.
It then also says:
there's example.sql sample data file to populate that table with a few documents for testing purposes:
$ mysql -u test < /usr/local/sphinx/etc/example.sql
but inside my /usr/local/sphinx/etc/ folder there is only one file: sphinx.conf
and according to the docs that file shouldnt event exist yet, it should be sphinx.conf.dist
I tried to install sphinx 6 months ago and gave up. I am only revisiting it now, so maybe there is a chance I screwed something up then that is giving me problems now. Is there a way to remove everything sphinx so I can try again fresh? Or does anyone have any other ideas what is going on?
You might try installing the package version of sphinx; it's slightly older, but should work as well. As far as compiling problems, you might check the SphinxSearch forum.
Looks like you have installation issue here.
The output of make command will be helpful.
I would suggest reinstalling sphinx, just delete the folder/or run sudo make uninstall, where you had installed the sphinx, and then following these steps to reinstall sphinx
Update and Grab dependencies. Run these commands in order to get the files you need to install Sphinx.
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install build-essential
sudo apt-get install libmysqlclient15-dev
Download source, Untar and prep. Here's where it gets a bit complicated. You'll need to extract the source, change into the directory and configure Sphinx. Do that with these commands.
tar xvzf sphinx-0.9.8.1.tar.gz
cd sphinx-0.9.8.1/
./configure --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql
Make and Install Sphinx
make
sudo make install

Resources