mongodb 문제로 인해 Compute 콘솔에 연결이 거부되었습니다.
3127
Created On 12/14/22 12:55 PM - Last Modified 01/07/25 05:50 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 Cloud 컴퓨팅
- NFS 볼륨에 호스팅된 Defender 데이터 볼륨
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() 오류가 발생했습니다: dial 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 볼륨을 공개했기 때문에 고객에게 여기에 기록된 대로 /etc/fstab에 권장하는 NFS 플래그를 추가하도록 요청했습니다.
- 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 Cloud Compute 리소스:
https://docs.paloaltonetworks.com/prisma/prisma-cloud/22-12/prisma-cloud-compute-edition-admin/deployment_patterns/performance_planning#:~:text=allocation%20to%20Console.-,스토리지,-%20a%20network 사용
MongoDB 공식 문서:
https://www.mongodb.com/docs/v4.2/administration/production-notes/#remote-filesystems-nfs:~:text=원격파일시스템(NFS)%C2%B6