Initial commit

This commit is contained in:
Luis Fernando Molina committed 2018-09-03 15:19:57 +02:00
commit f47e08fdcb
2409 files changed
+363607

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
'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);
});