gpt4 book ai didi

mongodb - 复制集设置为 true 时的 stable/mongodb helm 图表身份验证问题

转载 作者:行者123 更新时间:2023-12-03 02:12:45 24 4
gpt4 key购买 nike

这是寻求帮助吗?
是的

我想做什么?
我正在尝试在启用副本集的主图表中使用 stable/mongodb 作为子图表

执行的步骤

  • 将 mongodb 添加为图表文件夹中的子图表
  • 在requirements.yaml中提及此图表的依赖关系
dependencies:
- name: mongodb
version: "5.17.0"
repository: "file://charts/mongodb"
  • 覆盖主图表中的子图表值
mongodb:
usePassword: true
existingSecret: skeleton
mongodbUsername: skeleton
mongodbDatabase: skeleton
replicaSet:
## Whether to create a MongoDB replica set for high availability or not
enabled: true
useHostnames: true
name: rs0
replicas:
secondary: 1
arbiter: 1

- 为此定义 secret secret 为骨架

apiVersion: v1
kind: Secret
metadata:
name: skeleton
type: Opaque
data:
# mongo ha---
mongodb-root-password: <64-bit-encoded-root-password>
mongodb-replica-set-key: <64-bit-encoded-Key>
mongodb-password: <64-bit-encoded-password>

-在deployment.yaml中提供了 headless 服务url mongodb url来连接到此

来自同一 k8s 集群内托管的应用程序

mongodb://<mongodbUsername-value-define-in-value.yaml>:<mongodb-password-value-present-in-secret>@skeleton-mongodb-headless:27017/skeleton?authSource=admin&replicaSet=rs0

  • 我收到错误使用 headless 服务时
[1;30m2019-05-07 05:06:16,085[0;39m => [34mINFO [0;39m [[32mmain[0;39m] [33mcom.mongodb.diagnostics.logging.SLF4JLogger[0;39m: Cluster created with settings {hosts=[skeleton-mongodb-headless:27017], mode=MULTIPLE, requiredClusterType=REPLICA_SET, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500, requiredReplicaSetName='rs0'}
[1;30m2019-05-07 05:06:16,085[0;39m => [34mINFO [0;39m [[32mmain[0;39m] [33mcom.mongodb.diagnostics.logging.SLF4JLogger[0;39m: Adding discovered server skeleton-mongodb-headless:27017 to client view of cluster
[1;30m2019-05-07 05:06:16,175[0;39m => [34mINFO [0;39m [[32mmain[0;39m] [33mcom.mongodb.diagnostics.logging.SLF4JLogger[0;39m: No server chosen by com.mongodb.Mongo$4@359ff4d9 from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=skeleton-mongodb-headless:27017, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out
[1;30m2019-05-07 05:06:16,182[0;39m => [34mINFO [0;39m [[32mcluster-ClusterId{value='5cd11248b2cfc400017b5805', description='null'}-skeleton-mongodb-headless:27017[0;39m] [33mcom.mongodb.diagnostics.logging.SLF4JLogger[0;39m: Exception in monitor thread while connecting to server skeleton-mongodb-headless:27017
com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName='skeleton', source='admin', password=<hidden>, mechanismProperties={}}
at com.mongodb.connection.SaslAuthenticator.wrapException(SaslAuthenticator.java:162)
at com.mongodb.connection.SaslAuthenticator.access$200(SaslAuthenticator.java:39)
at com.mongodb.connection.SaslAuthenticator$1.run(SaslAuthenticator.java:68)
at com.mongodb.connection.SaslAuthenticator$1.run(SaslAuthenticator.java:46)
at com.mongodb.connection.SaslAuthenticator.doAsSubject(SaslAuthenticator.java:168)
at com.mongodb.connection.SaslAuthenticator.authenticate(SaslAuthenticator.java:46)

查询

  • 我是否缺少连接的东西
  • 我们是否需要在连接网址中提供 key 以进行内部通信?

最佳答案

删除 pv 和 Azure 磁盘后,我可以解决此身份验证问题。我还使用了 release-name-mongodb 而不是 release-name-mongodb-headless

关于mongodb - 复制集设置为 true 时的 stable/mongodb helm 图表身份验证问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56019703/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com