/node_modules/mongoose/tools/repl.js
https://bitbucket.org/coleman333/smartsite · JavaScript · 36 lines · 26 code · 5 blank · 5 comment · 0 complexity · 656071ffb1e36e54c9b6666a0542d0e1 MD5 · raw file
- 'use strict';
- const co = require('co');
- co(function*() {
- var ReplSet = require('mongodb-topology-manager').ReplSet;
- // Create new instance
- var topology = new ReplSet('mongod', [{
- // mongod process options
- options: {
- bind_ip: 'localhost', port: 31000, dbpath: `/data/db/31000`
- }
- }, {
- // mongod process options
- options: {
- bind_ip: 'localhost', port: 31001, dbpath: `/data/db/31001`
- }
- }, {
- // Type of node
- arbiterOnly: true,
- // mongod process options
- options: {
- bind_ip: 'localhost', port: 31002, dbpath: `/data/db/31002`
- }
- }], {
- replSet: 'rs'
- });
- yield topology.start();
- console.log('done');
- }).catch(error => {
- console.error(error);
- process.exit(-1);
- });