Couchbase provides high availability and disaster recovery in several ways:
- Homogenous cluster
- Replication
- Intra-cluster replication
- Cross-data center replication (XDCR)
- Backup and restore
- Rack zone awareness
This blog will show how to create a Couchbase cluster using Couchbase Command Line Interface (CLI). In addition, these steps can also be performed using the Couchbase REST API and the Couchbase Web Console.
Couchbase nodes in a cluster are homogeneous. Applications can write to any node and read from any node. There is no write-to-master and read-from-slave architecture that inherently gives you scalability problems. This allows the Couchbase cluster to truly scale horizontally to meet your growing application demands.
Creating a Couchbase cluster involves the following steps:
- Provision Couchbase: Provision 1 or more Couchbase nodes, say on Amazon Web Services
- Initialize master: Initialize any node to be the “master” of the cluster by calling
cluster-init
CLI command - Create cluster: For all other nodes, create a cluster by invoking the
server-add
CLI command - Rebalance cluster: Finally, rebalance the cluster by calling the
rebalance
CLI command
Provision Couchbase
Provision a Couchbase node on Amazon:
1
2
3
4
5
6
7
8
|
aws ec2 run-instances \
--image-id ami-db95ffbb \
--count 1 \
--instance-type m3.large \
--key-name my-couchbase-key \
--security-groups "Couchbase Server Community Edition-4-0-0-AutogenByAWSMP-"
|
Let’s call this node as “master”.
Initialize Couchbase “master”
Configure the “master” instance and initialize the cluster:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
export COUCHBASE_CLI=/Users/arungupta/tools/Couchbase-Server-4.0.app/Contents/Resources/couchbase-core/bin/couchbase-cli
$COUCHBASE_CLI \
cluster-init \
-c <master-ip>:8091 \
-u Administrator \
-p password \
--cluster-username Administrator \
--cluster-password password \
--cluster-index-ramsize=300 \
--cluster-ramsize=300 \
--services=data,index,query
|
Create another instance, lets call it “worker”. Note, this is not a master/slave architecture. Couchbase cluster is homogenous where any node in the cluster can be “master”.
Create Couchbase Cluster
Add this newly created “worker” instance to the cluster:
1
2
3
4
5
6
7
8
9
10
|
$COUCHBASE_CLI \
server-add \
--cluster=<master-ip>:8091 \
--user Administrator \
--password password \
--server-add=<worker-ip> \
--server-add-username=Administrator \
--server-add-password=password
|
Typically, you’ll create and add multiple nodes to the cluster before rebalancing.
Rebalance Couchbase Cluster
Rebalance the cluster:
1
2
3
4
5
6
7
|
$COUCHBASE_CLI \
rebalance \
--cluster=<master-ip>:8091 \
--user Administrator \
--password password
|
Now, you can create as many instances and easy include them in the cluster.
Adding a single node and rebalancing the cluster can be easily done as a single step:
1
2
3
4
5
6
7
8
9
10
|
$COUCHBASE_CLI \
rebalance \
--cluster=<master-ip>:8091 \
--user Administrator \
--password password
--server-add=<worker-ip>
--server-add-username=Administrator
--server-add-password=password
|
Now, your cluster is accessible at http://<master-ip>:8091 or http://<worker-ip>:8091.
Further references …
- Couchbase Server Developer Portal
- Hello Couchbase Example
- Couchbase CLI
- Questions on StackOverflow, Forums or Slack Channel
- Follow us @couchbasedev
- Couchbase 4.5 Beta
Enjoy!
Source: http://blog.couchbase.com/2016/scaling-rebalancing-couchbase-cluster-cli
There are the many feature in computer for save all setting of windows easily must be looking the get help windows 10 this is the way for share the all problem if you have use windows thanks.
Advices from https://homework-writer.com/blog/unique-schools might be really useful for students. Here you can read more about interesting and unique schools
The article you have shared here very awesome. I really like and appreciated your work. I read deeply your article, the points you have mentioned in this article are useful