This sample shows how Coherence Operator can manage two or more Coherence clusters, and how you can see the logs from both clusters using Kibana.
Return to Coherence Deployments samples / Return to samples
Install Coherence Operator.
Run the following command to install coherence-operator
with log capture enabled:
Note: If you have already installed the
coherence-operator
without log capture enabled, you must delete it usinghelm delete coherence-operator --purge
before continuing.
$ helm install \
--namespace sample-coherence-ns \
--set imagePullSecrets=sample-coherence-secret \
--name coherence-operator \
--set logCaptureEnabled=true \
--set "targetNamespaces={sample-coherence-ns}" \
coherence/coherence-operator
After installation, run the following command to list the pods:
$ kubectl get pods -n sample-coherence-ns
Along with coherence-operator
, the command also returns the elasticsearch
and kibana
pods.
NAME READY STATUS RESTARTS AGE
coherence-operator-7f596c6796-nns9n 2/2 Running 0 41s
elasticsearch-5b5474865c-86888 1/1 Running 0 41s
kibana-f6955c4b9-4ndsh 1/1 Running 0 41s
Install the first Coherence cluster, cluster-a
.
For each cluster, create only two pods to save resources.
$ helm install \
--namespace sample-coherence-ns \
--name cluster-a \
--set clusterSize=2 \
--set cluster=cluster-a \
--set imagePullSecrets=sample-coherence-secret \
--set logCaptureEnabled=true \
coherence/coherence
Install the second Coherence cluster, cluster-b
For each cluster, create only two pods to save resources.
$ helm install \
--namespace sample-coherence-ns \
--name cluster-b \
--set clusterSize=2 \
--set cluster=cluster-b \
--set imagePullSecrets=sample-coherence-secret \
--set logCaptureEnabled=true \
coherence/coherence
Use the port-forward-kibana.sh
script in the
../../common directory to view log messages.
Start port forwarding.
$ ./port-forward-kibana.sh sample-coherence-ns
Forwarding from 127.0.0.1:5601 -> 5601
Forwarding from [::1]:5601 -> 5601
Access Kibana using the following URL:
Note: It may take up to five minutes for the data to reach the elasticsearch instance.
Once logged in, click Dashboard
on the left and choose Coherence Cluster - All Messages
.
You should see messages from both clusters, cluster-a
and cluster-b
.
Run the following command to delete the charts installed in this sample.
$ helm delete cluster-a cluster-b --purge
Before starting another sample, ensure that all pods are removed from the previous sample. To remove coherence-operator
, use the helm delete
command.