Home > database >  Directing a replicate set environment build one-way replication
Directing a replicate set environment build one-way replication

Time:10-03

Requirements: have A 2.4.6 version directing A replicate set, A, B, C three machines, A main A clump of arbitration, want this group to replicate sets as the main library, to build A library, which means from the perspective of copy, replicate sets all or one of the nodes is the master node, the new increase D the machine as A slave node, I test, without certification can run, but after certification, even from the node on the master node, who has experience in this respect, thank you

CodePudding user response:

Replica set between auth replication with keyfile certification

CodePudding user response:

reference 1st floor rucypli response:
copy set between auth replication with keyfile certification


Thank you for your recovery

A replicate set and copy the sample configuration file

CodePudding user response:

I tried to copy sets no problem but after add the KEY copy impassability
Replicate set configuration:
Dbpath=/data/mongo/t1
Logpath=/data/mongo/t1/master log
Pidfilepath=/data/mongo/t1/master. The pid
Directoryperdb=true
Logappend=true
Port=27017
OplogSize=100
The fork=true
ReplSet=test
Quiet=true
Master=true
KeyFile=/data/mongo/t1/mongo_key
Auth=true


Copy the configuration:
Dbpath=/data/mongo/t4
Logpath=/data/mongo/t4/master log
Pidfilepath=/data/mongo/t4/master. The pid
Directoryperdb=true
Logappend=true
Port=27020
OplogSize=100
The fork=true
Quiet=true
Slave=true
Auth=true
KeyFile=/data/mongo/t4/mongo_key
Source=10.20.0.12:27017

Copy this both add do not add auth impassability, without certification, no problem

CodePudding user response:

https://docs.mongodb.com/v2.6/tutorial/deploy-replica-set-with-auth/

The official document is one of the most simple and clear

CodePudding user response:

Thank you for your reply, but I demand is not set up the RS, I demand is for RS, on the basis of adding a one-way replication, which means the RS as a whole is the main, the new increase a copy from the library

CodePudding user response:

I from the library is certification pass, the error log is as follows:

Mongod (_ZN5mongo11msgassertedEiPKc + 0 x9b) xd9f55b [0]
Mongod (_ZN5mongo10ReplSource14sync_pullOpLogERi + 0 x4880) xba0fa0 [0]
Mongod (_ZN5mongo10ReplSource4syncERi + 0 x2d3) xba14b3 [0]
Mongod (_ZN5mongo9_replMainERSt6vectorIN5boost10shared_ptrINS_10ReplSourceEEESaIS4_EERi + 0 xea) xba3f8a [0]
Mongod (_ZN5mongo8replMainEv + 0 xc1) xba4691 [0]
Mongod (_ZN5mongo15replSlaveThreadEv + 0 x4c) xba4b1c [0]
Mongod () [0 xe26609]
(+/lib64/libpthreads. So. 0 0 x7aa1) x7f7a5ed12aa1 [0]
/lib64/libc. So. 6 + 0 x6d (clone) x7f7a5e0b7bcd [0]
Tue Oct 24 01:17:13. 227/replslave repl: AssertionException trying to slave off of a non - master

If it is no authentication mode, there will be no problem, have a certification, how don't try to shake by

CodePudding user response:

Thank you for your direct messages friend
The log is as follows:

Than process: 12593
All the output going to:/data/mongo/t4/master log
The child process started successfully, the parent exiting
[root @ BJ - ZW - XG - directing - V - 0-12 t4] # tail -f master. The log
Mongod (_ZN5mongo11msgassertedEiPKc + 0 x9b) xd9f55b [0]
Mongod (_ZN5mongo10ReplSource14sync_pullOpLogERi + 0 x4880) xba0fa0 [0]
Mongod (_ZN5mongo10ReplSource4syncERi + 0 x2d3) xba14b3 [0]
Mongod (_ZN5mongo9_replMainERSt6vectorIN5boost10shared_ptrINS_10ReplSourceEEESaIS4_EERi + 0 xea) xba3f8a [0]
Mongod (_ZN5mongo8replMainEv + 0 xc1) xba4691 [0]
Mongod (_ZN5mongo15replSlaveThreadEv + 0 x4c) xba4b1c [0]
Mongod () [0 xe26609]
(+/lib64/libpthreads. So. 0 0 x7aa1) x7f816009faa1 [0]
/lib64/libc. So. 6 + 0 x6d (clone) x7f815f444bcd [0]
Wed 25 02:47:11 Oct. 265/replslave repl: AssertionException trying to slave off of a non - master
Wed 25 02:47:13 Oct., 266 [replslave] trying to slave off of a non - master
An Assertion: 13344: trying to slave off of a non - master
Xdddd81 xba14b3 xba0fa0 xd9f55b 0 0 0 0 0 xba3f8a xba4691 x7f816009faa1 xe26609 xba4b1c 0 0 0 0 0 x7f815f444bcd
Mongod (_ZN5mongo15printStackTraceERSo + 0 x21) xdddd81 [0]
Mongod (_ZN5mongo11msgassertedEiPKc + 0 x9b) xd9f55b [0]
Mongod (_ZN5mongo10ReplSource14sync_pullOpLogERi + 0 x4880) xba0fa0 [0]
Mongod (_ZN5mongo10ReplSource4syncERi + 0 x2d3) xba14b3 [0]
Mongod (_ZN5mongo9_replMainERSt6vectorIN5boost10shared_ptrINS_10ReplSourceEEESaIS4_EERi + 0 xea) xba3f8a [0]
Mongod (_ZN5mongo8replMainEv + 0 xc1) xba4691 [0]
Mongod (_ZN5mongo15replSlaveThreadEv + 0 x4c) xba4b1c [0]
Mongod () [0 xe26609]
(+/lib64/libpthreads. So. 0 0 x7aa1) x7f816009faa1 [0]
/lib64/libc. So. 6 + 0 x6d (clone) x7f815f444bcd [0]
Wed 25 02:47:13 Oct. 272/replslave repl: AssertionException trying to slave off of a non - master
Wed 25 02:47:15 Oct., 274 [replslave] trying to slave off of a non - master
An Assertion: 13344: trying to slave off of a non - master
Xdddd81 xba14b3 xba0fa0 xd9f55b 0 0 0 0 0 xba3f8a xba4691 x7f816009faa1 xe26609 xba4b1c 0 0 0 0 0 x7f815f444bcd
Mongod (_ZN5mongo15printStackTraceERSo + 0 x21) xdddd81 [0]
Mongod (_ZN5mongo11msgassertedEiPKc + 0 x9b) xd9f55b [0]
Mongod (_ZN5mongo10ReplSource14sync_pullOpLogERi + 0 x4880) xba0fa0 [0]
Mongod (_ZN5mongo10ReplSource4syncERi + 0 x2d3) xba14b3 [0]
Mongod (_ZN5mongo9_replMainERSt6vectorIN5boost10shared_ptrINS_10ReplSourceEEESaIS4_EERi + 0 xea) xba3f8a [0]
Mongod (_ZN5mongo8replMainEv + 0 xc1) xba4691 [0]
Mongod (_ZN5mongo15replSlaveThreadEv + 0 x4c) xba4b1c [0]
Mongod () [0 xe26609]
(+/lib64/libpthreads. So. 0 0 x7aa1) x7f816009faa1 [0]
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related