DinoStore Build

Dino_Store Build Lab 10

So here we are on lab 10, wow it’s nearly done!

So for this one, I knew I would need a website, so I went ahead and brought, one it was cheap and cost me all of $2.

AmbersNet702Project costs; 2.PNG

After this, I needed to go into the AWS route 53 Console, and once in here, we need to create the hosted zone with the Settings as shown below. This will give us the name servers.

The name servers; 4.PNG

Once This has been done, we need to note down the name servers, these are of which that follows.

  • ns-960.awsdns-56.net
  • ns-1850.awsdns-39.co.uk
  • ns-1218.awsdns-24.org
  • ns-257.awsdns-32.com

These need to be copied and Pasted into the Name servers part of our domain settings as shown below. This replaces the original name servers with the ones we created before.

Name Servers; 5.PNG

Once this has been done we need to go back and Create a record set in the same AWS console as before, in this we will point it at the load balancer that we had used in a previous lab, the settings are of which that follows.

Creating a link to the LB; 6.PNG

And now we wait for the DNS system to update, it has been half an hour so far, ill report back how long it took me when I figure it out. it took about an hour, and the website is up on the website address that I got from go daddy along with the changing internal Ip address.

The hosting website; 7.PNG

Lab 10 finished !!

Advertisements
DinoStore Build

Dino-Store Lab; 9: Enabling Auto Scale to Handle Spikes and Troughs

This is located in the EC2 dashboard, as shown below, to set off we will “Create auto Scaling Group” and then go into and “Create launch Configurations”

Creating athe Auto Scaling Group.PNG

Below we can see the settings I used to create the Launch Configuration

Reviewing the settings; 2.PNG

 

Now we have created the launch configuration we will create the Auto Scaling group with the settings as shown Below.

 

Creating the settings for the LB; 3

 

 

Once these have been created we will go back to the Instances and watch the Auto Scale Instances being created as shown Below, this will take about 15 minutes

New Instances Being created; 5New Instances Being Created; 6

Once these has been completed, we will Be able to Bring up our Web page and see multiple ip addresses, There were four in the end. After this we will delete the two original Servers, then we will be running just on the Auto Scale servers Since there are Two Servers, we will have two internal IP address’s as shown below.

This slideshow requires JavaScript.

And now we can test the system even further, by deleting one of the needed servers, and it took a bit of time but after deleting the Sever the Auto Scale settings allowed another server to be automatically created.

And this is the end of the Lab !!

 

 

 

 

 

 

DinoStore Build

Dino-Store Lab; 8 Using ELB to Scale Applications

In this lab we are going to create a Load Balancer, this is in the EC2 Console as shown below.

Creating a new load balncer.PNG

In this we can see the settings we have used in the below photos, these Will be used for both Web servers, both primary and backup. in this, we will use the WEbRDPGroup we have previously created.

This slideshow requires JavaScript.

While these are being created our servers are going to be Out of service, this took me about 20 minutes. Once this is complete the load Balancers will state they are ” in service” Creating the Load balancing Load thingy; 4.PNG

Now we need to test the load balancer, to do this I will Copy the DNS from the load balancer into the website’s address as shown below. We know the load balancer is working because we can see the Ip address change twice as shown Below.

This slideshow requires JavaScript.

And this shows the lab has been Finished!

DinoStore Build

Dino-Store Lab; 7 Using Elastic IPs

While in the EC2 Dashboard we will go into the Elastic IPs section a once in this we will “Allocate New address” Creating a new Elastic Ip address; 1.PNG

once this has been made as shown we need to choose the associated address, this is done as shown below.Creating a new Associate address;4.PNG

Now we can use that Ip address as part of Our website as shown below, also note the internal address

Noting the internal and external Address; 3.PNG

Once we have done this we can Choose an alternative assistance address from the previously created image, and then we have to tick the ‘Reassociation’, box and then click ‘Associate’.  After this paste in the IP address in again and Note the Internal Ip address has changed.

New internal address; 6.PNG

Now, this lab has finished! Yuss

DinoStore Build

Dino-Store Lab; 6 Adding EC2 Virtual Machines and Deploying the Web App

For this we will be creating an amazon Image, these are called amazon machine image (AMI).

For this, we will go into the EC2 Desktop, we will Right-click the Virtual Machine we want an image of, then we will go into “create image” from there as shown below.

Creating a new Intance image; 1.PNGOnce we have done that it will lead us into the Screen below where we will name it and put the description in.

Imagine settings; 2.PNG

The first one we created was of the web server now we need to create another one for the Queing Server. Below shows both Images in the process being made.

Image setting up; 3.PNG

Once these have been created we can then further go into these and Launch these, In these, you can See the settings within these below.

  1. Type = t2.micro
  2. IAM role = WebServerRole
  3. Add a tag (e.g. Name = WebServer02)
  4. Select an existing security group = WebRDPGroup

Now after this has been launched we can copy that public DNS name into the Website address for our dino store to see if it is in fact a working replica, Below shows it in working form.

Putting in the websites name with the public DNS,; 4.PNG

Now we have done this lab

DinoStore Build

Dino-Store Lab; 5 Adding EC2 Virtual Machines and Deploying the Web App

First of all, in this lab we need to Get into the AMI Dashboard, once in this, we need to go into the Policies part that is down the left side. Then we will create  a Policy In the Policy Generator as shown Below

Creating a Policey gen; 1.PNG

Now we need to go into this and create the policies to Allow Both DynamoDB and SQS access as shown below.

Creating statements; 4.PNG

After this, we need to create a Web Server Role and attach the New Poly we have just created as shown Below.

This slideshow requires JavaScript.

