400 likes | 529 Views
Chapter 4 How to use cloud computing? Kai Liu, Qunying Huang, Jizhe Xia, Zhenlong Li, and Peter Lostritto. Learning Objectives. Get familiar with two popular cloud services Understand web application using a simple case Learn the basic steps to deploy the web application
E N D
Chapter 4 How to use cloud computing? Kai Liu, Qunying Huang, Jizhe Xia, Zhenlong Li, and Peter Lostritto
Learning Objectives • Get familiar with two popular cloud services • Understand web application using a simple case • Learn the basic steps to deploy the web application • onto cloud services
Learning Materials • Videos: • Chapter_4-Video_1.mp4 • Chapter_4-Video_2.mp4 • Scripts, Files and others: • index.html
Learning Modules • Introduction: popular cloud services • “Hello Cloud” web application • General steps • Special considerations • Deploy the “Hello Cloud” onto Cloud Services • Amazon AWS • Windows Azure • Conclusion and discussions
Two Popular Cloud Computing Services • Amazon AWS • Since 2006 • Comprehensive platform which offers a list of cloud services such as computing, storage, content delivery, database, deployment & management, networking and other services (Varia and Mathew, 2012). • URL: http://aws.amazon.com/
Two Popular Cloud Computing Services • Windows Azure • Since 2008 • Microsoft cloud service which has four parts including Windows Azure, SQL Azure, Windows Azure AppFabric, and Windows Azure Marketplace (Chappell, 2010). • URL: www.windowsazure.com
Learning Modules • Introduction: popular cloud services • “Hello Cloud” web application • General steps • Special considerations • Deploy the “Hello Cloud” onto Cloud Services • Amazon AWS • Windows Azure • Conclusion and discussions
“Hello Cloud” web application Homepage of “Hello Cloud” website
HTML file contents <!DOCTYPE html> <html> <body> <h1>Hello Cloud</h1> <ul> <li><a href="http://aws.amazon.com/">Amazon AWS</a></li> <li><a href="http://www.windowsazure.com/en-us/">Windows Azure</a></li> <li><a href="http://incubator.apache.org/cloudstack/">Apache Cloudstack</a></li> <li><a href="http://www.eucalyptus.com/">Eucalyptus Cloud</a></li> <li><a href="http://www.nimbusproject.org/">Nimbus</a></li> <li><a href="http://opennebula.org/">OpenNebula</a></li> </ul> </body> </html>
Web application Containers • Apache HTTP Server (httpd) • Open Source HTTP server for modern operating systems including Unix and Windows • Apache Tomcat Server • Open Source Software implementation of the Java Servlet and JavaServer Pages (JSP) • Microsoft Internet Information Services (IIS) • Deployed by Microsoft for Microsoft Windows
Learning Modules • Introduction: popular cloud services • “Hello Cloud” web application • HTML page • Web application context • Deploy the “Hello Cloud” onto Cloud Services • Amazon AWS • Windows Azure • Conclusion and discussions
Deploy “Hello Cloud” onto AWS 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance 4. Login to the instance 5. Install and configure web server Video: Chapter_4-Video_1.mp4
Step 1. Sign up for AWS 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance Play Video(1) 4. Login to the instance 5. Install and configure web server Video: Chapter_4-Video_1.mp4 0:00 – 0:29
Step 2. Authorize Network Access • There are two purposes in this step: • Allowing users to access the instance with SSH (Secure Shell) or RDP (Remote Desktop) • Accepting web traffic on specific port 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance Video: Chapter_4-Video_1.mp4 0:30 – 1:18 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance 4. Login to the instance 5. Install and configure web server
Interface of EC2 dashboard 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance 4. Login to the instance 5. Install and configure web server
Authorize Network Accessusing Security Groups 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance • 1. Create "hellocloud" group; • 2. Create a new rule for SSH; 4. Login to the instance 5. Install and configure web server • 3. Create a new rule for HTTP
Step 3. Launch an Instance • Create Key Pair 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance 4. Login to the instance 5. Install and configure web server Video: Chapter_4-Video_1.mp4 1:18 – 4:17
Launching a new instance by searching and using AMI from AWS Marketplace 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance 4. Login to the instance 5. Install and configure web server
Step 4. Login to the instance ssh -i ssh-keypair.pem username@ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance • Login to the instance from Linux or Mac OS Machine 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance Video: Chapter_4-Video_1.mp4 4:17 – 6:49 4. Login to the instance 5. Install and configure web server
Login to the instance from Windows machine,using Putty: http://www.chiark.greenend.org.uk/~sgtatham/putty/ 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance 4. Login to the instance 5. Install and configure web server • Convert Amazon Key Pair to Private Key
1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access • (b) Select private key 6. Transfer the “Hello World” files to the instance 3. Launch an instance • (a) Input Host Name 4. Login to the instance 5. Install and configure web server • (c) Type root as login name
Step 5. Install and Configure the web server $: yum install httpd $: service httpd start $: chkconfighttpd on • Install httpd 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access • Enable port 80 in firewall 6. Transfer the “Hello World” files to the instance 3. Launch an instance • $: iptables -I INPUT -p tcp --dport 80 -j ACCEPT • $: service iptables save 4. Login to the instance 5. Install and configure web server Video: Chapter_4-Video_1.mp4 6:49 – 7:16
Step 6. Transfer "Hello Cloud" file onto the instance $: scp -i myfirstkey.pem index.html ubuntu@ ec2-54-235-3-170.compute-1.amazonaws.com:/root 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance • Transfer files from Linux or Mac OS Machine 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance 4. Login to the instance 5. Install and configure web server Video: Chapter_4-Video_1.mp4 7:16 -- 8:07
Transfer files from Windows machine, using WinSCP: http://winscp.net/eng/index.php 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance 4. Login to the instance 5. Install and configure web server • WinSCP login
Transfer File using WinSCP 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance 4. Login to the instance 5. Install and configure web server
Step 7. Deploy the application $:mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcomebak.conf $:mv /root/index.html /var/www/html $:service httpd restart 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance 4. Login to the instance 5. Install and configure web server Video: Chapter_4-Video_1.mp4 8:07 – 9:59
Step 8. Create an AMI from the running instance 1. Sign up for Amazon AWS 8. Create a new AMI from the running instance 7. Deploy the application 2. Authorize network access 6. Transfer the “Hello World” files to the instance 3. Launch an instance 4. Login to the instance 5. Install and configure web server Video: Chapter_4-Video_1.mp4 10:00 – 13:58
Deploy “Hello Cloud” onto Azure 1. Sign up for Windows Azure 8. Capture an image of running instance 7. Deploy the application 2. Create a virtual machine 6. Transfer the “Hello World” Files to the instance 3. Authorize network access 4. Login to the virtual machine 5. Turn on IIS Click here to view the video demonstrating the steps.
Step 1. Sign up for Windows Azure 1. Sign up for Windows Azure 8. Capture an image of running instance 7. Deploy the application 2. Create a virtual machine 6. Transfer the “Hello World” Files to the instance 3. Authorize network access Video: Chapter_4-Video_2.mp4 0:00 – 0:49 4. Login to the virtual machine 5. Turn on IIS
Step 2. Create a virtual machine Video: Chapter_4-Video_2.mp4 0:49 – 6:28 1. Sign up for Windows Azure 8. Capture an image of running instance 7. Deploy the application 2. Create a virtual machine 6. Transfer the “Hello World” Files to the instance 3. Authorize network access 4. Login to the virtual machine 5. Turn on IIS • Launch Windows Virtual Machine
Step 3. Authorize Network Access Video: Chapter_4-Video_2.mp4 6:28 – 8:10 1. Sign up for Windows Azure 8. Capture an image of running instance 7. Deploy the application 2. Create a virtual machine a) Add an endpoint; 6. Transfer the “Hello World” Files to the instance 3. Authorize network access 4. Login to the virtual machine 5. Turn on IIS • b) Specify the details of the endpoint
Step 4. Login to the Virtual Machine 1. Sign up for Windows Azure 8. Capture an image of running instance 7. Deploy the application 2. Create a virtual machine 6. Transfer the “Hello World” Files to the instance 3. Authorize network access Video: Chapter_4-Video_2.mp4 8:10 – 8:47 4. Login to the virtual machine 5. Turn on IIS • Windows Azure Cloud Management interface
Step 5. Turn on IIS Video: Chapter_4-Video_2.mp4 8:47 – 11:53 1. Sign up for Windows Azure 8. Capture an image of running instance 7. Deploy the application 2. Create a virtual machine 6. Transfer the “Hello World” Files to the instance 3. Authorize network access 4. Login to the virtual machine 5. Turn on IIS • Turn on IIS in the virtual machine
Step 6. Transfer “Hello Cloud” file onto Virtual Machine Cloud consumers can simply copy and paste or drag and drop files between local computer and virtual machine. 1. Sign up for Windows Azure 8. Capture an image of running instance 7. Deploy the application 2. Create a virtual machine 6. Transfer the “Hello World” Files to the instance 3. Authorize network access 4. Login to the virtual machine 5. Turn on IIS Video: Chapter_4-Video_2.mp4 11:53 – 13:52
Step 7. Deploy the application • First, create a folder named hellocloud under "C:\inetpub\wwwroot" directory in the virtual machine • Then, copy the home page of "Hello Cloud" application to hellocloud folder. 1. Sign up for Windows Azure 8. Capture an image of running instance 7. Deploy the application 2. Create a virtual machine 6. Transfer the “Hello World” Files to the instance 3. Authorize network access 4. Login to the virtual machine 5. Turn on IIS
Step 8. Capture an image of running virtual machine • Run sysprep in virtual machine • Shut down the virtual machine in Cloud Management Interface • Click "Capture" button in the bottom of Cloud Management Interface to capture the image. 1. Sign up for Windows Azure 8. Capture an image of running instance 7. Deploy the application 2. Create a virtual machine 6. Transfer the “Hello World” Files to the instance 3. Authorize network access 4. Login to the virtual machine 5. Turn on IIS Video: Chapter_4-Video_2.mp4 13:52 - end
Learning Modules • Introduction: popular cloud services • “Hello Cloud” web application • HTML page • Web application context • Deploy the “Hello Cloud” onto Cloud Services • Amazon AWS • Windows Azure • Conclusion and discussions
Discussion Questions What are the differences between terminating an instance and stopping it on Amazon AWS? How to clean up an instance on AWS if you won't use the instance anymore? What's the differences between shutting down a virtual machine and deleting it on Windows Azure? What are the general steps of deploying a simple web applications onto EC2 and Windows Azure? How to authorize network access in EC2 and Azure? What is the role of the "key pair" in EC2? What is "instance image" in cloud? Why is the relationship between an instance and an image.
References • Chappell, David. "Introducing the windows azure platform." David Chappell & Associates White Paper (2010). • Varia, J.and Mathew, S. 2012. Overview of Amazon Web Services. Available from: from: http://d36cz9buwru1tt.cloudfront.net/AWS_Overview.pdf[Accessed 23 January 2013].