Here is the simplest way to create a 3-node MongoDb replica set using Docker. These instructions were created using Docker on Windows 10 and setup to use Linux containers.
Step 1: Create data volumes for each node
Step 2: Create a file called docker-compose.yml
Step 3: Start the Docker containers
docker-compose.exe up -d
Step 4: Start an interactive MongoDb shell
docker exec -it mongo0 mongo --port 30000
Step 5: Configure the replica set
From the MongoDb shell, type (or paste) the following
If you use this, you probably have to update your hosts file, as well.
On Windows you can find it at:
C:\Windows\System32\drivers\etc\hosts
Add
127.0.0.1 mongo0 mongo1 mongo2 to the file and save it.
Step 6: Initiate the replica set
Still in the MongoDb shell, type (or paste) the following
End result
You should see the MongoDb shell switch to SECONDARY and if you hit Enter a few times it will switch to PRIMARY (it may start out as primary, as well).
You can exit the interactive MongoDb session with quit() or juct ctrl-c
Now you should be able to connect to the replica set using the following connection string
Typescript v2.2 was released today and it offers something that I was waiting for…generate members for interface.
Steps are pretty easy. Here we go.
Download and install the new version of Typescript npm install -g typescript
Open Visual Studio Code and update the setting typescript.tsdk with the following:
"typescript.tsdk" : "{your_path_to_global_npm}\\typescript\\lib" Note: you can get your npm root path by typing npm root -g
open a Typescript file in Visual Studio Code and you should now see 2.2.1 in the status bar
You can find the release notes for Typescript v2.2 here
UPDATE (2016-OCT-10): Everything has changed, for the better. This process is much easier now. I will follow-up soon with a new guide.
For my tests, I sparked up an Ubuntu 14.04 64-bit image in Parallels.
Following the instructions on the Asp.Net site, I was able to get Asp.Net 5 installed on my image.
Here are the steps broken down:
Install the .NET Version Manager (DNVM)
Use the .NET Version Manager (DNVM) to install different versions of the .NET Execution Environment (DNX) on Linux.
Install unzip and curl if you don’t already have them:
Download and install DNVM:
Once this step is complete you should be able to run dnvm and see some help text.
dnvm will output:
___ _ ___ ____ ___
/ _ \/ |/ / | / / |/ /
/ // / /| |/ / /|_/ /
/____/_/|_/ |___/_/ /_/
.NET Version Manager - Version 1.0.0-rc2-15545
By Microsoft Open Technologies, Inc.
DNVM can be used to download versions of the .NET Execution Environment and manage which version you are using.
You can control the URL of the stable and unstable channel by setting the DNX_FEED and DNX_UNSTABLE_FEED variables.
Current feed settings:
Default Stable: https://www.nuget.org/api/v2
Default Unstable: https://www.myget.org/F/aspnetvnext/api/v2
Current Stable Override: <none>
Current Unstable Override: <none>
Use dnvm [help|-h|-help|--help] to display help text.
Install the .NET Execution Environment (DNX)
The .NET Execution Environment (DNX) is used to build and run .NET projects. Use DNVM to install DNX for Mono or .NET Core.
At work we were having trouble with the amount of time one of our pages was taking to move forward. To be fair, this page was doing a lot of work and posting a lot of data in one shot, but it really shouldn’t have been taking upwards of 15-20 seconds.
Using the normal means (Fiddler, Glimpse, Chrome tools, etc), we were still having trouble pinpointing the problem. We ruled out the jQuery validator, JSON serializing and the action method in our controller.
To start, use Nuget to install MiniProfiler into the project. From the Project Management Console, type:
A new file called MiniProfiler.cs will be added to the App_Start folder. Looking in the Init() method in the MiniProfilerStartupModule class, code has already been added to limit MiniProfiler to run for local requests only. We wanted to take this one extra step and add configuration to shut it completely off when the application goes into the wild, but give us the ability to turn it on at a client site, just in case.
In the web.config file, we added:
In the MiniProfiler.cs file, we built a new method to access this configuration setting:
We updated the Init() method to look like:
To place a wrapper around every request, you could add something like:
To profile a method, perhaps a controller action,
When your application runs, you should now see your profiler results in the upper left corner of your browser window.
During this little adventure, one more problem cropped up regarding the sheer size of the data that we were trying to send through the profiler. It was actually maxing out what was allowed over the pipe.
To temporarily get around this, add the following to Application_Start() in the global.asax.cs file (comment or remove this when you are done with it):
Hopefully this provides a good starting point for the next person that may need to jump in and use MiniProfiler.