Initial commit

This commit is contained in:
Arnaud Nelissen
2021-07-16 10:18:13 +02:00
commit 3af7ddab06
5894 changed files with 590836 additions and 0 deletions

30
node_modules/mongoose/tools/auth.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
'use strict';
const Server = require('mongodb-topology-manager').Server;
const co = require('co');
const mongodb = require('mongodb');
co(function*() {
// Create new instance
const server = new Server('mongod', {
auth: null,
dbpath: '/data/db/27017'
});
// Purge the directory
yield server.purge();
// Start process
yield server.start();
const db = yield mongodb.MongoClient.connect('mongodb://localhost:27017/admin');
yield db.addUser('passwordIsTaco', 'taco', {
roles: ['dbOwner']
});
console.log('done');
}).catch(error => {
console.error(error);
process.exit(-1);
});

36
node_modules/mongoose/tools/repl.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
'use strict';
const co = require('co');
co(function*() {
const ReplSet = require('mongodb-topology-manager').ReplSet;
// Create new instance
const 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);
});

45
node_modules/mongoose/tools/sharded.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
'use strict';
const co = require('co');
co(function*() {
const Sharded = require('mongodb-topology-manager').Sharded;
// Create new instance
const topology = new Sharded({
mongod: 'mongod',
mongos: 'mongos'
});
yield topology.addShard([{
options: {
bind_ip: 'localhost', port: 31000, dbpath: `/data/db/31000`, shardsvr: null
}
}], { replSet: 'rs1' });
yield topology.addConfigurationServers([{
options: {
bind_ip: 'localhost', port: 35000, dbpath: `/data/db/35000`
}
}], { replSet: 'rs0' });
yield topology.addProxies([{
bind_ip: 'localhost', port: 51000, configdb: 'localhost:35000'
}], {
binary: 'mongos'
});
console.log('Start...');
// Start up topology
yield topology.start();
console.log('Started');
// Shard db
yield topology.enableSharding('test');
console.log('done');
}).catch(error => {
console.error(error);
process.exit(-1);
});