我有一个两个成员的mongo复制集。通过密钥文件启用身份验证。问题是奴隶陷入STARTUP2状态并且没有进一步移动。似乎同步开始然后它抱怨没有找到要同步的成员。这可能是什么问题? 也无法连接到奴隶上的mongo shell,它也卡住了。
来自主要
的日志2016-06-08T01:04:38.023+0000 I CONTROL [main] ***** SERVER RESTARTED *****
2016-06-08T01:04:38.044+0000 I CONTROL [initandlisten] MongoDB starting : pid=43288 port=27017 dbpath=/var/lib/mongo 64-bit host=test-mongo1
2016-06-08T01:04:38.044+0000 I CONTROL [initandlisten] db version v3.2.0
2016-06-08T01:04:38.044+0000 I CONTROL [initandlisten] git version: 45d947729a0315accb6d4f15a6b06be6d9c19fe7
2016-06-08T01:04:38.044+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2016-06-08T01:04:38.044+0000 I CONTROL [initandlisten] allocator: tcmalloc
2016-06-08T01:04:38.044+0000 I CONTROL [initandlisten] modules: none
2016-06-08T01:04:38.044+0000 I CONTROL [initandlisten] build environment:
2016-06-08T01:04:38.045+0000 I CONTROL [initandlisten] distmod: rhel70
2016-06-08T01:04:38.045+0000 I CONTROL [initandlisten] distarch: x86_64
2016-06-08T01:04:38.045+0000 I CONTROL [initandlisten] target_arch: x86_64
2016-06-08T01:04:38.045+0000 I CONTROL [initandlisten] options: { config: "/etc/mongod.conf", net: { port: 27017 }, operationProfiling: { mode: "all" }, processManagement: { fork: true, pidFilePath: "/var/run/mongodb/mongod.pid" }, replication: { replSetName: "some_name" }, security: { keyFile: "/etc/mongodb-keyfile" }, storage: { dbPath: "/var/lib/mongo", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2016-06-08T01:04:38.066+0000 I - [initandlisten] Detected data files in /var/lib/mongo created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-06-08T01:04:38.066+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-06-08T01:04:38.613+0000 I STORAGE [initandlisten] Starting WiredTigerRecordStoreThread local.oplog.rs
2016-06-08T01:04:38.613+0000 I STORAGE [initandlisten] The size storer reports that the oplog contains 7 records totaling to 1275 bytes
2016-06-08T01:04:38.613+0000 I STORAGE [initandlisten] Scanning the oplog to determine where to place markers for truncation
2016-06-08T01:04:38.667+0000 I CONTROL [initandlisten]
2016-06-08T01:04:38.667+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-06-08T01:04:38.667+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2016-06-08T01:04:38.667+0000 I CONTROL [initandlisten]
2016-06-08T01:04:38.667+0000 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 4096 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.
2016-06-08T01:04:38.667+0000 I CONTROL [initandlisten]
2016-06-08T01:04:38.670+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongo/diagnostic.data'
2016-06-08T01:04:38.670+0000 I NETWORK [initandlisten] waiting for connections on port 27017
2016-06-08T01:04:38.686+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-06-08T01:04:38.689+0000 I REPL [ReplicationExecutor] New replica set config in use: { _id: "some_name", version: 1, protocolVersion: 1, members: [ { _id: 0, host: "test-mongo1:27017", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, tags: {}, slaveDelay: 0, votes: 1 } ], settings: { chainingAllowed: true, heartbeatIntervalMillis: 2000, heartbeatTimeoutSecs: 10, electionTimeoutMillis: 10000, getLastErrorModes: {}, getLastErrorDefaults: { w: 1, wtimeout: 0 } } }
2016-06-08T01:04:38.689+0000 I REPL [ReplicationExecutor] This node is test-mongo1:27017 in the config
2016-06-08T01:04:38.689+0000 I REPL [ReplicationExecutor] transition to STARTUP2
2016-06-08T01:04:38.690+0000 I REPL [ReplicationExecutor] transition to SECONDARY
2016-06-08T01:04:38.690+0000 I REPL [ReplicationExecutor] conducting a dry run election to see if we could be elected
2016-06-08T01:04:38.690+0000 I REPL [ReplicationExecutor] dry election run succeeded, running for election
2016-06-08T01:04:38.690+0000 I REPL [ReplicationExecutor] election succeeded, assuming primary role in term 2
2016-06-08T01:04:38.690+0000 I REPL [ReplicationExecutor] transition to PRIMARY
2016-06-08T01:04:38.690+0000 I REPL [rsSync] transition to primary complete; database writes are now permitted
2016-06-08T01:04:50.480+0000 I NETWORK [initandlisten] connection accepted from 127.0.0.1:45877 #1 (1 connection now open)
2016-06-08T01:04:50.496+0000 I ACCESS [conn1] Successfully authenticated as principal admin on admin
2016-06-08T01:04:50.497+0000 I REPL [conn1] replSetReconfig admin command received from client
2016-06-08T01:04:50.522+0000 I REPL [conn1] replSetReconfig config object with 2 members parses ok
2016-06-08T01:04:50.545+0000 I ASIO [NetworkInterfaceASIO-Replication-0] Successfully connected to 10.3.0.14:27017
2016-06-08T01:04:50.546+0000 I REPL [ReplicationExecutor] New replica set config in use: { _id: "some_name", version: 2, protocolVersion: 1, members: [ { _id: 0, host: "test-mongo1:27017", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, tags: {}, slaveDelay: 0, votes: 1 }, { _id: 1, host: "10.3.0.14:27017", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, tags: {}, slaveDelay: 0, votes: 1 } ], settings: { chainingAllowed: true, heartbeatIntervalMillis: 2000, heartbeatTimeoutSecs: 10, electionTimeoutMillis: 10000, getLastErrorModes: {}, getLastErrorDefaults: { w: 1, wtimeout: 0 } } }
2016-06-08T01:04:50.546+0000 I REPL [ReplicationExecutor] This node is test-mongo1:27017 in the config
来自奴隶的日志
2016-06-08T01:04:38.661+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/var/lib/mongo/diagnostic.data'
2016-06-08T01:04:38.661+0000 I NETWORK [initandlisten] waiting for connections on port 27017
2016-06-08T01:04:38.661+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-06-08T01:04:50.503+0000 I NETWORK [initandlisten] connection accepted from 10.3.0.13:32897 #1 (1 connection now open)
2016-06-08T01:04:50.520+0000 I ACCESS [conn1] Successfully authenticated as principal __system on local
2016-06-08T01:04:50.523+0000 I NETWORK [conn1] end connection 10.3.0.13:32897 (0 connections now open)
2016-06-08T01:04:50.524+0000 I NETWORK [initandlisten] connection accepted from 10.3.0.13:32898 #2 (1 connection now open)
2016-06-08T01:04:50.545+0000 I ACCESS [conn2] Successfully authenticated as principal __system on local
2016-06-08T01:04:50.584+0000 I ASIO [NetworkInterfaceASIO-Replication-0] Successfully connected to test-mongo1:27017
2016-06-08T01:04:50.713+0000 I REPL [replExecDBWorker-0] Starting replication applier threads
2016-06-08T01:04:50.713+0000 I REPL [ReplicationExecutor] New replica set config in use: { _id: "some_name", version: 2, protocolVersion: 1, members: [ { _id: 0, host: "test-mongo1:27017", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, tags: {}, slaveDelay: 0, votes: 1 }, { _id: 1, host: "10.3.0.14:27017", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, tags: {}, slaveDelay: 0, votes: 1 } ], settings: { chainingAllowed: true, heartbeatIntervalMillis: 2000, heartbeatTimeoutSecs: 10, electionTimeoutMillis: 10000, getLastErrorModes: {}, getLastErrorDefaults: { w: 1, wtimeout: 0 } } }
2016-06-08T01:04:50.713+0000 I REPL [ReplicationExecutor] This node is 10.3.0.14:27017 in the config
2016-06-08T01:04:50.713+0000 I REPL [ReplicationExecutor] transition to STARTUP2
2016-06-08T01:04:50.714+0000 I REPL [rsSync] ******
2016-06-08T01:04:50.714+0000 I REPL [rsSync] creating replication oplog of size: 1336MB...
2016-06-08T01:04:50.714+0000 I REPL [ReplicationExecutor] Member test-mongo1:27017 is now in state PRIMARY
2016-06-08T01:04:50.771+0000 I STORAGE [rsSync] Starting WiredTigerRecordStoreThread local.oplog.rs
2016-06-08T01:04:50.771+0000 I STORAGE [rsSync] The size storer reports that the oplog contains 0 records totaling to 0 bytes
2016-06-08T01:04:50.771+0000 I STORAGE [rsSync] Scanning the oplog to determine where to place markers for truncation
2016-06-08T01:04:51.286+0000 I REPL [rsSync] ******
2016-06-08T01:04:51.286+0000 I REPL [rsSync] initial sync pending
2016-06-08T01:04:51.398+0000 I REPL [ReplicationExecutor] syncing from: test-mongo1:27017
2016-06-08T01:04:51.974+0000 I REPL [rsSync] initial sync drop all databases
2016-06-08T01:04:51.974+0000 I STORAGE [rsSync] dropAllDatabasesExceptLocal 1
2016-06-08T01:04:51.974+0000 I REPL [rsSync] initial sync clone all databases
2016-06-08T01:04:51.975+0000 I REPL [rsSync] initial sync cloning db: admin
2016-06-08T01:04:52.224+0000 I INDEX [rsSync] build index on: admin.system.users properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "admin.system.users" }
2016-06-08T01:04:52.224+0000 I INDEX [rsSync] building index using bulk method
2016-06-08T01:04:52.260+0000 I INDEX [rsSync] build index done. scanned 2 total records. 0 secs
2016-06-08T01:04:52.380+0000 I INDEX [rsSync] build index on: admin.system.version properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "admin.system.version" }
2016-06-08T01:04:52.380+0000 I INDEX [rsSync] building index using bulk method
2016-06-08T01:04:52.402+0000 I INDEX [rsSync] build index done. scanned 1 total records. 0 secs
2016-06-08T01:04:52.403+0000 I REPL [rsSync] initial sync data copy, starting syncup
2016-06-08T01:04:52.403+0000 I REPL [rsSync] oplog sync 1 of 3
2016-06-08T01:04:52.404+0000 I REPL [rsSync] oplog sync 2 of 3
2016-06-08T01:04:52.405+0000 I REPL [rsSync] initial sync building indexes
2016-06-08T01:04:52.405+0000 I REPL [rsSync] initial sync cloning indexes for : admin
2016-06-08T01:04:52.427+0000 I STORAGE [rsSync] copying indexes for: { name: "system.users", options: {} }
2016-06-08T01:04:52.521+0000 I INDEX [rsSync] build index on: admin.system.users properties: { v: 1, unique: true, key: { user: 1, db: 1 }, name: "user_1_db_1", ns: "admin.system.users" }
2016-06-08T01:04:52.521+0000 I INDEX [rsSync] building index using bulk method
2016-06-08T01:04:52.543+0000 I INDEX [rsSync] build index done. scanned 2 total records. 0 secs
2016-06-08T01:04:52.543+0000 I STORAGE [rsSync] copying indexes for: { name: "system.version", options: {} }
2016-06-08T01:04:52.544+0000 I REPL [rsSync] oplog sync 3 of 3
2016-06-08T01:04:52.545+0000 I - [rsSync] Creating profile collection: admin.system.profile
2016-06-08T01:04:52.715+0000 I REPL [ReplicationExecutor] could not find member to sync from
配置
# mongod.conf
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# Where and how to store data.
storage:
dbPath: /var/lib/mongo
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
# network interfaces
net:
port: 27017
#bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces.
security:
keyFile: /etc/mongodb-keyfile
operationProfiling:
mode: all
replication:
replSetName: somename
#sharding:
## Enterprise-Only Options
#auditLog:
#snmp: