©2015 -
COUCHBASE CBC CLIENT INSTALL
COUCHBASE CBC Command Line Tool
CBC is a handy tool that comes with the Couchbase C Client package. One can do CRUD transactions via command line without building an application. Good for small scale document updates and queries done remotely on a user's platform.
LINUX Installation
LIBEVENT
Check if you have libevent installed. This is a pre-
[chad@lxnode4 Downloads]$ rpm -
package libevent is not installed
You can download the OS specific libevent RPM from pkg.org
Install libevent Package
[root@lxnode4 Downloads]# ls
couchbase-
[root@lxnode4 Downloads]#
[root@lxnode4 Downloads]# rpm -
package libevent is not installed
[root@lxnode4 Downloads]# rpm -
warning: libevent-
[root@lxnode4 Downloads]# rpm -
libevent-
[root@lxnode4 Downloads]#
CBC Installation Using Perl/YUM
1. Download Installation script for Perl.
[chad@lxnode4 Downloads]$ wget http://packages.couchbase.com/clients/c/couchbase-
-
Resolving packages.couchbase.com... 54.231.10.40
Connecting to packages.couchbase.com|54.231.10.40|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9947 (9.7K) [text/x-
Saving to: “couchbase-
100%[=====================================================================================>] 9,947 -
2015-
[chad@lxnode4 Downloads]$ ls
couchbase-
[chad@lxnode4 Downloads]$ file couchbase-
couchbase-
[chad@lxnode4 Downloads]$ ls -
total 12
-
[chad@lxnode4 Downloads]$ less couchbase-
[chad@lxnode4 Downloads]$
2. Run perl installer script as root or sudo.
[root@lxnode4 Downloads]# perl couchbase-
Will determine the kind of system you are using
Can't exec "lsb_release": No such file or directory at couchbase-
Use of uninitialized value $rv in split at couchbase-
lsb_release not found. Parsing /etc/redhat-
Architecture: 64bit. Package Type: RPM. Version: 6
Is this correct? [Y/n]Y
The file '/etc/yum.repos.d/couchbase.repo' already exists. Its contents are:
-
[couchbase]
enabled = 1
name = Couchbase package repository
baseurl = http://packages.couchbase.com/rpm/6.2/x86_64
gpgcheck = 1
gpgkey = http://packages.couchbase.com/rpm/couchbase-
-
Should I replace it? [y/N] y
Running: yum install libcouchbase2-
Loaded plugins: product-
This system is not registered to Red Hat Subscription Management. You can use subscription-
Setting up Install Process
couchbase | 2.5 kB 00:00
Resolving Dependencies
-
-
-
-
-
-
-
-
-
Dependencies Resolved
===============================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================
Installing:
libcouchbase-
libcouchbase2-
libcouchbase2-
Installing for dependencies:
libcouchbase2-
Transaction Summary
===============================================================================================================================
Install 4 Package(s)
Total download size: 458 k
Installed size: 1.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): libcouchbase-
(2/4): libcouchbase2-
(3/4): libcouchbase2-
(4/4): libcouchbase2-
-
Total 107 kB/s | 458 kB 00:04
warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID cd406e62: NOKEY
Retrieving key from http://packages.couchbase.com/rpm/couchbase-
Importing GPG key 0xCD406E62:
Userid: "Couchbase Release Key (RPM) <support@couchbase.com>"
From : http://packages.couchbase.com/rpm/couchbase-
Is this ok [y/N]: y
Importing GPG key 0xD9223EDA:
Userid: "Couchbase Release Key <support@couchbase.com>"
From : http://packages.couchbase.com/rpm/couchbase-
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : libcouchbase2-
Installing : libcouchbase-
Installing : libcouchbase2-
Installing : libcouchbase2-
Verifying : libcouchbase-
Verifying : libcouchbase2-
Verifying : libcouchbase2-
Verifying : libcouchbase2-
Installed:
libcouchbase-
Dependency Installed:
libcouchbase2-
Complete!
Will verify your install..
cbc:
Runtime: Version=2.5.4, Changeset=c1338729754e863cf4ef006be9ff9e749baa40cf
Headers: Version=2.5.4, Changeset=c1338729754e863cf4ef006be9ff9e749baa40cf
IO: Default=libevent, Current=libevent
SSL: .. SUPPORTED
[root@lxnode4 Downloads]#
CBC installation is now done, and the cbc executable binary is located at /usr/bin.
CBC Offline Installation Using RPM
1. Download the tar file for your platform from Couchbase Tar Repository -
2. Manually install the RPM using root account or sudo.
[couchbas@lxnode4 ~]$ cp -
[couchbas@lxnode4 ~]$ cd /tmp
[couchbas@lxnode4 tmp]$ tar xvf libcouchbase-
libcouchbase-
libcouchbase-
libcouchbase-
libcouchbase-
libcouchbase-
libcouchbase-
libcouchbase-
[couchbas@lxnode4 tmp]$
[couchbas@lxnode4 tmp]$ su -
Password:
[root@lxnode4 ~]# cd /tmp/libcouchbase-
[root@lxnode4 libcouchbase-
For first time install (use -
Syntax:
rpm -
libcouchbase-
libcouchbase2-
libcouchbase2-
To upgrade (use -
Syntax:
rpm -
libcouchbase-
libcouchbase2-
libcouchbase2-
[root@lxnode4 libcouchbase-
> libcouchbase-
> libcouchbase2-
> libcouchbase2-
Preparing... ########################################### [100%]
1:libcouchbase2-
2:libcouchbase-
3:libcouchbase2-
4:libcouchbase2-
[root@lxnode4 libcouchbase-
NOTE: In order for cbc to communicate to a remote Couchbase server, your host firewall must be set properly.
See Linux Host Firewall Configuration section for details.
CBC Configuration File
~/.cbcrc is an optinal configuration file where you can define default values for the cbc.
Each entry is a line with a key=value pair.
Common parameters:
connstr
This is the URI string used for connecting to a cluster.
Example REST API with custom port
connstr=http://lxnode1.vlabs.net:8000,lxnode2.vlabs.net:8001,lxnode3.vlabs.net:8002
Example custom memcached ports:
connstr=couchbase://localhost:9100,localhost:9200
password
This is the password used during authentication to your bucket.
Example:
password=myBucketPass
See Couchbase C Client Reference Guide for more details.