This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# init.d script with LSB support. | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <[email protected]> | |
# | |
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# init.d script with LSB support. | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <[email protected]> | |
# | |
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# init.d script with LSB support. | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <[email protected]> | |
# | |
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# init.d script with LSB support. | |
# | |
# Copyright (c) 2007 Javier Fernandez-Sanguino <[email protected]> | |
# | |
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logpath = /var/log/mongodb/mongos.log | |
logappend = true | |
configdb = 127.0.0.1:27019 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configsvr = true | |
logpath = /var/log/mongodb/mongodcfg.log | |
logappend = true | |
dbpath = /work/mongo/configsrv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set | |
var collection = ; | |
var db = ; | |
var fromHost = ; | |
// unshard | |
db = db.getMongo().getDB(db); | |
var collection = db.getCollection(collection); | |
var m = new Mongo(fromHost); |
OlderNewer