前提:
- 已经拥有 OpenShift4.6 cluster
- Elasticsearch节点都需要自己的存储卷,默认情况下OCP安装 3 个Elasticsearch节点,内存限制为 16GB
使用 WEB控制端安装 OpenShift Logging
安装 Elasticsearch Operator
确认 Status 是 Succeeded
安装OpenShift Elasticsearch Operator
点击 Install
安装OpenShift Logging
创建 OpenShift Logging实例
Administration-> Custome Resource Definitions
搜索 logging
Actions-> View Instances
右角点击 Create ClusterLogging
把下面的 yaml 复制到上图的黑幕处
apiVersion: "logging.openshift.io/v1"
kind: "ClusterLogging"
metadata:
name: "instance"
namespace: "openshift-logging"
spec:
managementState: "Managed"
logStore:
type: "elasticsearch"
retentionPolicy:
application:
maxAge: 1d
infra:
maxAge: 7d
audit:
maxAge: 7d
elasticsearch:
nodeCount: 3
storage:
storageClassName: "<storage-class-name>"
size: 200G
resources:
requests:
memory: "8Gi"
proxy:
limits:
memory: 256Mi
requests:
memory: 256Mi
redundancyPolicy: "SingleRedundancy"
visualization:
type: "kibana"
kibana:
replicas: 1
curation:
type: "curator"
curator:
schedule: "30 3 * * *"
collection:
logs:
type: "fluentd"
fluentd: {}
注意置换 storageclassname
点击 Create
查看下是否创建成功
MacBook-Pro:~ christina$ oc get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
cluster-logging-operator 1/1 1 1 50m
MacBook-Pro:~ christina$ oc get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
cluster-logging-operator 1/1 1 1 51m
elasticsearch-cdm-kyvbodwj-1 0/1 1 0 13s
elasticsearch-cdm-kyvbodwj-2 0/1 1 0 12s
elasticsearch-cdm-kyvbodwj-3 0/1 1 0 11s
可以看到 elasticsearch 出现了
官方文档在这里