kubernetes启动kube-apiserver失败,提示Cannot allocate memory无法分配内存

[root@wcl-k8s-m ~]# systemctl start kube-apiserver
Job for kube-apiserver.service failed because the control process exited with error code. See “systemctl status kube-apiserver.service” and “journalctl -xe” for details.
[root@wcl-k8s-m ~]# journalctl -xn

6月 15 12:03:55 wcl-k8s-m systemd[1]: kube-apiserver.service failed.
6月 15 12:04:00 wcl-k8s-m systemd[1]: kube-apiserver.service holdoff time over, scheduling restart.
6月 15 12:04:00 wcl-k8s-m systemd[1]: Stopped Kubernetes API Server.
– Subject: Unit kube-apiserver.service has finished shutting down
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
– Unit kube-apiserver.service has finished shutting down.
6月 15 12:04:00 wcl-k8s-m systemd[1]: Starting Kubernetes API Server…
– Subject: Unit kube-apiserver.service has begun start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
– Unit kube-apiserver.service has begun starting up.
6月 15 12:04:00 wcl-k8s-m systemd[17737]: Failed at step MEMORY spawning /opt/kubernetes/bin/kube-apiserver: Cannot allocate memory
Subject: Process /opt/kubernetes/bin/kube-apiserver could not be executed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
– The process /opt/kubernetes/bin/kube-apiserver could not be executed and failed.
– The error number returned by this process is 12.
6月 15 12:04:00 wcl-k8s-m systemd[1]: kube-apiserver.service: main process exited, code=exited, status=204/MEMORY
6月 15 12:04:00 wcl-k8s-m systemd[1]: Failed to start Kubernetes API Server.
– Subject: Unit kube-apiserver.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
– Unit kube-apiserver.service has failed.
– The result is failed.
6月 15 12:04:00 wcl-k8s-m systemd[1]: Unit kube-apiserver.service entered failed state.
6月 15 12:04:00 wcl-k8s-m systemd[1]: kube-apiserver.service failed.
kubernetes启动kube-apiserver失败,提示Cannot allocate memory无法分配内存_第1张图片
[root@wcl-k8s-m log]# vi /etc/fstab
[root@wcl-k8s-m log]# cat /etc/fstab
注释掉包含swap的那一行,重启即可
kubernetes启动kube-apiserver失败,提示Cannot allocate memory无法分配内存_第2张图片
部署kubernetes Linux的Swap内存交换机制是一定要关闭的,否则会因为内存交换而影响性能以及稳定性。

QQ群76552012

你可能感兴趣的:(kubernetes)