PageRenderTime 32ms CodeModel.GetById 28ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1'use strict';
 2
 3const co = require('co');
 4
 5co(function*() {
 6  var ReplSet = require('mongodb-topology-manager').ReplSet;
 7
 8  // Create new instance
 9  var topology = new ReplSet('mongod', [{
10    // mongod process options
11    options: {
12      bind_ip: 'localhost', port: 31000, dbpath: `/data/db/31000`
13    }
14  }, {
15    // mongod process options
16    options: {
17      bind_ip: 'localhost', port: 31001, dbpath: `/data/db/31001`
18    }
19  }, {
20    // Type of node
21    arbiterOnly: true,
22    // mongod process options
23    options: {
24      bind_ip: 'localhost', port: 31002, dbpath: `/data/db/31002`
25    }
26  }], {
27    replSet: 'rs'
28  });
29
30  yield topology.start();
31
32  console.log('done');
33}).catch(error => {
34  console.error(error);
35  process.exit(-1);
36});