MongoDB の問題により Compute コンソールへの接続が拒否されました
3127
Created On 12/14/22 12:55 PM - Last Modified 01/07/25 05:48 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コンピューティング
- 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 Cloud Compute リソース:
https://docs.paloaltonetworks.com/prisma/prisma-cloud/22-12/prisma-cloud-compute-edition-admin/deployment_patterns/performance_planning#:~:text=allocated%20to%20Console.-,Storage,-Using%20a%20network
MongoDB 公式ドキュメント:
https://www.mongodb.com/docs/v4.2/administration/production-notes/#remote-filesystems-nfs:~:text=リモートファイルシステム(NFS)%C2%B6