Book Image

Learning Couchbase

By : Henry Potsangbam
Book Image

Learning Couchbase

By: Henry Potsangbam

Overview of this book

This book achieves its goal by taking up an end-to-end development structure, right from understanding NOSQL document design to implementing full fledged eCommerce application design using Couchbase as a backend. Starting with the architecture of Couchbase to get you up and running, this book quickly takes you through designing a NoSQL document and implementing highly scalable applications using Java API. You will then be introduced to document design and get to know the various ways to administer Couchbase. Followed by this, learn to store documents using bucket. Moving on, you will then learn to store, retrieve and delete documents using smart client base on Java API. You will then retrieve documents using SQL like syntax call N1QL. Next, you will learn how to write map reduce base views. Finally, you will configure XDCR for disaster recovery and implement an eCommerce application using Couchbase.
Table of Contents (12 chapters)
Index

The command line interface


Couchbase also provides the CLI to interact with the Couchbase cluster. You can perform almost all the functionalities that were performed using the web console by using CLI. Since most administrative activities can be performed using the web UI, it won't be explained here due to space constraints. Let me provide a sample command for better understanding. However, you can refer to the Couchbase documentation for details.

You can find all CLI tools in the installation folder. In our case, the installation folder is at C:\Program Files\Couchbase\Server\bin. For Linux, you can find this at /opt/couchbase/bin path.

In order to determine all the buckets in a cluster, you can execute the following command:

couchbase-cli bucket-list -c localhost:8091 -u Administrator -p root123

This is what the output looks like:

The couchbase-cli command accepts the bucket-list parameters to view all buckets in the cluster which is specified with the -c parameter.