This file contains hidden or 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
1st step : Create a Dockerfile | |
------------------------------- | |
> touch Dockerfile | |
> notepad Dockerfile | |
''' | |
# Start from argon (latest long term supported version of node) | |
# - argon : Full node dev env (640 MB) | |
# - argon-slim : Full node dev env (200 MB) |
This file contains hidden or 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
# Install + check sails version, 0.11.3 actually | |
npm install -g sails | |
sails -v | |
# Create new app | |
sails new SailsDemo | |
# Launch, open a browser http://localhost:1337 | |
cd SailsDemo |
This file contains hidden or 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
{ | |
"Outputs": { | |
"PublicSlaveDnsAddress": { | |
"Description": "Public slaves", | |
"Value": { | |
"Fn::GetAtt": [ | |
"PublicSlaveLoadBalancer", | |
"DNSName" | |
] | |
} |
This file contains hidden or 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
# Install devd (en version 0.3 à minima) | |
# Create reverse proxy | |
# -H option to see headers | |
# -s for SSL support (DO NOT USE with localtunnel) | |
> devd -p 5000 https://tunnels.apispark.net:443/ -H | |
# Launch tunnel (internet reverse proxy) | |
# - you may need to create an account first... | |
> npm install -g localtunnel | |
> lt --port 5000 --subdomain sfartz |
This file contains hidden or 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
# Create a machine | |
# - Wait for the machine to come up | |
# - Check virtual box | |
# - Display the machine ip | |
CMD> docker-machine create --driver virtualbox <MACHINE> | |
CMD> docker-machine ip <MACHINE> | |
CMD> docker-machine inspect <MACHINE> | |
# Set env to the newly created machine | |
# Activate machine in the Windows Command Shell, ie sets the docker env |
This file contains hidden or 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
> mongo --nodb | |
> config = { shard0 : { smallfiles : "", noprealloc : "", nopreallocj : ""}, shard1 : { smallfiles : "", noprealloc : "", nopreallocj : "" }, shard2 : { smallfiles : "", noprealloc : "", nopreallocj : ""}}; | |
{ | |
"shard0" : { | |
"smallfiles" : "", | |
"noprealloc" : "", | |
"nopreallocj" : "" | |
}, | |
"shard1" : { |
This file contains hidden or 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
Here is one possible solution to the Game of Thrones problem we posed. Please note that we are passing a configuration document to ShardingTest. This will ensure the mongods are created using small files and without preallocating data files and journal files. It should eliminate problems with disk space that some students have reported when using ShardingTest. | |
config = { d0 : { smallfiles : "", noprealloc : "", nopreallocj : ""}, d1 : { smallfiles : "", noprealloc : "", nopreallocj : "" }, d2 : { smallfiles : "", noprealloc : "", nopreallocj : ""}}; | |
cluster = new ShardingTest( { shards : config } ); | |
// shard db | |
sh.enableSharding("houses"); | |
// shard collections | |
sh.shardCollection("houses.stark", {dire_wolves_owned:1}); | |
sh.shardCollection("houses.lannister", {debt_owed:1}); | |
sh.shardCollection("houses.targaryen", {followers:1}); |
This file contains hidden or 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
/* | |
* UI testing with Horseman (phantomjs node integration) | |
* | |
* Installation | |
* see http://www.horsemanjs.org/ | |
* | |
* Run | |
* node <this-file.js> | |
* | |
* Debugging |
NewerOlder