Reader small image

You're reading from  Learning Couchbase

Product typeBook
Published inNov 2015
Publisher
ISBN-139781785288593
Edition1st Edition
Right arrow
Author (1)
Henry Potsangbam
Henry Potsangbam
author image
Henry Potsangbam

Henry Potsangbam is an experienced software developer, administrator, and architect with more than 14 years of experience in enterprise application architecture, design, and development. He's worked in various domains, such as e-commerce, retail, and energy sectors. He is an IBM certified application and solution developer, SAP Certified Netweaver EP Consultant and CIPM (project management). Always fascinated by and interested in exploring emerging technologies to solve business scenarios, Henry has been following NoSQL and Couchbase since its initial release around 2011. In his spare time, he explores, and educates professionals in big data technologies such as Hadoop (Mapr, Hortonworks, and Cloudera), enterprise integration (camel, fuse esb, and Mule), analytics with R, messaging with kafka, rabbitMQ, the OSGI framework, NoSQL (Couchbase, Cassandra, and Mongodb), enterprise architecture, and so on. During his career, he architect private cloud implementation using virtualization for one of the fortune 500 company. He also played active role in provisioning infrastructure for one of the largest cash transfer programme in the world.
Read more about Henry Potsangbam

Right arrow

Chapter 2. The Couchbase Administration Interface

This chapter will provide an overview of various administration interfaces provided by Couchbase. We will explore the web admin user interface in detail and get an overview of the REST API and CLI. You will be using the web UI extensively to manage the Couchbase cluster with ease. It's one of the easiest and most powerful tools provided by Couchbase for managing its clusters.

In any enterprise software, we require some mechanism to interact with, configure, and monitor. Couchbase provides three main tools for administrating its clusters. They are as follows:

  • Web admin UI

  • Administration using the REST API

  • Command line interface

Let's explore each of these options one by one. Before we start exploring each of these tools, we will cover some concepts that you are required to understand to perform various administrative tasks in the cluster.

The need for the Couchbase administrative interface


Couchbase has been designed to make the life of an administrator easy. As seen in the previous chapter, it can be installed with a few clicks, and most of the administrative tasks that are required for running and configuring clusters are managed by the Couchbase server itself. In fact, Couchbase provides very minimal configuration options to bring the cluster up and running, and the majority of these configurations can be performed through a very user-friendly user interface. In most cases, the administrator does not have to make any changes in configuration, unless required.

However, in any system, some operational tasks and maintenance are required to be performed for smooth operation and to keep the system healthy. For instance, when the load on the cluster increases, we can expand it by adding nodes to increase the memory and improve the disk I/O performance. Couchbase provides a mechanism to expand the cluster size when the application...

The web admin UI


Now, let's understand and explore the main administrative web user interface provided for managing Couchbase clusters. It provides a complete interface for configuring, managing, and monitoring Couchbase clusters.

Some of the main functionalities it provides are as follows:

  • The administrator can view the overall health of the Couchbase cluster

  • The administrator can create data buckets, perform configuration, and modify various properties related to buckets

  • The administrator can view active nodes, their configuration, and perform overall operations in the cluster

The web UI provides various tabs that can be used to view cluster information, details of the server nodes, information about data buckets, view configuration, the configuration options for XDCR (for data replication), logging and setting of the cluster name, and so on.

The web admin UI - the settings tab

The Cluster Overview section provides an overview of the Couchbase cluster status. It's the home page of the web console...

Buckets and servers


You already have an idea about buckets from the first chapter. You can view its features from the web console as shown in the following screenshot:

Bucket overiew

The Buckets section allows administrators to observe read/write operations per second and disk I/O of the top active buckets. The administrator can determine the operation load on buckets from this section.

The Servers section provides some hints on how many nodes there are in the cluster, how many servers have a failed status, and whether there are any servers that require rebalancing after joining the cluster.

The Data Buckets view provides two graphs showing the operations per second and disk fetches per second.

