Chapter 4 How to use cloud computing? Kai Liu, Qunying Huang, Jizhe Xia, Zhenlong Li, and Peter Lostritto K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 1 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 K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 2 Learning Materials • Videos: o o Chapter_4-Video_1.mp4 Chapter_4-Video_2.mp4 • Scripts, Files and others: o index.html K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 3 Learning Modules 1. Introduction: popular cloud services 2. “Hello Cloud” web application • General steps • Special considerations 3. Deploy the “Hello Cloud” onto Cloud Services • Amazon AWS • Windows Azure 4. Conclusion and discussions K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 4 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/ K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 5 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 K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 6 Learning Modules 1. Introduction: popular cloud services 2. “Hello Cloud” web application • General steps • Special considerations 3. Deploy the “Hello Cloud” onto Cloud Services • Amazon AWS • Windows Azure 4. Conclusion and discussions K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 7 “Hello Cloud” web application Homepage of “Hello Cloud” website K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 8 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> K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 9 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 K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 10 Learning Modules 1. Introduction: popular cloud services 2. “Hello Cloud” web application • HTML page • Web application context 3. Deploy the “Hello Cloud” onto Cloud Services • Amazon AWS • Windows Azure 4. Conclusion and discussions K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 11 Deploy “Hello Cloud” onto AWS Video: Chapter_4-Video_1.mp4 K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 12 Step 1. Sign up for AWS Play Video(1) Video: Chapter_4-Video_1.mp4 0:00 – 0:29 K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 13 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) Video: Chapter_4-Video_1.mp4 • Accepting web traffic on specific port 0:30 – 1:18 Play Video(2) K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 14 Interface of EC2 dashboard K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 15 Authorize Network Access using Security Groups 1. Create "hellocloud" group; 3. Create a new rule for HTTP 2. Create a new rule for SSH; K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 16 Step 3. Launch an Instance Create Key Pair Play Video(3) Video: Chapter_4-Video_1.mp4 1:18 – 4:17 K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 17 Launching a new instance by searching and using AMI from AWS Marketplace K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 18 Step 4. Login to the instance • Login to the instance from Linux or Mac OS Machine ssh -i ssh-keypair.pem username@ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com Play Video(4) Video: Chapter_4-Video_1.mp4 4:17 – 6:49 K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 19 Login to the instance from Windows machine, using Putty: http://www.chiark.greenend.org.uk/ ~sgtatham/putty/ Convert Amazon Key Pair to Private Key K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 20 (b) Select private key (a) Input Host Name (c) Type root as login name K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 21 Step 5. Install and Configure the web server • Install httpd $: yum install httpd $: service httpd start $: chkconfig httpd on • Enable port 80 in firewall $: iptables -I INPUT -p tcp --dport 80 -j ACCEPT $: service iptables save Video: Chapter_4-Video_1.mp4 6:49 – 7:16 Play Video(5) K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 22 Step 6. Transfer "Hello Cloud" file onto the instance • Transfer files from Linux or Mac OS Machine $: scp -i myfirstkey.pem index.html ubuntu@ ec2-54-235-3-170.compute1.amazonaws.com:/root Video: Chapter_4-Video_1.mp4 7:16 -- 8:07 Play Video(6) K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 23 Transfer files from Windows machine, using WinSCP: http://winscp.net/eng/index.php WinSCP login K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 24 Transfer File using WinSCP K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 25 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 Play Video(7) Video: Chapter_4-Video_1.mp4 8:07 – 9:59 K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 26 Step 8. Create an AMI from the running instance Play Video(8) Video: Chapter_4-Video_1.mp4 10:00 – 13:58 K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 27 Deploy “Hello Cloud” onto Azure Click here to view the video demonstrating the steps. K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 28 Step 1. Sign up for Windows Azure Play Video(1) Video: Chapter_4-Video_2.mp4 0:00 – 0:49 K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 29 Step 2. Create a virtual machine Video: Chapter_4-Video_2.mp4 0:49 – 6:28 Play Video(2) Launch Windows Virtual Machine K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 30 Step 3. Authorize Network Access Video: Chapter_4-Video_2.mp4 6:28 – 8:10 a) Add an endpoint; Play Video(3) b) Specify the details of the endpoint K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 31 Step 4. Login to the Virtual Machine Video: Chapter_4-Video_2.mp4 8:10 – 8:47 Play Video(4) Windows Azure Cloud Management interface K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 32 Step 5. Turn on IIS Video: Chapter_4-Video_2.mp4 8:47 – 11:53 Play Video(5) Turn on IIS in the virtual machine K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 33 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. Video: Chapter_4-Video_2.mp4 11:53 – 13:52 Play Video(6-7) K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 34 Step 7. Deploy the application 1) First, create a folder named hellocloud under "C:\inetpub\wwwroot" directory in the virtual machine 2) Then, copy the home page of "Hello Cloud" application to hellocloud folder. K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 35 Step 8. Capture an image of running virtual machine 1) Run sysprep in virtual machine 2) Shut down the virtual machine in Cloud Management Interface 3) Click "Capture" button in the bottom of Cloud Management Interface to capture the image. Video: Chapter_4-Video_2.mp4 13:52 - end Play Video(8) K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 36 Learning Modules 1. Introduction: popular cloud services 2. “Hello Cloud” web application • HTML page • Web application context 3. Deploy the “Hello Cloud” onto Cloud Services • Amazon AWS • Windows Azure 4. Conclusion and discussions K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 37 General Steps to deploy a simple web application K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 38 Discussion Questions 1. 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? 2. What's the differences between shutting down a virtual machine and deleting it on Windows Azure? 3. What are the general steps of deploying a simple web applic ations onto EC2 and Windows Azure? 4. How to authorize network access in EC2 and Azure? 5. What is the role of the "key pair" in EC2? 6. What is "instance image" in cloud? Why is the relationship b etween an instance and an image. K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 39 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]. K. Liu, Q. Huang, J. Xia, Z. Li, P. Lostritto, 2013. Chapter 4 How to use cloud computing?, In Spatial Cloud Computing: a practical approach, edited by C.Yang, Q. Huang, Z. Li, C. Xu, K. Liu, CRC Press: pp. 49-72. 40