This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.第 8 章 Updating cluster logging
After updating the OpenShift Container Platform cluster from 4.4 to 4.5, you can then update the Elasticsearch Operator and Cluster Logging Operator from 4.4 to 4.5.
Cluster logging 4.5 introduces a new Elasticsearch version, Elasticsearch 6.8.1, and an enhanced security plug-in, Open Distro for Elasticsearch. The new Elasticsearch version introduces a new Elasticsearch data model, where the Elasticsearch data is indexed only by type: infrastructure, application, and audit. Previously, data was indexed by type (infrastructure and application) and project.
Because of the new data model, the update does not migrate existing custom Kibana index patterns and visualizations into the new version. You must re-create your Kibana index patterns and visualizations to match the new indices after updating.
Due to the nature of these changes, you are not required to update your cluster logging to 4.5. However, when you update to OpenShift Container Platform 4.6, you must update cluster logging to 4.6 at that time.
8.1. Updating cluster logging 复制链接链接已复制到粘贴板!
After updating the OpenShift Container Platform cluster, you can update cluster logging from 4.4 to 4.5 by changing the subscription for the Elasticsearch Operator and the Cluster Logging Operator.
When you update:
- You must update the Elasticsearch Operator before updating the Cluster Logging Operator.
You must update both the Elasticsearch Operator and the Cluster Logging Operator.
Kibana is unusable when the Elasticsearch Operator has been updated but the Cluster Logging Operator has not been updated.
If you update the Cluster Logging Operator before the Elasticsearch Operator, Kibana does not update and the Kibana custom resource (CR) is not created. To work around this problem, delete the Cluster Logging Operator pod. When the Cluster Logging Operator pod redeploys, the Kibana CR is created.
If your cluster logging version is prior to 4.4, you must upgrade cluster logging to 4.4 before updating to 4.5.
Prerequisites
- Update the OpenShift Container Platform cluster from 4.4 to 4.5.
Make sure the cluster logging status is healthy:
-
All pods are
ready
. - The Elasticsearch cluster is healthy.
-
All pods are
- Back up your Elasticsearch and Kibana data.
If your internal Elasticsearch instance uses persistent volume claims (PVCs), the PVCs must contain a
logging-cluster:elasticsearch
label. Without the label, during the upgrade the garbage collection process removes those PVCs and the Elasticsearch operator creates new PVCs.If you are updating from an OpenShift Container Platform version prior to version 4.4.30, you must manually add the label to the Elasticsearch PVCs.
For example, you can use the following command to add a label to all the Elasticsearch PVCs:
oc label pvc --all -n openshift-logging logging-cluster=elasticsearch
$ oc label pvc --all -n openshift-logging logging-cluster=elasticsearch
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - After OpenShift Container Platform 4.4.30, the Elasticsearch operator automatically adds the label to the PVCs.
Procedure
Update the Elasticsearch Operator:
-
From the web console, click Operators
Installed Operators. -
Select the
openshift-operators-redhat
project. - Click the Elasticsearch Operator.
-
Click Subscription
Channel. - In the Change Subscription Update Channel window, select 4.5 and click Save.
Wait for a few seconds, then click Operators
Installed Operators. The Elasticsearch Operator is shown as 4.5. For example:
Elasticsearch Operator 4.5.0-202007012112.p0 provided by Red Hat, Inc
Elasticsearch Operator 4.5.0-202007012112.p0 provided by Red Hat, Inc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Wait for the Status field to report Succeeded.
-
From the web console, click Operators
Update the Cluster Logging Operator:
-
From the web console, click Operators
Installed Operators. -
Select the
openshift-logging
project. - Click the Cluster Logging Operator.
-
Click Subscription
Channel. - In the Change Subscription Update Channel window, select 4.5 and click Save.
Wait for a few seconds, then click Operators
Installed Operators. The Cluster Logging Operator is shown as 4.5. For example:
Cluster Logging 4.5.0-202007012112.p0 provided by Red Hat, Inc
Cluster Logging 4.5.0-202007012112.p0 provided by Red Hat, Inc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Wait for the Status field to report Succeeded.
-
From the web console, click Operators
Check the logging components:
Ensure that all Elasticsearch pods are in the Ready status:
oc get pod -n openshift-logging --selector component=elasticsearch
$ oc get pod -n openshift-logging --selector component=elasticsearch
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME READY STATUS RESTARTS AGE elasticsearch-cdm-1pbrl44l-1-55b7546f4c-mshhk 2/2 Running 0 31m elasticsearch-cdm-1pbrl44l-2-5c6d87589f-gx5hk 2/2 Running 0 30m elasticsearch-cdm-1pbrl44l-3-88df5d47-m45jc 2/2 Running 0 29m
NAME READY STATUS RESTARTS AGE elasticsearch-cdm-1pbrl44l-1-55b7546f4c-mshhk 2/2 Running 0 31m elasticsearch-cdm-1pbrl44l-2-5c6d87589f-gx5hk 2/2 Running 0 30m elasticsearch-cdm-1pbrl44l-3-88df5d47-m45jc 2/2 Running 0 29m
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the Elasticsearch cluster is healthy:
oc exec -n openshift-logging -c elasticsearch elasticsearch-cdm-1pbrl44l-1-55b7546f4c-mshhk -- es_cluster_health
$ oc exec -n openshift-logging -c elasticsearch elasticsearch-cdm-1pbrl44l-1-55b7546f4c-mshhk -- es_cluster_health
Copy to Clipboard Copied! Toggle word wrap Toggle overflow { "cluster_name" : "elasticsearch", "status" : "green", } ...
{ "cluster_name" : "elasticsearch", "status" : "green", } ...
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the Elasticsearch cron jobs are created:
oc project openshift-logging
$ oc project openshift-logging
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc get cronjob
$ oc get cronjob
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE elasticsearch-im-app */15 * * * * False 0 <none> 56s elasticsearch-im-audit */15 * * * * False 0 <none> 56s elasticsearch-im-infra */15 * * * * False 0 <none> 56s
NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE elasticsearch-im-app */15 * * * * False 0 <none> 56s elasticsearch-im-audit */15 * * * * False 0 <none> 56s elasticsearch-im-infra */15 * * * * False 0 <none> 56s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the log store is updated to 4.5 and the indices are
green
:oc exec -c elasticsearch <any_es_pod_in_the_cluster> -- indices
$ oc exec -c elasticsearch <any_es_pod_in_the_cluster> -- indices
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the output includes the
app-00000x
,infra-00000x
,audit-00000x
,.security
indices.例 8.1. Sample output with indices in a green status
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the log collector is updated to 4.5:
oc get ds fluentd -o json | grep fluentd-init
$ oc get ds fluentd -o json | grep fluentd-init
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the output includes a
fluentd-init
container:"containerName": "fluentd-init"
"containerName": "fluentd-init"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the log visualizer is updated to 4.5 using the Kibana CRD:
oc get kibana kibana -o json
$ oc get kibana kibana -o json
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the output includes a Kibana pod with the
ready
status:例 8.2. Sample output with a ready Kibana pod
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the Curator is updated to 4.5:
oc get cronjob -o name
$ oc get cronjob -o name
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the output includes the
elasticsearch-delete-*
andelasticsearch-rollover-*
indices.
8.1.1. Post-update tasks 复制链接链接已复制到粘贴板!
If you use Kibana, after the Elasticsearch Operator and Cluster Logging Operator are fully updated to 4.5, you must recreate your Kibana index patterns and visualizations. Because of changes in the security plug-in, the cluster logging upgrade does not automatically create index patterns.