Skip to content

Commit 10b9127

Browse files
committed
adding more details about setting up Couchbase cluster
1 parent 604bf62 commit 10b9127

1 file changed

Lines changed: 46 additions & 6 deletions

File tree

chapters/docker-kubernetes.adoc

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ wildfly-rc-bgtkg 1/1 Running 0 9m
623623
+
624624
Notice only one Pod is running now.
625625

626-
## Couchbase Cluster and Persistent Volumes
626+
### Couchbase Cluster and Persistent Volumes
627627

628628
A _Kubernetes Volume_ outlives any containers that run within the Pod, and data is preserved across Container restarts. However the volume will cease to exist when a Pod ceases to exist. This is solved by _Persistent Volumes_ that provide persistent, cluster-scoped storage for applications that require long lived data.
629629

@@ -633,7 +633,7 @@ Creating and using a persistent volume is a three step process:
633633
. User requests storage for pods by using _claims_. Claims can specify levels of resources (CPU and memory), specific sizes and access modes (e.g. can be mounted once read/write or many times write only). This is called as `PersistentVolumeClaim`.
634634
. Claims are mounted as volumes and used in pods for storage.
635635

636-
Lets create the resources and use them:
636+
#### Create Kubernetes resources
637637

638638
. Create persistent volume:
639639
+
@@ -660,19 +660,59 @@ Check status of Replication Controller:
660660
+
661661
```console
662662
./cluster/kubectl.sh get -w po
663-
NAME READY STATUS RESTARTS AGE
664-
couchbase-rc-8d9cn 0/1 ImageNotReady 0 5m
663+
NAME READY STATUS RESTARTS AGE
664+
couchbase-rc-s5o22 0/1 Pending 0 9s
665+
NAME READY STATUS RESTARTS AGE
666+
couchbase-rc-s5o22 0/1 Running 0 47s
667+
couchbase-rc-s5o22 1/1 Running 0 47s
665668
```
666669
+
667-
Wait for the status to change from "`ImageNotReady`" to "`TBD`".
668-
+
669670
. Start Couchbase Service:
670671
+
671672
```console
672673
./cluster/kubectl.sh create -f ~/workspaces/docker-java/attendees/kubernetes/couchbase-service.yaml
673674
service "couchbase-service" created
674675
```
675676

677+
#### Initialize Couchbase Cluster
678+
679+
. Login to minion-1:
680+
+
681+
```console
682+
vagrant ssh minion-1
683+
```
684+
+
685+
. Get container id of the Couchbase server:
686+
+
687+
```console
688+
[vagrant@kubernetes-minion-1 ~]$ sudo docker ps | grep couchbase/server | awk '{ print $1 }'
689+
a9ce3308b43f
690+
```
691+
+
692+
. Attach a bash shell to the Couchbase Docker container:
693+
+
694+
```console
695+
sudo docker exec -it a9ce3308b43f bash
696+
root@couchbase-rc-s5o22:/#
697+
```
698+
+
699+
. Configure Data and Query service on Couchbase server:
700+
+
701+
```console
702+
/opt/couchbase/bin/couchbase-cli cluster-init -u Administrator -p password -c localhost:8091 --cluster-ramsize=300 --cluster-index-ramsize=256 --services=data,query
703+
SUCCESS: init/edit localhost
704+
```
705+
+
706+
. Install travel-sample bucket:
707+
+
708+
```console
709+
TBD
710+
```
711+
712+
#### Add a new Couchbase server to the cluster
713+
714+
. Scale using RC
715+
676716
### Application Logs
677717

678718
. Get a list of the Pods:

0 commit comments

Comments
 (0)