[英]Statefulset - Possible to Skip creation of pod 0 when it fails and proceed with the next one?
I currently do have a problem with the statefulset under the following condition: 目前,在以下情况下,我的statefulset确实有问题:
Why: 为什么:
The statefulset is trying to bring pod-0 up first, however this one will not be brought online because of the following message: 有状态集正尝试首先启动pod-0,但是由于以下消息,该Pod-0将不会联机:
[ERROR] WSREP: It may not be safe to bootstrap the cluster from this node. [错误] WSREP:从该节点引导群集可能并不安全。 It was not the last one to leave the cluster and may not contain all the updates.
它不是离开群集的最后一个,并且可能不包含所有更新。 To force cluster bootstrap with this node, edit the grastate.dat file manually and set safe_to_bootstrap to 1
要对此节点强制执行群集引导,请手动编辑grastate.dat文件,并将safe_to_bootstrap设置为1
What i could do alternatively, but what i dont really like: 我可以替代地做些什么,但是我真的不喜欢什么:
What i would like to have: 我想拥有的是:
Is something like that available? 有这样的东西吗? Does someone have any other ideas?
有人还有其他想法吗?
Unfortunately, nothing like that is available in standard functions of Kubernetes. 不幸的是,在Kubernetes的标准功能中没有类似的东西可用。
I see only 2 options here: 我在这里只看到2个选项:
Use InitContainers to somehow check the current state on relaunch. 使用InitContainers以某种方式检查重新启动时的当前状态。 That will allow you to run any code before the primary container is started so you can try to use a custom script in order to resolve the problem etc.
这将允许您在启动主容器之前运行任何代码,因此您可以尝试使用自定义脚本来解决问题等。
Modify the database startup script to allow it to wait for some Environment Variable or any flag file and use PostStart hook to check the state before running a database. 修改数据库启动脚本,以使其等待某些环境变量或任何标志文件,并在运行数据库之前使用PostStart挂钩检查状态。
But in both options, you have to write your own logic of startup order. 但是在这两个选项中,您都必须编写自己的启动顺序逻辑。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.