Sunday, February 10, 2013

Learned Couchbase - Just installed it

As you know, Couchbase is the open source NoSQL database for interactive web and mobile applications. I plan to read a book about Developing with Couchbase Server. First of all, I had to install it. I chose "Community Edition" for my test. If you will implement it you can choose Enterprise Edition and read more.
- Installed in on my host (centos):
[surachart@centos ~]$ wget --continue http://packages.couchbase.com/releases/2.0.0/couchbase-server-community_x86_64_2.0.0.rpm
--2013-02-10 14:46:14--  http://packages.couchbase.com/releases/2.0.0/couchbase-server-community_x86_64_2.0.0.rpm
Resolving packages.couchbase.com... 207.171.187.117
Connecting to packages.couchbase.com|207.171.187.117|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 126528178 (121M) [application/x-redhat-package-manager]
Saving to: ?€?couchbase-server-community_x86_64_2.0.0.rpm?€

100%[======================================================================================================>] 126,528,178  278K/s   in 7m 55s

2013-02-10 14:54:10 (260 KB/s) - ?€?couchbase-server-community_x86_64_2.0.0.rpm?€

[surachart@centos ~]$  sudo rpm --install couchbase-server-community_x86_64_2.0.0.rpm
Starting couchbase-server[  OK  ]

You have successfully installed Couchbase Server.
Please browse to http://centos:8091/ to configure your server.
Please refer to http://couchbase.com for additional resources.

Please note that you have to update your firewall configuration to
allow connections to the following ports: 11211, 11210, 11209, 4369,
8091 and from 21100 to 21299.

By using this software you agree to the End User License Agreement.
See /opt/couchbase/LICENSE.txt.

[surachart@centos ~]$
- Opened browser and setup.
Clicked "SETUP"






On Step 5: set password and clicked "Next"
Note: On Step 1, be able to choose "Start a new cluster" or "Join a cluster now". So!
- Installed in on my new host (centostest1):
[surachart@centostest1 ~]$ sudo rpm --install couchbase-server-community_x86_64_2.0.0.rpm
[sudo] password for surachart:
error: Failed dependencies:
        libcrypto.so.6()(64bit) is needed by couchbase-server-2.0.0-1976.x86_64
        libssl.so.6()(64bit) is needed by couchbase-server-2.0.0-1976.x86_64

[surachart@centostest1 ~]$ yum provides */libcrypto.so.6
Loaded plugins: fastestmirror, security
Determining fastest mirrors
 * base: mirrors.thzhost.com
 * extras: mirrors.thzhost.com
 * updates: mirror-fpt-telecom.fpt.net
base                                                                                                                     | 3.7 kB     00:00
base/primary_db                                                                                                          | 4.5 MB     00:03
extras                                                                                                                   | 3.5 kB     00:00
extras/primary_db                                                                                                        |  23 kB     00:00
updates                                                                                                                  | 3.5 kB     00:00
updates/primary_db                                                                                                       | 5.1 MB     00:21
base/filelists_db                                                                                                        | 5.9 MB     00:04
extras/filelists_db                                                                                                      |  13 kB     00:00
updates/filelists_db                                                                                                     | 3.9 MB     00:15
openssl098e-0.9.8e-17.el6.centos.2.i686 : A compatibility version of a general cryptography and TLS library
Repo        : base
Matched from:
Filename    : /usr/lib/libcrypto.so.6

openssl098e-0.9.8e-17.el6.centos.2.x86_64 : A compatibility version of a general cryptography and TLS library
Repo        : base
Matched from:
Filename    : /usr/lib64/libcrypto.so.6

[surachart@centostest1 ~]$ sudo yum install openssl098e
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.neu.edu.cn
 * extras: mirror.neu.edu.cn
 * updates: mirror-fpt-telecom.fpt.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package openssl098e.x86_64 0:0.9.8e-17.el6.centos.2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================
 Package                           Arch                         Version                                        Repository                  Size
================================================================================================================================================
Installing:
 openssl098e                       x86_64                       0.9.8e-17.el6.centos.2                         base                       761 k

Transaction Summary
================================================================================================================================================
Install       1 Package(s)

Total download size: 761 k
Installed size: 2.2 M
Is this ok [y/N]: y
Downloading Packages:
openssl098e-0.9.8e-17.el6.centos.2.x86_64.rpm                                                                            | 761 kB     00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : openssl098e-0.9.8e-17.el6.centos.2.x86_64                                                                                    1/1
/sbin/ldconfig: /usr/lib64/libhadoop.so.1 is not a symbolic link

