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
#ifndef _ALIAS_SAMPLER_H_ | |
#define _ALIAS_SAMPLER_H_ | |
#include <vector> | |
#include <limits> | |
// Placed in the public domain by Chris Dyer <[email protected]> | |
// April 9, 2012 | |
// | |
// R. A. Kronmal and A. V. Peterson, Jr. (1977) On the alias method for |
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
/mnt/database | |
/mnt/logs/mongodb/mongodb.log |
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
$ sudo apt-get update | |
$ mkdir -p /mnt/database | |
$ mkdir -p /mnt/logs/mongodb | |
$ chmod -R 777 /mnt/ |
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
$ sudo chown mongodb:mongodb /db/database | |
$ sudo chown mongodb:mongodb /mnt/logs/mongodb |
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
$sudo chmod 777 /etc/apt/sources.list | |
$sudo echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list | |
$sudo apt-get update | |
$sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
$sudo apt-get update |
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
mongod --dbpath /mnt/database --port 27017 --replSet sqset --oplogSize 50 --logpath /mnt/logs/mongodb/mongodb.log & |
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
mongod --dbpath /mnt/database --port 27017 --replSet sqset --oplogSize 50 --logpath /mnt/logs/mongodb/mongodb.log & |
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
config = {id: 'sqset', members: [ {id: 0, host: 'db01:27017'}, {_id: 1, host: 'db02:27017'} ] } | |
rs.initiate(config); |
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
rs.initiate(config); | |
{ | |
"info" : "Config now saved locally. Should come online in about a minute.", | |
"ok" : 1 | |
} |
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
PRIMARY> | |
SECONDARY> |
OlderNewer