设置 vm.max_map_count 与 tuned

Setting vm.max_map_count with tuned

尝试使用节点调整运算符和 openshift ClusterLogging 运算符设置 vm.max_map_count。 Openshift 版本是 4.9.17,集群日志和 elasticsearch operators 是最新的。

这是我调整的配置:

apiVersion: tuned.openshift.io/v1
kind: Tuned
  name: common-services-es
  namespace: openshift-cluster-node-tuning-operator
spec:
  profile:
    - data: |
        [main]
        summary=Optimize systems running ES on OpenShift nodes
        include=openshift-node
        [sysctl]
        vm.max_map_count=262144
      name: common-services-es
  recommend:
    - match:
        - label: component
          type: pod
          value: elasticsearch
      priority: 5
      profile: common-services-es

我的 ClusterLogging 运算符配置是默认运算符,我可以验证 pod 上的标签 component=elasticsearch

使用以下命令获取 pod 日志

for p in `oc get pods -n openshift-cluster-node-tuning-operator -l openshift-app=tuned -o=jsonpath='{range .items[*]}{.metadata.name} {end}'`; do printf "\n*** $p ***\n" ; oc logs pod/$p -n openshift-cluster-node-tuning-operator | grep applied; done

returns tuned.daemon.daemon: static tuning from profile 'common-services-es' applied 在我的所有 3 个 es 节点上,但 elasticsearch pod 仍然无法启动并出现错误 max virtual memory areas vm.max_map_count [253832] is too low, increase to at least [262144] 和 运行 sysctl vm.max_map_count在节点上确认该值为 253832。

事实证明,IBM Cloud openshift 不使用 machineconfigs,而 tuned 使用 machineconfigs。