[英]Mongo DB deployment not working in kubernetes because processor doesn't have AVX support
I am trying to deploy a mongo db
deployment together with service, as follows:我正在尝试将
mongo db
部署与服务一起部署,如下所示:
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo-deployment
labels:
app: mongo
spec:
replicas: 1
selector:
matchLabels:
app: mongo
template:
metadata:
labels:
app: mongo
spec:
containers:
- name: mongo
image: mongo:5.0
ports:
- containerPort: 27017
env:
- name: MONGO_INITDB_ROOT_USERNAME
valueFrom:
secretKeyRef:
name: mongo-secret
key: mongo-user
- name: MONGO_INITDB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mongo-secret
key: mongo-password
---
apiVersion: v1
kind: Service
metadata:
name: mongo-service
spec:
selector:
app: mongo
ports:
- protocol: TCP
port: 27017
targetPort: 27017
Even though everything seems to be configured right and deployed, it gets to a CrashLoopBackOff
state instead of Running
, using a kubectl logs <deployment-name>
I get the following error:即使一切似乎都已正确配置和部署,但它会进入
CrashLoopBackOff
状态而不是Running
,使用kubectl logs <deployment-name>
我收到以下错误:
MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
Does anybody know what to do?有人知道该怎么办吗?
To solve this issue I had to run an older mongo-db
docker image version (4.4.6), as follows:为了解决这个问题,我必须运行一个较旧的
mongo-db
docker 映像版本(4.4.6),如下所示:
image: mongo:4.4.6
Reference:参考:
Mongo 5.0.0 crashes but 4.4.6 works #485 Mongo 5.0.0 崩溃但 4.4.6 工作 #485
If you use Windows+VirtualBox this will resolve the issue:如果您使用 Windows+VirtualBox 这将解决问题:
bcdedit /set hypervisorlaunchtype off
DISM /Online /Disable-Feature:Microsoft-Hyper-V
perhaps host reboot required.也许需要重新启动主机。
The latest version that can work WITHOUT AVX
is可以在没有
AVX
的情况下工作的最新版本是
image: mongo:4.4.18
but if you are using it on a VPS, its worth a shot to contact their support, mine said that they changed the CPU type and that fixed the problem.但是如果你在 VPS 上使用它,那么联系他们的支持是值得的,我的说他们改变了 CPU 类型并解决了问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.