fix(k01): replicate operator shell script and wrap exec with setarch for mongod
build-and-push-harbor / docker-build-push (push) Has been cancelled
build-and-push-harbor / docker-build-push (push) Has been cancelled
This commit is contained in:
@@ -28,13 +28,32 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: mongod
|
- name: mongod
|
||||||
|
# 复刻 mongodb-community-operator 在 mongodbstatefulset.go 中生成的启动脚本
|
||||||
|
# (buildMongodbCommand),并在 exec mongod 前插入 setarch linux64 --uname-2.6。
|
||||||
|
#
|
||||||
|
# mongod 8.0+ 在 kernel ≥ 6.19 上有两处拒绝启动的检查:
|
||||||
|
# 1. docker-entrypoint.py 的 enforce_kernel_compatibility — 读 uname 版本,≥ 6.19 即 exit 1
|
||||||
|
# 2. mongod 自身的 validateRseqKernelCompat — 同样的内核版本检查
|
||||||
|
# setarch 开启 UNAME26 personality,使 uname().release 返回 2.6.x,两处检查均不触发。
|
||||||
|
#
|
||||||
|
# GLIBC_TUNABLES=glibc.pthread.rseq=1 让 glibc 注册 rseq,避免 tcmalloc 自行注册
|
||||||
|
# per-thread rseq 时在 6.19+ 上触发 SIGSEGV。
|
||||||
|
# 参考:SERVER-121912, github.com/google/tcmalloc/issues/292
|
||||||
|
# 以上 workaround 使 mongod 8.3.1 可在 Ubuntu 26.04 (kernel 7.0) 上运行。
|
||||||
command:
|
command:
|
||||||
- setarch
|
- /bin/sh
|
||||||
- linux64
|
- -c
|
||||||
- --uname-2.6
|
- |
|
||||||
- python3
|
if [ -e /hooks/version-upgrade ]; then
|
||||||
- /usr/local/bin/docker-entrypoint.py
|
/hooks/version-upgrade
|
||||||
- mongod
|
fi
|
||||||
|
echo "Waiting for automation-mongod.conf and keyfile..."
|
||||||
|
while ! [ -f /data/automation-mongod.conf -a -f /var/lib/mongodb-mms-automation/authentication/keyfile ]; do
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
|
sleep 15
|
||||||
|
echo "Starting mongod via setarch uname-2.6 wrapper..."
|
||||||
|
exec setarch linux64 --uname-2.6 mongod -f /data/automation-mongod.conf
|
||||||
env:
|
env:
|
||||||
- name: GLIBC_TUNABLES
|
- name: GLIBC_TUNABLES
|
||||||
value: glibc.pthread.rseq=1
|
value: glibc.pthread.rseq=1
|
||||||
|
|||||||
Reference in New Issue
Block a user