Installing CouchDB and Futon on Ubuntu 14.10

[easyazon_link asin=”0596155891″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] CouchDB [/easyazon_link] is distributed, NoSQL database which means that it is very good at scaling up to handle huge quantities of data by simply adding more machines to your database. [easyazon_link asin=”1449303439″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] CouchDB [/easyazon_link] can transparently handle scaling out your database across multiple machines, or you can define specifically how it should distribute your data.

The best scenario when you want to use [easyazon_link asin=”0596155891″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] CouchDB [/easyazon_link] in your environment is:

  • Have a relatively simple data structure not focused on creating unique records
  • Have flexible data that might not follow a particular structure in all cases
  • Have the need to work with huge amounts of data that needs to be inserted quickly

So lets to install [easyazon_link asin=”1449307558″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] CouchDB [/easyazon_link] on [easyazon_link asin=”0672338378″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] Ubuntu 14.10 [/easyazon_link]system:

Before you start the installation make sure that you have installed curl. This is one of the way to talk to the [easyazon_link asin=”1430272376″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] CouchDB [/easyazon_link], it is a command line utility that gives you control over raw HTTP requests and you can see right away what is happening in your [easyazon_link asin=”0321826620″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] CouchDB [/easyazon_link].

sudo apt-get update
sudo apt-get install curl
sudo apt-get install couchdb

These command will update system, install curl in case your do not have it and of course install the CouchDB database on your machine. To check and confirm that CouchDB is installed on your system you will need to run this command in terminal

curl localhost:5984

You should see the confirmation message as it is shown in the picture.

couchdb

To access the CouchDB via GUI we can use utility called Futon which is part of the CouchDB installation. Open your browser and enter this: localhost:5984/_utils – and you should see now graphical interface for CouchDB.

futon

 

 

As a first thing you should change the ADMIN credentials as for now – everyone is admin 🙂 – go to the left down corner and click on Fix This to make the changes.

Here are some  CLI example to work with your CouchDB:

# List of all databases
curl -X GET localhost:5984/_all_dbs
# Create database mytestdb  (it has to be lowercase ONLY)
curl -X PUT localhost:5984/mytestdb
# Delete database  mytestdb
curl -X DELETE localhost:5984/mytestdb
# Retrieve information about database mytestdb
curl localhost:5984/mytestdb
# Get server information
curl localhost:5984
# See current configuration
curl localhost:5984/_config

samples

 

Here is good reference on [easyazon_link asin=”1849513589″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] CouchDB [/easyazon_link]:

How to backup the [easyazon_link asin=”1430272376″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] CouchDB [/easyazon_link] ? You can dump entire [easyazon_link asin=”1449303129″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] CouchDB [/easyazon_link] into a file

curl -X GET localhost:5984/mytestdb/_all_docs?include_docs=true > MyDBBackup.txt

couchdbs

Here is some projects on Github with backup tools for [easyazon_link asin=”1449307558″ locale=”US” new_window=”default” nofollow=”default” tag=”wn0d5-20″ add_to_cart=”default” cloaking=”default” localization=”default” popups=”default”] CouchDB [/easyazon_link]:

The one like most comes with 2 scripts – backup.sh and restore.sh – you can grab the project from here on GitHub

[easyazon_block add_to_cart=”default” align=”left” asin=”0596155891″ cloaking=”default” layout=”top” localization=”default” locale=”US” nofollow=”default” new_window=”default” tag=”wn0d5-20″]

Leave a Reply