View mongos
#!/bin/sh | |
# | |
# init.d script with LSB support. | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org> | |
# | |
# This is free software; you may redistribute it and/or modify | |
# it under the terms of the GNU General Public License as | |
# published by the Free Software Foundation; either version 2, | |
# or (at your option) any later version. |
View mongodb-configsrv
#!/bin/sh | |
# | |
# init.d script with LSB support. | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org> | |
# | |
# This is free software; you may redistribute it and/or modify | |
# it under the terms of the GNU General Public License as | |
# published by the Free Software Foundation; either version 2, | |
# or (at your option) any later version. |
View mongodb
#!/bin/sh | |
# | |
# init.d script with LSB support. | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org> | |
# | |
# This is free software; you may redistribute it and/or modify | |
# it under the terms of the GNU General Public License as | |
# published by the Free Software Foundation; either version 2, | |
# or (at your option) any later version. |
View mongodb-arbiter
#!/bin/sh | |
# | |
# init.d script with LSB support. | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org> | |
# | |
# This is free software; you may redistribute it and/or modify | |
# it under the terms of the GNU General Public License as | |
# published by the Free Software Foundation; either version 2, | |
# or (at your option) any later version. |
View mongodb-arbiter.conf
# mongodb-arbiter.conf | |
# Where to store the data. | |
# Note: if you run mongodb as a non-root user (recommended) you may | |
# need to create and set permissions for this directory manually, | |
# e.g., if the parent directory isn't mutable by the mongodb user. | |
#dbpath=/var/lib/mongodb | |
dbpath=/work/mongo/db_arbiter |
View mongos.conf
logpath = /var/log/mongodb/mongos.log | |
logappend = true | |
configdb = 127.0.0.1:27019 |
View mongodb-configsrv.conf
configsvr = true | |
logpath = /var/log/mongodb/mongodcfg.log | |
logappend = true | |
dbpath = /work/mongo/configsrv |
View crc32.js
// @link http://www.digsys.se/JavaScript/CRC.aspx | |
var crc32 = { | |
// CRC polynomial 0xEDB88320 | |
tab: [ // integer because this is a copy-paste from json string | |
0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035, | |
249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049, | |
498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639, | |
325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317, | |
997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443, | |
901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665, |
View shard-status.js
// shard-status | |
while (true) { | |
db.currentOp().inprog.forEach(function(row) { if (row.query.moveChunk) printjson(row.query.shardId + " " + row.msg + " secs: " + row.secs_running + " switches: " + row.numYields); }); | |
sleep(1000); | |
} |
View mongodb-unshard.js
// set | |
var collection = ; | |
var db = ; | |
var fromHost = ; | |
// unshard | |
db = db.getMongo().getDB(db); | |
var collection = db.getCollection(collection); | |
var m = new Mongo(fromHost); |
OlderNewer