1 / 75

Reaching for the sky with Asterisk and Amazon EC2

Cloud computing class. Reaching for the sky with Asterisk and Amazon EC2. Administrative. This is an advanced class Pre-requirements for this class are: Basic knowledge of Asterisk ( dCAP preferred) SysAdmin level Linux skills (RHCE, LPIC, equivalent)

marston
Download Presentation

Reaching for the sky with Asterisk and Amazon EC2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cloud computing class Reaching for the sky with Asterisk and Amazon EC2

  2. Administrative This is an advanced class Pre-requirements for this class are: Basic knowledge of Asterisk (dCAP preferred) SysAdmin level Linux skills (RHCE, LPIC, equivalent) Your own notebook computer (not a must) Willingness to think differently about IT and economics A good sense of humor…

  3. About your instructor Name: Nir Simionovich Job Title: Who needs titles anyway… Asterisk Experience: 7 years Amazon EC2 Experience: 18 months Largest EC2 Installation: 3500 concurrent channels Publications: AsteriskNOW – Published 2008, Packt Publishing Asterisk AGI – Published 2009, Packt Publishing

  4. Class Policies Questions: Just raise your hand, don’t wait… Private Questions: Wait for the end of the module… Specific Implementation: Catch me in the eveninig Just have fun …

  5. Cloud computing class Module 1 An introduction to Amazon EC2

  6. What it Amazon EC2 Per Amazon’s website: “Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers.” Without the buzz words: “Amazon Elastic Compute Cloud (Amazon EC2) is a virtualization environment, allowing you to initialize virtual servers, without the regular BS related to hosting companies.”

  7. Amazon EC2 is not ! Amazon EC2 is not to be mistaken with: Co-Located servers hosting Dedicated servers hosting Web V-Hosting EC2 provides virtual servers, similar to VPS hosting EC2 doesn’t provide common control panels EC2 doesn’t provide customized network setup

  8. EC2 Service Components The EC2 service is built of 3 distinct components: The Amazon Machine Image (AMI) – A raw image of your virtualized host Amazon S3 – A storage service where you can store your AMI hosts for future usage Amazon AWS Admin – An administration service, available as a web service, a web panel or a Firefox plug-in (ElasticFox). Other Amazon AWS services can be leveraged, such as: CloudFront, SQS, SimpleDB and others

  9. Step 1: Registration We won’t explore the entire registration wizard Pay Attention tothis radio button Registration is performed via the aws.amazon.com website:

  10. Step 2: Pricing and CC info EC2 uses your credit card information in order to perform billing Pay attention to the pricing information provided during the registration wizard – it’s very important For now, just fill in your credit card information and let’s continue…

  11. Step 3: X.509 Certificate and Keys Once registration is complete, an email will be sent to you for final confirmation EC2 requires the installation of X.509 certificate You can supply your own or create a new one using the EC2 service To create a new certificate, simply log-on to your account and create the certificate from their You will also be required to create your Access Key IDs for the service

  12. Step 3: X.509 Certificate and Keys Once your X.509 keys had been created, download these and store in a safe place on your computer Your certificate is used for accessing your servers via SSH – without the usage of a root password Your Access ID’s are used to allow access from your ElasticFox plug-in and web management to your account

  13. Step 3: X.509 Certificate and Keys

  14. Step 4: Logon to the console http://aws.amazon.com/console/

  15. Step 5: Create a Key-Pair Your key pairs are later on used for SSH access

  16. Step 6: Create a Security Group Remember:All Amazon EC2 instancesare NATTED!

  17. Step 7: Install ElasticFox ElasticFox is the official production level management console for Amazon EC2 We now switch to using ElasticFox, as it provides greater flexibility than the web console ElasticFox can be found under the “Developer Tools” section of the AWS website Once ElasticFox is installed, you need to create your online credentials for it – using the keys presented at step 3

  18. Step 7: Install ElasticFox

  19. Step 7: Launch an Asterisk AMI

  20. Step 8: Create an SSH private key Save your private keyfile, to be used with PuTTy

  21. Step 9: Connect to your instance Click this button You will be asked for your generated private key file, so just select it If all goes well, an SSH client to your instance should be made available to you

  22. Module Recap You should now be able to: Initiate new EC2 instances Logon as ‘root’ to your initiated instances You should now be able to create your own EC2 based Asterisk server

  23. Module 1: Recap Lab Lab Duration: 30 minutes Tasks: Register with Amazon AWS services Create your keys and certificate Activate an Asterisk AMI instance Logon to your Asterisk server via SSH

  24. Cloud computing class Module 2 Amazonomics – The Economics Behind usingAmazon EC2

  25. What are Amazonomics Confused? Can be at start… Hang in there… Amazonomics is the combination between the words “Amazon” and “Economics” The term dictates that due to Amazon AWS services, a new economy math is required Traditional “IT Economy” is based upon monthly and yearly calculations, Amazonomics calculations are based upon hours While traditional math calculate costs top-down, Amazonomics calculate costs bottom-up

  26. Basic Terms – On Demand Instances An On-Demand Instance An On-Demand instance can be described as a virtualized host – in it’s most basic form, that once shut down disappears On-Demand Instances are billed in accordance to their size, time utilized and operating system Instances vary from single virtual core units, up to 20 virtual cores per instance

  27. Basic Terms – Reserved Instances A Reserved Instance Similar to an On-Demand instance in functionality Paid in advance for the entire year (or 3 years) Provides better utilization for your funds (cost wise) Once purchased, will remain in your inventory as “reserved” computation power

  28. Basic Terms – Data Transfer Data Transfer costs Amazon instances consume “inbound” and “outbound” bandwidth Amazon calculates the cost of this bandwidth on each of the streams Inbound stream is flat-rated at a per GB cost Outbound stream is step charged at per GB cost, with TB steps

  29. Basic Terms – Elastic IPs Elastic IP Addresses By default – all instances carry a dynamic IP address Elastic IP addresses allows for the assignment of static IP address to your instances All instances are NATted, thus, Elastic IP addresses are statically NATted to your EC2 instances

  30. Amazon EC2 – Power ala-cart You pay for what you use! • If you want reserved power or resources, you pay for that as-well • When you are done consuming resources, simply discard them and don’t pay additional charges The basic concept behind EC2 economics is:

  31. Amazon EC2 – Power ala-cart (cont.) Theoretical example: Imagine that we would like to “crack” an SSH2, IDEA based, 1024 bit key In theory, in order to “crack” the key, we’ll either need a few thousand years or a few thousand computers Installing and managing a few thousand computers is not feasible, nor is waiting a few thousand years Using EC2 instances, we can initiate thousands of hosts at the same time, do the job, then discard them Think of it as an on-demand SETI group that is made available to you

  32. A CFOs view of Amazon EC2 Power Purchasing the above hardware can easily cost around 12,000$ in the first fiscal year Hosting your development system with Amazon EC2 simply makes sense Just turn off your hosts at night, and save the money

  33. Production on EC2? High-Powered, Short burstapplications, such as dialerslove EC2! Depending on your application, going production on EC2 isn’t always economical – especially if your application requires full power 24x7 The best track to take is to de-couple your application layer and initiate instant power on EC2 at peak time Get the best of both worlds – instant power with 24x7 co-location costs

  34. Module Recap Amazonomics change the way we look at costs, relating to IT infrastructure Companies at their start-up stage can easily utilize Amazon EC2 instances to lower their initial OPEX, turning it into CAPEX The price of development hardware purchase can easily translate to 3 years worth of EC2 instances – letting you focus on your product and development

  35. Module 2: Recap Lab Lab Duration: 30 minutes Tasks (Theoretical Exercise only): Design a high-powered Asterisk based dialer platform, utilizing Amazon EC2 components only – based upon economic considerations only Design constraints are: Dialer must be able to sustain a total of 1000 concurrent channels Each EC2 instance can carry up to 120 concurrent channels (medium instance) Control over the Dialer must be centralized

  36. Cloud computing class Module 3 Network Considerations, Elastic IP addressesand de-coupled architecture

  37. Network Considerations In other words: A shift in platform designand development paradigmsis required to utilize EC2 Amazon EC2 is a fully NATted network The EC2 cloud environment is fully NATted, which means that all hosts utilize a private IP address space NATted environments pose an interesting issue what utilized with VoIP in general – and SIP in particular Amazon EC2 is geographically de-coupled When an instance is initiated, the physical location of that instance on the network is somewhat unknown Relying on the network layer for real time data traversal (block connections, database DSN’s, etc) is no longer available

  38. EC2 Network – A Bird’s Eye View Amazon operates 2 AWS global datacenters: US East – USA East Coast EU West – Western Europe While the information seems redundant to most developers, VoIP usage requires a bit more finesse Imagine that you are located in the UK, it would make more sense for you to host your Asterisk servers at EU-West and not US-East When initiating instances, make sure these are initiated in the most suitable location

  39. EC2 Network – VoIP Considerations Remember: If using SIP, media will passthrough your Asterisk AMI – on EC2 that means trafficpayment! Not all VoIP carriers are capable of servicing NATted hosts Make sure you test your carriers with a simple Asterisk instance on EC2, prior to migrating your system to it While SIP doesn’t really like NAT, IAX2 loves it – USE IT!

  40. EC2 Network - Datacenters Even these are spread acrossa few other data centers – inother words, no commitmentfor same location proximity Amazon operates 2 AWS global datacenters: US East – USA East Coast EU West – Western Europe While the information seems redundant to most developers, VoIP usage requires a bit more finesse Imagine that you are located in the UK, it would make more sense for you to host your Asterisk servers at EU-West and not US-East When initiating instances, make sure these are initiated in the most suitable location

  41. EC2 Network – Elastic IP Addresses Elastic IP addresses are statically mapped IP addresses that can be assigned to your instances, once initiated You can assign your Elastic IP either from the management console, or via the AWS EC2 API In any case, your internal host’s IP address always changes – if you turn your instance OFF This can pose an interesting configuration issue when utilizing Asterisk and SIP (externipand externhost)

  42. Cloud computing class De-coupled N-Tier Architecture

  43. Traditional Asterisk Implementation

  44. Traditional Asterisk Implementation The main issues with Asterisk N-Tier architecture are these: The system has a distinct bottle neck with the database. Storage resources are consumed across the entire network A direct connection from the Asterisk application to the database servers is required, while utilizing normal database practices

  45. Traditional Asterisk Implementation The N-Tier approach doesn’t cut it with Cloud Computing structures: No direct connection between the Asterisk servers and the database servers No direct connection between the storage servers and the Asterisk/Database servers No commitment to the geographical location of each server

  46. Hmmmm….. Now What????

  47. New Paradigm Guidelines It is clear we need a new methodology for developing application, one that takes into account the following: We can’t rely on proximity between the database and the Asterisk servers We can’t rely on proximity between the storage and the Asterisk servers We can’t rely on high-powered servers

  48. De-Coupled N-Tier Architecture

  49. EC2 Asterisk Implementation Guidelines: Each Asterisk server holds its own application logic, implemented via normal Asterisk development practices Retrieval of information from the database servers is performed via XML-RPC methods, carried over an HTTPS secured transport Storage of audio and content is managed via a Storage Manager and distributor A web based application Logic implements the XML-RPC server side for the platform

  50. Module Recap We now understand that while EC2 provides a highly cost effective solution, its constraints introduce new development and deployment issues Traditional N-Tier design architectures and paradigms no longer cut-it with EC2 We need to practice a new methodology of designing platform, one that no longer relies on physical attributes and takes into account non-linear approaches

More Related