Server nodes

When you click on the Server Nodes tab, you will be shown the system resources usage by all nodes that are part of the cluster. You can expand an individual node and view its details.

System resources by node

You will find a warning that displays on the screen stating that the cluster requires...

Views


Administrators can create and manage the Views function for indexing and querying data using the Views tab. You can preview the results from views using this tab. More details about views will be discussed in Chapter 6, Retrieving Documents without Keys Using Views.

XDCR


The XDCR section is used to create and configure cross data center replication, which will be explained in detail in Chapter 9, Data Replication and Compaction.

Log


Errors and problems can be viewed from the Log tab, as shown in the following screenshot:

Log view

Whenever there is any critical issue and a call needs to be logged with Couchbase, you can upload logs from the cluster or individual nodes using the Collect button, as shown in the following screenshot:

The log collection setting

Settings


The administrator can assign a cluster name using the Settings option of the Cluster tab. You can assign the RAM size that will contribute to the Couchbase cluster by each node in this section.

Cluster name settings

You can use the Update Notifications feature, if you want to be notified when a new version of Couchbase server is available.

The administrator can enable an auto-failover when a node fails after a certain threshold timeout. To do this, check the Enable auto-failover option under the Auto-Failover tab and specify the timeout period, as shown here:

Auto-Failover settings

You can configure e-mail alerts for various alerts, that are listed in the Alerts section. You need to specify the e-mail server details in this section.

Auto-Compaction provides options to configure settings related to compaction, which we will explore in more detail in Chapter 9, Data Replication and Compaction. For the time being, you can skip this.

If you forgot to load the sample buckets while configuring...

Couchbase administrative REST API


Another way to administrate Couchbase clusters is by using the REST API. It provides all the features we have discussed in the web console. In fact, the REST API is being used behind the scenes for most of the options displayed in the web console. You can perform all administrative functionalities using the REST API too.

You need some REST API tools to use this feature. In our case, we will use curl. It can be downloaded and installed from http://curl.haxx.se/download.html.

We will see an example as follows. You can refer the Couchbase documentation for comprehensive details on the REST API usages and syntax:

curl -u Administrator:root123 http://localhost:8091/pools/default

This command provides cluster details in a JSON document.

The REST API output

You can get information about a specific bucket that is LearningCouchbase using the following command:

curl -u Administrator:root123 http://localhost:8091/pools/default/buckets/LearningCouchbase

You need to pass...

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.

Summary


This chapter introduced various features provided by the web UI for configuring and monitoring the Couchbase cluster. You have learned how to create bucket and configure node settings in the cluster. Then, we explored how to manage the Couchbase cluster using the REST API and CLI options.

In the next chapter, we will explore documents and understand what documents are all about. We will also discuss JSON and its representation of documents in a Couchbase cluster. We will also explore more about buckets and its configurations.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Learning Couchbase
Published in: Nov 2015Publisher: ISBN-13: 9781785288593
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Henry Potsangbam

Henry Potsangbam is an experienced software developer, administrator, and architect with more than 14 years of experience in enterprise application architecture, design, and development. He's worked in various domains, such as e-commerce, retail, and energy sectors. He is an IBM certified application and solution developer, SAP Certified Netweaver EP Consultant and CIPM (project management). Always fascinated by and interested in exploring emerging technologies to solve business scenarios, Henry has been following NoSQL and Couchbase since its initial release around 2011. In his spare time, he explores, and educates professionals in big data technologies such as Hadoop (Mapr, Hortonworks, and Cloudera), enterprise integration (camel, fuse esb, and Mule), analytics with R, messaging with kafka, rabbitMQ, the OSGI framework, NoSQL (Couchbase, Cassandra, and Mongodb), enterprise architecture, and so on. During his career, he architect private cloud implementation using virtualization for one of the fortune 500 company. He also played active role in provisioning infrastructure for one of the largest cash transfer programme in the world.
Read more about Henry Potsangbam