카우치베이스 서버

Couchbase Cluster using Docker

8 분 읽기

Docker Swarm and Service Mode to create Couchbase Cluster explained how to create a Couchbase Cluster using Docker. It used the concept of a “master” and a “worker” service to simplify and automate the creation of cluster. The homogenous cluster was then created as shown in the architecture diagram below:
docker-service-couchbase-cluster
Complete details and background are in the Couchbase Cluster using Docker blog.

Docker 1.13 was released last week. A new feature in that release allows to deploy multi-container application defined using Docker Compose to multi-host enabled using Swarm mode. Ideally, we’d like to have a single Docker Compose definition that allows to start “master” service and start/scale “worker” service. But the “master” service, more importantly the container within the service, needs to be fully up before the “worker” service can be started. This is because the containers in the “worker” service register with the container in the “master” service to create the cluster. This typically require a bit of handcrafting as defined at Controlling Startup Order in Compose. So we’ll come back to that version later.

This blog will provide a quick refresh of the steps from the original using Docker 1.13. Read this blog for a quick how and the original blog for more details on why.

Create network:

Check the created network using docker network ls command:

Create Couchbase “master” service:

Check the created service using docker service ls command:

Create Couchbase “worker” service:

Check the created service again using docker service ls command:

Check the worker service logs using newly introduced command docker service logs couchbase-worker command. This command, newly introduced in Docker 1.13, pulls logs from all containers in the service and streams them to your console. There is no need to track down which containers are running on which hosts.

Complete logs show how the “worker” service was created and joined the cluster originally created by “master”.

Scale the cluster by scaling the Docker service:

Check the service again using docker service ls command:

Now you’ve a three node Couchbase cluster. Before rebalancing the cluster, let’s quickly check what does 카우치베이스 웹 콘솔 shows.

Couchbase Web Console is accessible at https://localhost:8091 and shows a single Couchbase node with data, index and query service. This node was created using “master” service. Two additional nodes created using “worker” service are shown in Pending Rebalance tab:
docker-couchbase-cluster-1.13-three-nodes
Click on Rebalance to 리밸런싱 the cluster and see the fully rebalanced cluster:
docker-couchbase-cluster-1.13-rebalanced

Want to get started with Couchbase? Look at Couchbase Starter Kits.

Want to learn more about running Couchbase in containers?

이 기사 공유하기

작가

Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.

1개의 응답

  1. […] may also consider running Couchbase Cluster using Docker or read more about Deploying Docker Services to […]

댓글 남기기

카우치베이스 카펠라를 시작할 준비가 되셨나요?

개발 시작하기

NoSQL을 탐색하고, 리소스를 찾아보고, 튜토리얼을 시작하려면 개발자 포털을 확인하세요.

카펠라 프리 사용하기

단 몇 번의 클릭으로 카우치베이스(Couchbase)를 직접 체험해 보세요. Capella DBaaS는 시작하기 가장 쉽고 빠른 방법입니다.

연락해

Couchbase 제품군에 대해 더 알고 싶으신가요? 저희가 도와드리겠습니다.