在集群节点上设置 vm.max_map_count [英] Set vm.max_map_count on cluster nodes

查看:46
本文介绍了在集群节点上设置 vm.max_map_count的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 Google Container Engine 的集群节点上安装 ElasticSearch(最新),但 ElasticSearch 需要变量:vm.max_map_count >= 262144.

I try to install ElasticSearch (latest) on a cluster nodes on Google Container Engine but ElasticSearch needs the variable : vm.max_map_count to be >= 262144.

如果我 SSH 到每个节点并手动运行:

If I ssh to every nodes and I manually run :

sysctl -w vm.max_map_count=262144

然后一切顺利,但任何新节点都不会具有指定的配置.

All goes fine then, but any new node will not have the specified configuration.

所以我的问题是:

有没有办法在启动时在每个节点上加载系统配置?Deamon Set 不是好的解决方案,因为在 docker 容器内,系统变量是只读的.

Is there a way to load a system configuration on every nodes at boot time ? Deamon Set would not be the good solution because inside a docker container, the system variables are read-only.

我正在使用一个带有 gci 节点映像的新创建的集群.

I'm using a fresh created cluster with the gci node image.

推荐答案

您应该能够使用 DaemonSet 来模拟启动脚本的行为.如果脚本需要在节点上执行根级操作,您可以将 DaemonSet pod 配置为以特权模式运行.

You should be able to use a DaemonSet to emulate the behavior of a startup script. If the script needs to do root-level actions on the node, you can configure the DaemonSet pods to run in privileged mode.

有关如何执行此操作的示例,请参阅 https://github.com/kubernetes/contrib/tree/master/startup-script

For an example of how to do this, see https://github.com/kubernetes/contrib/tree/master/startup-script

这篇关于在集群节点上设置 vm.max_map_count的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