如何在Openshift中更改pod的内核参数?

时间:2018-06-01 14:31:02

标签: elasticsearch kubernetes kernel openshift

尝试在Openshift上运行Elastic Search 6.2.4,但它没有运行,容器以代码137退出。

[2018-06-01T14:24:58,148][INFO ][o.e.p.PluginsService     ] [jge060C] 

loaded module [ingest-common]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService     ] [jge060C] loaded module [lang-expression]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService     ] [jge060C] loaded module [lang-mustache]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService     ] [jge060C] loaded module [lang-painless]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService     ] [jge060C] loaded module [mapper-extras]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService     ] [jge060C] loaded module [parent-join]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService     ] [jge060C] loaded module [percolator]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService     ] [jge060C] loaded module [rank-eval]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService     ] [jge060C] loaded module [reindex]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService     ] [jge060C] loaded module [repository-url]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService     ] [jge060C] loaded module [transport-netty4]
[2018-06-01T14:24:58,149][INFO ][o.e.p.PluginsService     ] [jge060C] loaded module [tribe]
[2018-06-01T14:24:58,150][INFO ][o.e.p.PluginsService     ] [jge060C] loaded plugin [ingest-geoip]
[2018-06-01T14:24:58,150][INFO ][o.e.p.PluginsService     ] [jge060C] loaded plugin [ingest-user-agent]
[2018-06-01T14:24:58,150][INFO ][o.e.p.PluginsService     ] [jge060C] loaded plugin [x-pack-core]
[2018-06-01T14:24:58,150][INFO ][o.e.p.PluginsService     ] [jge060C] loaded plugin [x-pack-deprecation]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService     ] [jge060C] loaded plugin [x-pack-graph]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService     ] [jge060C] loaded plugin [x-pack-logstash]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService     ] [jge060C] loaded plugin [x-pack-ml]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService     ] [jge060C] loaded plugin [x-pack-monitoring]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService     ] [jge060C] loaded plugin [x-pack-security]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService     ] [jge060C] loaded plugin [x-pack-upgrade]
[2018-06-01T14:24:58,151][INFO ][o.e.p.PluginsService     ] [jge060C] loaded plugin [x-pack-watcher]
[2018-06-01T14:25:01,592][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [controller/131] [Main.cc@128] controller (64 bit): Version 6.2.4 (Build 524e7fe231abc1) Copyright (c) 2018 Elasticsearch BV
[2018-06-01T14:25:03,271][INFO ][o.e.d.DiscoveryModule    ] [jge060C] using discovery type [zen]
[2018-06-01T14:25:04,305][INFO ][o.e.n.Node               ] initialized
[2018-06-01T14:25:04,305][INFO ][o.e.n.Node               ] [jge060C] starting ...
[2018-06-01T14:25:04,497][INFO ][o.e.t.TransportService   ] [jge060C] publish_address {10.131.3.134:9300}, bound_addresses {[::]:9300}
[2018-06-01T14:25:04,520][INFO ][o.e.b.BootstrapChecks    ] [jge060C] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2018-06-01T14:25:04,531][INFO ][o.e.n.Node               ] [jge060C] stopping ...
[2018-06-01T14:25:04,623][INFO ][o.e.n.Node               ] [jge060C] stopped
[2018-06-01T14:25:04,624][INFO ][o.e.n.Node               ] [jge060C] closing ...
[2018-06-01T14:25:04,634][INFO ][o.e.n.Node               ] [jge060C] closed

从日志中可以看出,必须增加vm max heap size。事实证明它是一个内核参数,如何更改运行ES的pod?

2 个答案:

答案 0 :(得分:3)

每个pod都无法更改

内核命令行参数,但webView.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { if (isConnected()) { try { Thread.sleep(2000); view.saveWebArchive(path_to_saveDir); } catch (InterruptedException e) { Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG).show(); } } } }); 是您可以通过sysctl更改的参数。

为解决方案看到这两个类似的SO问题:

官方Kubernetes documentation on sysctl

中还有一个更一般的解释

答案 1 :(得分:1)

您无法更改单个pod的内核参数;它们必须在基础操作系统中修复。