Now we need to go into the EC2 dashboard in this we need to Launch a new instance, this will before the Web Server.

This slideshow requires JavaScript.

We need to create a new Security Group, and this will be the Group that we will use for the rest of the assignment so make sure you name properly. You can see the Settings below for this below.

Creating a new Security group for the instance; 10.PNG

Now we need To create another Instance, this time for the Queuing Server, In this, we will Create a Different Security croup.

ANother instance; 11

Now we need to launch the Web server.

Launching the web server; 12.PNG

When we get into this we need to install IIS on the server itself. in this, we need to make sure we have everything as selected below otherwise it will simply not work and come back with an error 404.3 I was stuck on this error for ages. It was Solved by installing the .Net Extention 4.5

 

This slideshow requires JavaScript.

While this is happening, we need to go into Visual Studio and Publish the DinoStore project, Store this somewhere you can easily get to like the Desktop. Then copy it to the VMS desktop.

Publishing the files; 16.PNG

Next, we need to copy this from the VMs desktop into the IIS Root folder as shown below.

Then after this we need to go into the ISS manager located in the roles and features,  in this we have already put our Published web site into the root folder so this will show up when we go into sites.

Converting to a WEbpage in iiss; 20.PNG

Once in here, we need to “convert Into application” this shouldn’t take to long.

After this, we need to go back to the VPC dashboard and load the Security group that was created when we made our First RDS group. Once in here, we need to Change the Inbound Rules to include the new security groups as shown below.

 

Now we need to go back to the VM and carry on with this,

In the Folder we have just published in the IIS, find the web.config file and go into it. In this, we need to Change the code and take out the keys in this as shown below because the site will have Temp credentials from the Url provided.

Changing the code; 23.PNG

Save this and then go back to the ISS plane, in this go to the content view. Once in this, “Brouse” The Defult.aspx, this should show a website as showen below.

New working ; 24.PNG

Now once that is done we need to insert a public DNS into it this will be done by taking out the localhost and swapping it for the Public  DNS From the VM itself as shown below.

New local host; 26.PNG

After this, we need to put the order processing into the Que server, in Visual Studio we need to First release the DinoStore.OrderProcesser and then Publish. Note you will have to do this from a Folder on your desktop because the names will be too long and will error out. Once this is done, we need to copy it over into the the Que Server as shown below.

Other Server; 27.PNG

Next, need to set the Order processor to run on startup, for this we will Create a shortcut of the “Setup.exe” File and Run it in the Startup Menu as shown below. After this, we will test the system with creating an order to see if the Program works. And it does. Yay !!!New working 30.PNG

Now we will go back to the order Database and see the Order we have just created., And this works too !! yayae

The working; 32.PNG

Yus Lab is done !!

DinoStore Build

Dino-Store Blog; 4: Configuring the System to use Simple Queue Service

 

First of all in the Lab we need to create a new Que in the Simple Que Service, (SQS) , this Is done with in the SQS inside of amazone, this is done Vai the Create NEw Que Button

Creating a new Q service; 1.PNG

Then we need to test this system buy sending the System Que messages, these are done buy right clicking the Que and and going into the Vewi/Delete messages section. In this we need to “Poll” the Messages as far as i can understand this is Gathering the messages. After this we need to poll and then Further delete the messages.

This slideshow requires JavaScript.

 

Inside of Visual Studio we need to go into the “Cheakout.aspx.cs section, in this we need to remove Code and then Further add in the code that was collected from the lab itself. The code to be taken out is between line 66 to line 126, and this will be replaced.

This slideshow requires JavaScript.

 

AFter this we needed to add the “callers” up the top of the code so this can be used as showen below;

Changed Postition CODE NOTE CHANGE; 8

Next we have to Download the write Packages, This caused me alot of issues because i was confused as to what were the write packeages to have. I added packages to DinoStore.Objects and this was wrong and caused me more issues, i also tryed having the packages the same over all of the Project, and this caused even more issues aswell as adding in uneeded code and Files.

I finally Went through and changed my packages to Mirrior my Class mates as showen below. I have added in photos for Everything needed.

Note i have not got anything in for Dinostore Objects, this is because this classhes.

Next we need to Go into the DinoStore WEb.config File and Add in the Access key Infomation,  this is Done in the ValidationSettings Processer.

Save this changed code ;  9.PNG

Now to test the System we have just created !!!We need to Log in and create an order.

This slideshow requires JavaScript.

Next we need to cheak the Que system and see if we have a message there with our order. as showen below.

SMS messages; 11.PNG

Next wee Need to add an application to Pull the orders into the que !, in this we need to add the Order.Processor to the Solution Note, add this to the same file as everything else because it would be able to call it from out in another folder. In this new Project we need to change the Qurls to our own, and showen below. This needs to happen twice both to Reqest.Url and BatchReqest.URL

Adding in new code; 13.PNG

After this we need to Go into the App.config file in this floder to add in our Key infomation as showen below, Note i went back and added in my Key Region;

Addin in yet more data ; 14.PNG

As showen above we also needed to change the Connection String, this was just copied from the Dinostore Web.config file so i know its coreect.

After this we need to Right click on the Dinostore.orderprocesser From and set it to start on Start as well as uncheaking the “Sign the Oneclick Manafests” in the properties.

Once this is done we quickly look at the orders inside of the database, this wont ahve anything init. The next step is to Start the Dinostore Application , this will run the order processers as showen below.

New fixed.PNG

*Note make sure you have deleted all of your test data that we created at the start of the lab, otherwise it will break this.

Now we will go back to to the database, and this should now have orders in it as showen below.

Database; 20.PNG

Now this lab has finished !!