由于 mongodb 问题,计算控制台连接被拒绝
3127
Created On 12/14/22 12:55 PM - Last Modified 01/07/25 05:49 AM
Question
How to solve DB error preventing defender start
mongo.go:744 Failed to connect to mongo: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: 127.0.0.1:27017, Type: Unknown, Last error: connection() error occurred during connection handshake: dial tcp 127.0.0.1:27017Environment
- Prisma 云计算
- Defender 数据卷托管在NFS卷上
Answer
- 首先,我们检查编排器和容器运行时版本是否符合系统要求
-
kubectl get nodes -o wide
- Get the defender logs
kubectl logs <defender pod name> -n twistlock
and we will see error as follows- mongo.go:744无法连接到 mongo:服务器选择错误:服务器选择超时,当前拓扑:{类型:单一,服务器:[{地址:127.0.0.1 :27017 ,类型:未知,最后一个错误:连接握手期间发生 connection() 错误:拨号 tcp 127.0.0.1:27017
- At this point check on which volume type the defender data folder is mounted on.
-
kubectl get deployment <Prisma Cloud deployment name > -o yaml -n twistlock
output:
-
- 由于 storageClassName 此时披露了它的 nfs 卷,我要求客户将我们推荐的NFS标志添加到他们的 /etc/fstab 中,如此处所述
- As documented in mongodb add the following flags to /etc/fstab on the host where the mongodb is running:
-
bg hard nolock noatime nointr
-
Additional Information
Prisma 云计算资源:
https://docs.paloaltonetworks.com/prisma/prisma-cloud/22-12/prisma-cloud-compute-edition-admin/deployment_patterns/performance_planning#:~:text=分配%20to%20Console.-,存储,-使用%20a%20network
MongoDB官方文档:
NFS