Skip to content

Instantly share code, notes, and snippets.

View akira-kurogane's full-sized avatar

Akira Kurogane akira-kurogane

View GitHub Profile

Keybase proof

I hereby claim:

  • I am akira-kurogane on github.
  • I am akirakurogane (https://keybase.io/akirakurogane) on keybase.
  • I have a public key ASA16-RmcRz9ce308c3t5QYaARGLyP8RwcrQR6MShmoVFQo

To claim this, I am signing this object:

@akira-kurogane
akira-kurogane / checkAllVersions.js
Last active February 12, 2016 02:35 — forked from normgraham/checkAllVersions.js
This script traverses all the hosts in a sharded cluster; collects cmdLineOpts, buildInfo, hostInfo, and serverStatus, and makes some basic checks. To use it, save the script on one of your machines and execute it with the following command, ensuring that $HOST and $PORT specify one of your mongos processes: {code} mongo --host $HOST --port $PO…
var checkAllVersions = function (verbose) {
var equalOrLaterVersion = function (v1, v2) {
return (v1[0] > v2[0]) ||
(v1[0] == v2[0] && v1[1] > v2[1]) ||
(v1[0] == v2[0] && v1[1] == v2[1] && v1[2] >= v2[2]);
}
var getHostInfo = function (info) {
try {
@akira-kurogane
akira-kurogane / launch_3_shard_3_cfg_1_mongos.sh
Created January 16, 2015 01:24
Bash script to launch three single mongo shard dbs, three configs, a mongos, and add the shards as initialization.
#!/bin/bash
set -e
set -x
hn=$(hostname -s)
dbpath=${HOME}/fresh_shard_cluster
mkdir ${dbpath} ${dbpath}/shard0{1,2,3} ${dbpath}/shard0{1,2,3}/db ${dbpath}/config{1,2,3} ${dbpath}/config{1,2,3}/db
if [ ! -f ${dbpath}/keyfile ]; then
openssl rand -base64 741 > ${dbpath}/keyfile
chmod 600 ${dbpath}/keyfile