-
Notifications
You must be signed in to change notification settings - Fork 21
Manually Provisioning the .NET App
These instructions assume you already setup the Node.js app, and that you chose to install Visual Studio. Time links (n m n s) in each section take you to a companion video to aid in installation.
Make sure you install v 2.2.0. Newer versions will not work with our project, and may also not work with elasticsearch.
Download couchbase 2.2.0 64 bit or couchbase 2.2.0 32 bit
Installation 0m38s
- Execute the setup file
- Accept the defaults
- Say yes to increase the number of ephemeral ports, if you are asked 1m0s
- When you get to the "Configure Server" step: 1m12s
- Make changes to the file locations, if you wish
- Choose "Start a new cluster"
- You can choose a smaller RAM quota if you want
- When you get to the "Sample Buckets" step: 2m0s
- It's up to you if you want to load them. They will not be used in this course.
- When you get to the "Create Default Bucket" step: 2m7s
- Set the Per Node RAM Quota to 100 MB
- Enable Flush
- When you get to the "Secure this Server" step: 2m37s
- Make sure to keep track of your username and password - I will not help you recover it.
- It's probably easiest if you stick with
Administrator
andpassword
as your username and password - it will make working on the group project with one another much easier
Bucket Creation 3m2s
- From the top menu, choose "Data Buckets"
- Click, "Create New Data Bucket"
- Set the Bucket name to "moviq"
- Set the Per Node RAM Quota to something small - 128-256 MB.
Install Fiddler 4m43s
This will be used as part of the elasticsearch configuration
Download Fiddler for .NET4
- Execute the setup file
- Accept the defaults
Install the Java JDK 5m2s
You might already have this, if you took or are taking a Java programming class
Download Java JDK (i.e. SE Development kit 8)
- Execute the setup file.
- Accept the defaults.
- When it's finished, open an Explorer window (windows+e)
- Right-click "This PC" and choose, "Properties" 5m46s
- Click "Change Settings"
- Open the "Advanced" Tab
- Click the "Environment Variables" button
- Look for a variable named, "JAVA_HOME"
- If you find one, "Edit" it, otherwise click "New"
- Make sure "Variable value" is set to your JDK path (i.e.
C:\Program Files\Java\jdk1.8.0_25
)
Install Elasticsearch 6m48s
As with Couchbase, the version that you install is critical - follow these instructions explicitly
Download elasticsearch 1.0.1
- Unzip Elasticsearch to a location that you want it to run from (i.e.
C:\dev-tools\
) - Open a command prompt (windows+r, then type
cmd
and press enter) - Navigate to the "bin" folder where you unzipped elasticsearch to (i.e.
cd C:\dev-tools\elasticsearch-1.0.1\bin
) - Type
service install
- Keep this cmd window open - we're going to use it again in the next section
- Open Windows Services (windows+r, then type
services.msc
and press enter) - Double-click the Elasticsearch service
- Set the Startup type to "Automatic"
- You should be able to navigate to Elasticsearch now:
http://localhost:9200/_plugin/head
Install Couchbase Elasticsearch Plugin 8m14s
These are based on the Couchbase plugin instructions
- In the cmd window from the Elasticsearch instructions, above, paste the following code and execute:
bin/plugin -install transport-couchbase -url http://packages.couchbase.com.s3.amazonaws.com/releases/elastic-search-adapter/1.3.0/elasticsearch-transport-couchbase-1.3.0.zip
- Open an Explorer window (windows+e)
- Navigate to your Elasticsearch directory, and then into the config folder
- Open "elasticsearch.yml" in a code editor, such as Atom 10m33s
- Paste the following code at the bottom of that file and save (replace the username and password with your own, if they are different):
################################ Couchbase Config ############################
couchbase.username: Administrator
couchbase.password: password
couchbase.maxConcurrentRequests: 1024
Add the moviq bucket 14m35s
- Open Fiddler
- Turn off capturing (bottom left corner)
- Open the "Composer" tab
- Set the verb to
PUT
- Set the URI to
http://localhost:9200/moviq
- Set the headers (just below the URI)
Content-Type: application-json
User-Agent: Fiddler
Host: localhost:9200
Content-Length: 0
- Execute
- You should see a
200
response
Setup the Couchbase Template 16m17s
- In the "Composer" tab
- Set the verb to
PUT
- Set the URI to
http://localhost:9200/_template/couchbase
- The headers should match the headers from above.
- In the Request Body, Add the following line, replacing the file path with the correct file path for your Couchbase plugin template:
<@INCLUDE *C:\dev-tools\elasticsearch-1.0.1\plugins\transport-couchbase\couchbase_template.json*@>
- Execute
- You should see a
200
response
Set the Cross-Data-Center-Replication (XDCR) Max Concurrent Replications in Couchbase 18m5s
- In the "Composer" tab
- Set the verb to
POST
- Set the URI to
http://localhost:8091/internalSettings
- Set the headers (just below the URI)
Content-Type: application-json
User-Agent: Fiddler
Host: localhost:8091
Content-Length: 26
Authorization: Basic [BASE64 AUTH HERE]
- Base64 Encode your username and password
- From the top menu, choose Tools, and then TextWizard
- In the textarea at the top, type
Administrator:password
(or your username colon your password) - Choose "To Base64"
- Copy the encoding
- Paste it in place of [BASE64 AUTH HERE], in the Authorization header
- (Alternatively, you can execute
btoa('Administrator:password')
in a Chrome Developer Tools Console)
- In the Request Body, Add the following line
{ xdcrMaxConcurrentReps: 8 }
Setup XDCR in Couchbase 19m48s
These are based on the Couchbase indexing instructions
- In Chrome, navigate to http://localhost:8091, and login
- Click the XDCR menu item at the top of the page
- Create a Cluster Reference
- Name it "elasticsearch"
- Set the IP/hostname to:
127.0.0.1:9091
- If you get an error, try restarting your Elasticsearch service
- Create Replication
- Choose the moviq Bucket
- Choose the elasticsearch Cluster
- Set the To Bucket to
moviq
- In Advanced settings, set the XDCR Protocol to
Version 1
- Follow along with the video to test your setup 22m19s
Add Data to your moviq Bucket 9m17s
- Open a command prompt (windows+r, then type
cmd
and press enter) - Navigate to the Couchbase bin directory:
cd C:\Program Files\Couchbase\Server\bin
- Restore the Couchbase database from this repo:
cbrestore "[THE PATH TO YOUR DATABASE BACKUP]" http://localhost:8091/ -u [YOUR USERNAME (default is Administrator)] -p [YOUR PASSWORD]
For instance:
cbrestore "D:\dev_git\Heinz95729\Moviq\App_Data\moviq-20141020" http://localhost:8091/ -u Administrator -p password
To follow along with the videos in this course, and to run the app in the same manner in which I do in the videos, you need make a change to your hosts file:
- Navigate to
%windir%\System32\drivers\etc
- Copy the "hosts" file to your desktop
- Open the "hosts" file on your desktop
- Paste the following line at the bottom:
127.0.0.1 heinz95729.local
- Save
- Copy the "hosts" file from your desktop back to
%windir%\System32\drivers\etc
- Provide administrator privileges to overwrite
- The marvel plugin for Elasticsearch
- Github Desktop