/sbin/ldconfig: /usr/lib64/libhdfs.so.0 is not a symbolic link

  Verifying  : openssl098e-0.9.8e-17.el6.centos.2.x86_64                                                                                    1/1

Installed:
  openssl098e.x86_64 0:0.9.8e-17.el6.centos.2

Complete!
[surachart@centostest1 ~]$ sudo rpm --install couchbase-server-community_x86_64_2.0.0.rpm
Starting couchbase-server[  OK  ]

You have successfully installed Couchbase Server.
Please browse to http://centostest1:8091/ to configure your server.
Please refer to http://couchbase.com for additional resources.

Please note that you have to update your firewall configuration to
allow connections to the following ports: 11211, 11210, 11209, 4369,
8091 and from 21100 to 21299.

By using this software you agree to the End User License Agreement.
See /opt/couchbase/LICENSE.txt.

[surachart@centostest1 ~]$
 - Opened browser and setup.
On Step 1: Chose "Join a cluster now"

Clicked "Next"
Saw server has been associated with the cluster.
This page showed rebalance operation.

I thought it's ok for installation. I will configuration more later, then tested with some commands.
[surachart@centos bin]$ ./couchbase-cli server-list -c 192.168.111.80:8091 -u  Administrator -p password
ns_1@192.168.111.80 192.168.111.80:8091 healthy active
ns_1@192.168.111.81 192.168.111.81:8091 healthy active

[surachart@centos bin]$ ./couchbase-cli server-info -c 192.168.111.80:8091 -u  Administrator -p password
{
  "availableStorage": {
    "hdd": [
      {
        "path": "/",
        "sizeKBytes": 26391624,
        "usagePercent": 38
      },
      {
        "path": "/dev/shm",
        "sizeKBytes": 961456,
        "usagePercent": 0
      },
      {
        "path": "/boot",
        "sizeKBytes": 495844,
        "usagePercent": 14
      }
    ]
  },
  "clusterCompatibility": 131072,
  "clusterMembership": "active",
  "couchApiBase": "http://192.168.111.80:8092/",
  "hostname": "192.168.111.80:8091",
  "interestingStats": {
    "couch_docs_actual_disk_size": 36177370,
    "couch_docs_data_size": 36121645,
    "couch_views_actual_disk_size": 719005,
    "couch_views_data_size": 685418,
    "curr_items": 7304,
    "curr_items_tot": 7304,
    "mem_used": 98621656,
    "vb_replica_curr_items": 0
  },
  "mcdMemoryAllocated": 1502,
  "mcdMemoryReserved": 1502,
  "memoryFree": 120844288,
  "memoryQuota": 1126,
  "memoryTotal": 1969065984,
  "os": "x86_64-unknown-linux-gnu",
  "otpCookie": "kbxxdkfooqhiseqt",
  "otpNode": "ns_1@192.168.111.80",
  "ports": {
    "direct": 11210,
    "proxy": 11211
  },
  "status": "healthy",
  "storage": {
    "hdd": [
      {
        "index_path": "/opt/couchbase/var/lib/couchbase/data",
        "path": "/opt/couchbase/var/lib/couchbase/data",
        "quotaMb": "none",
        "state": "ok"
      }
    ],
    "ssd": []
  },
  "storageTotals": {
    "hdd": {
      "free": 16755514246,
      "quotaTotal": 27025022976,
      "total": 27025022976,
      "used": 10269508730,
      "usedByData": 36896375
    },
    "ram": {
      "quotaTotal": 1180696576,
      "quotaUsed": 1180696576,
      "total": 1969065984,
      "used": 1848221696,
      "usedByData": 98621656
    }
  },
  "systemStats": {
    "cpu_utilization_rate": 100.0,
    "swap_total": 4227850240,
    "swap_used": 782336
  },
  "thisNode": true,
  "uptime": "2376",
  "version": "2.0.0-1976-rel-community"
}
Then tested telnet localhost 11211 :)
[surachart@centos ~]$ telnet localhost 11211
Trying ::1...
Connected to localhost.
Escape character is '^]'.
set test_key 0 0 1
a
STORED
get test_key
VALUE test_key 0 1
a
END

[surachart@centostest1 ~]$ telnet localhost 11211
Trying ::1...
Connected to localhost.
Escape character is '^]'.
get test_key
VALUE test_key 0 1
a
END
 It looks good now for learning :)

1 comment:

Unknown said...

Glad (but not surprised ;)), that it went so easy for you! Let me/us know if you have any further questions (ping me via twitter on @daschl).