小编Evg*_*kov的帖子

MongoDB rs.initiate 错误:replSetInitiate 仲裁检查失败,因为并非所有提议的集合成员都做出肯定响应

我必须使用 X.509 证书启用内部身份验证来启动我自己的副本集,但我失败了。欢迎任何建议。

Debian 8.2 x64 上的 MongoDB 3.2 x64。

这是 MongoDB 大学课程“M310:MongoDB 安全性”中的一个问题。

一位导师:

您可以使用身份验证选项启动您的服务器成员,然后使用 rs.initiate,然后创建您的用户。

我有这个文件夹结构:

~
`-- shared
    `-- certs
        |-- ca.pem
        |-- client.pem
        `-- server.pem
Run Code Online (Sandbox Code Playgroud)

我创建了这个 bash 脚本来设置我的副本集:

#!/bin/bash

course="M310"
exercise="HW-1.3"
workingDir="$HOME/${course}-${exercise}"
dbDir="$workingDir/db"
logName="mongodb.log"

ports=(31130 31131 31132)
replSetName="rs1"

host=`hostname -f`
initiateStr="rs.initiate({
                 _id: '$replSetName',
                 version: 1,
                 members: [
                  { _id: 0, host: '$host:${ports[0]}' },
                  { _id: 1, host: '$host:${ports[1]}' },
                  { _id: 2, host: '$host:${ports[2]}' }
                 ]
                })"

# create working folder
mkdir -p "$workingDir/"{r0,r1,r2}

# launch …
Run Code Online (Sandbox Code Playgroud)

authentication x509 mongodb

5
推荐指数
1
解决办法
5106
查看次数

标签 统计

authentication ×1

mongodb ×1

x509 ×1