无法从内部kubernetes集群连接mongodb

时间:2019-09-25 14:30:10

标签: mongodb azure azure-kubernetes

我尝试通过bitnami stable / mongodb舵图设置mongodb,舵图安装命令如下-

helm install --name mongo --set mongodbRootPassword=mongo,mongodbUsername=mongo,mongodbPassword=mongo,mongodbDatabase=database stable/mongodb

创建后,我希望通过以下连接字符串格式连接我的应用程序

mongodb://[user]:[password]@[service].[namespace].svc.cluster.local:27017/[db]?replicaSet=rs0&authSource=admin

但是我对此有误-

  

无法连接到服务器   [ mongo.shift-resourcing.svc.cluster.local:27017 ]首次连接时   [ MongoNetworkError:客户端网络套接字在安全之前已断开连接   TLS连接已建立]

mongod.conf文件如下-

# where and how to store data.
   storage:
      dbPath: /bitnami/mongodb/data/db
      journal:
       enabled: true
      directoryPerDB: false
    # where to write logging data.
    systemLog:
      destination: file
      quiet: false
      logAppend: true
      logRotate: reopen
      path: /opt/bitnami/mongodb/logs/mongodb.log
      verbosity: 0
     # network interfaces
    net:
      port: 27017
      unixDomainSocket:
        enabled: true
        pathPrefix: /opt/bitnami/mongodb/tmp
      ipv6: false
      bindIpAll: true
    # replica set options
    #replication:
      #replSetName: replicaset
      #enableMajorityReadConcern: true
    # process management options
    processManagement:
       fork: false
       pidFilePath: /opt/bitnami/mongodb/tmp/mongodb.pid
    # set parameter options
    setParameter:
       enableLocalhostAuthBypass: false
    # security options
    security:
      authorization: enabled
      #keyFile: replace_me

0 个答案:

没有答案
相关问题