void LegacyReplicationCoordinator::startReplication(TopologyCoordinator*,
                                                        ReplicationExecutor::NetworkInterface*) {
        // if we are going to be a replica set, we aren't doing other forms of replication.
        if (!replSettings.replSet.empty()) {
            if (replSettings.slave || replSettings.master) {
                log() << "***" << endl;
                log() << "ERROR: can't use --slave or --master replication options with --replSet";
                log() << "***" << endl;
            }
            newRepl();

            replSet = true;
            ReplSetSeedList *replSetSeedList = new ReplSetSeedList(replSettings.replSet);
            boost::thread t(stdx::bind(&startReplSets, replSetSeedList));
        } else {
            startMasterSlave();
        }
    }
Beispiel #2
0
void startReplication() {
    /* if we are going to be a replica set, we aren't doing other forms of replication. */
    if (!replSettings.replSet.empty()) {
        if( replSettings.slave || replSettings.master ) {
            log() << "***" << endl;
            log() << "ERROR: can't use --slave or --master replication options with --replSet";
            log() << "***" << endl;
        }
        newRepl();

        replSet = true;
        ReplSetCmdline *replSetCmdline = new ReplSetCmdline(replSettings.replSet);
        boost::thread t( stdx::bind( &startReplSets, replSetCmdline) );

        return;
    }

    startMasterSlave();
}