Wednesday 18 December 2013

Ubuntu 12.04 Couchbase Server and Ruby Client installation


CouchBase Server : 
    The NoSQL document database   
    A flexible JSON model, Couchbase Server makes it easy to modify your applications     without the constraints of a fixed database schema. Submillisecond, high-throughput reads and writes give you consistent high performance. Couchbase Server is easy to scale out, and supports topology changes with no downtime.

1) Install Couchbase server:
     download the package from http://www.couchbase.com/download and install it.
 To know your OS 32bit or 64bit open terminal and
   shell > uname -a

Result for 32-bit Ubuntu: i686 i386 GNU/Linux  
Result for 64-bit Ubuntu: x86_64 x86_64 GNU/Linux  
Follow the instructions and install it and create a sample bucket in it.
Visit the Couchbase server @ http://localhost:8091/

2) Install Ruby client for Couchbase server:  
 beofre installing check if libcouchbase library installed or not ,if not 
 http://www.couchbase.com/communities/ruby/getting-started
   shell> sudo wget -O/etc/apt/sources.list.d/couchbase.list http://packages.couchbase.com/ubuntu/couchbase-ubuntu1204.list
   shell> sudo apt-get update
   shell> sudo apt-get install libcouchbase2-libevent libcouchbase-dev
   
Then install couchbase gem:    
   shell> gem install couchbase  

Test it in irb ,
   
   irb> require 'rubygems'
   irb> require 'couchbase'
   irb> client = Couchbase.connect(bucket: "yourbucketname",hostname: "localhost")