- Learning Couchbase
- Henry Potsangbam
- 843字
- 2021-07-30 10:25:02
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 at least two nodes when you configure replication on a bucket. This is obvious since at least two nodes are required in a cluster for replication, one for the active and another for the passive replica.
In this section, the administrator can find the nodes that require rebalancing of data.
Data buckets
The Data Buckets section provides views on data buckets created in the cluster. The administrator can also create buckets and modify its settings using this option.

The Data Bucket view
You can determine the settings of a bucket by expanding it. Let's expand the beer-sample bucket to view its details.

Bucket setting info
You can now view comprehensive details about the bucket. You can also verify whether access to the bucket requires authentication or not. What's more, you can determine the replication factor and configure it for the bucket using this console. You can even perform compaction and defragmentation of disks from this console using the Compact button. More on compaction in Chapter 9, Data Replication and Compaction.
And finally, you can edit the bucket's settings using the Edit button, as displayed in the following screenshot:

Bucket configuration options
Click on the Documents button to view documents in the bucket. You can edit and delete a document using this console. You can even search a particular document using the Document ID, which will be explained later.

The document editor
Most of the time, administrators need to create buckets for each application. This can be done using the Create New Data Bucket button on the Data Buckets tab. Let's now create a new data bucket, as follows:

Bucket creation
Under the Create Bucket window, the administrator needs to add a few details to create a new bucket, as explained in the following:
- Bucket Settings: Here, the administrator can enter the name of the bucket; let's use
MyBucket
, in our case. Out of the two options, you can select the type of bucket as Couchbase for the time being.Note
The following are the types of bucket:
Memcached: This stores documents in the memory only, hence volatile in nature.
Couchbase: This gives persistence to documents by flushing documents on disks.
Further details will be provided in the next chapter.
- Memory Size: Specify the RAM size that needs to be allocated from each node of the cluster for this bucket.
Bucket creation continued
- Access Control: There are two options under this—Standard port and Dedicated port. You can choose Standard port and enter the password as
Mybucket
to secure the bucket when connecting to it from clients.Note
The user ID used to connect to the bucket will be the name of the bucket itself. If you want to make changes to the port number to connect to the bucket using the SDK, you can choose the Dedicated port option and enter the desired port number. Note that the Dedicated port option will not require authentication, and hence, no password!
- Replicas: If there is a need to store the same document on different nodes, replicas need to be enabled. This can be done by selecting the Enable checkbox.
Note
The administrator can configure up to three replicas per bucket. You will get a warning when you have fewer nodes than required for a configured replica. You can also configure the bucket to replicate indexes by selecting the Index replicas checkbox.
Bucket creation continued
- Disk I/O Optimization: The administrator can set this option to either Low, which is the default option, or High.
- Auto-Compaction: By checking this option, you instruct Couchbase to automatically rebuild the stored data and its indexes in order to reduce fragmentation of data.
- Flush: The administrator can enable this to run the Flush command, which deletes all documents inside a bucket.
Tip
Ideally, you should not enable Flush in a production environment so as to avoid accidental flushing. You can enable this option when a temporary bucket is created for an ad hoc requirement.
Click on Create. Now, you can view MyBucket on the console, as shown here:

Bucket overview
- 一本書玩轉數據分析(雙色圖解版)
- 模型制作
- 計算機網絡技術實訓
- 3D Printing for Architects with MakerBot
- 網絡綜合布線設計與施工技術
- 嵌入式操作系統
- Android游戲開發案例與關鍵技術
- PostgreSQL 10 Administration Cookbook
- LMMS:A Complete Guide to Dance Music Production Beginner's Guide
- INSTANT Munin Plugin Starter
- HBase Essentials
- Mastering Ansible(Second Edition)
- 生成對抗網絡項目實戰
- 單片機C51應用技術
- ARM體系結構與編程