SlideShare une entreprise Scribd logo
1  sur  44
Running memcached clusters  on Amazon EC2  In The Brain of Daniel Sikar Skills Matter – London, UK 01.12.2010
Skills Matter supports the Agile and Open Source developer community, by organising free events, training courses, conferences and by publishing thousands of podcasts on ideas and technologies that drive innovation. ,[object Object],Welcome to Skills Matter
Daniel Sikar Consultant Developer Trainer Internet & scientific data acquisition applications Runs Amazon Web Services, Oracle Coherence and Intro to Hadoop courses at Skills Matter [email_address]
 
LCD memcached? High performance memory object caching system Clusters? Group of computers working together AWS? Infrastructure as a Service
Caching
Caching... To name a few: ,[object Object]
CPU cache
Database query cache
Caching... Used to decrease latency.
Clusters
Clusters... Used to increase: ,[object Object]
Reliability
Scalability
Clusters... If a unit falls off, the cluster continues behaving the same way. Units can be added and subtracted as needed.
Clusters... The cluster functions as a whole.
Infrastructure as a Service
AWS ~ IAAS The model: ,[object Object]
On demand
Pay as you go
EC2
Amazon Machine Image (AMI) >  Instance > EC2 Key Concepts I
One AMI can launch one or more instances EC2 Key Concepts II
 
$ wget http://(..)ec2-api-tools.zip # unpack to /usr # config env vars $ env | grep EC2 (...) EC2 tools
EC2 tools $ ls /usr/bin/ec2* $ ls /usr/lib/ec2* $ ec2ver $ ec2dim -a > amis.txt $ cat amis.txt | grep <...>
$ ec2auth -h $ ec2addgrp -h $ ec2dgrp -h EC2 – Security Groups (firewall)
$ ec2addgrp dbgroup -d &quot;db security group&quot; $ ec2addgrp mcgroup -d &quot;mc security group&quot; $ ec2addgrp wbgroup -d &quot;wb security group&quot; EC2 – Security Groups (firewall)
EC2 – Security Groups (firewall)
$ ec2auth dbgroup -o wbgroup -u <account id> $ ec2auth wbgroup -o dbgroup -u <account id> $ ec2auth wbgroup -o mcgroup -u <account id> $ ec2auth mcgroup -o wbgroup -u <account id> EC2 – Security Groups (firewall)
EC2 – Security Groups (firewall)
$ ec2auth dbgroup -p 3306 -s 0.0.0.0/0 $ ec2auth wbgroup -p 80 -s 0.0.0.0/0 $ ec2auth wbgroup -p 22 -s 0.0.0.0/0 $ ec2auth dbgroup -p 22 -s 0.0.0.0/0 $ ec2auth mcgroup -p 22 -s 0.0.0.0/0 $ ec2dgrp dbgroup mcgroup wbgroup EC2 – Security Groups (firewall)
AMI Instance  Running EC2 Instances
Key Pairs
Generating a key pair $  ec2addkey  aws_key > ~/.ssh/aws_key.pem $ chmod 600 ~/.ssh/aws_key.pem
Running EC2 instances $  ec2run  ami-f4340180 -g dbgroup -t t1.micro -z eu-west-1a -k aws_key # plus one web and one memcached server $ ssh -i ~/.ssh/aws_key.pem <user>@<dns>
Configuring a database server $ sudo apt-get install mysql server $ sudo vim /etc/mysql/my.cnf #bind-address = 127.0.0.1 bind-address = 0.0.0.0 # notice caching configuration option $ sudo /etc/init.d/mysql restart $ mysql -u root -p mysql> create user 'dbuser'@'%' identified by <pwd> mysql> grant all privileges on *.* to 'dbuser'@'%'  # add some data
 
Configuring a memcached server $ ssh -i ~/.ssh/aws_key.pem <user>@<dns> $ sudo apt-get update $ sudo apt-get install memcached $ memcached -h | head $ ps aux | grep memcached $ sudo vim /etc/memcached.conf # mods $ sudo /etc/init.d/memcached restart $ ps aux | grep memcached
Memcached clients ,[object Object]
PHP
Java
Python
Ruby

Contenu connexe

Tendances

CHI - YAPC NA 2012
CHI - YAPC NA 2012CHI - YAPC NA 2012
CHI - YAPC NA 2012
jonswar
 
CHI-YAPC-2009
CHI-YAPC-2009CHI-YAPC-2009
CHI-YAPC-2009
jonswar
 
Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)
Cameron Eagans
 
Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013
Simon McCartney
 
Painless ruby deployment on shelly cloud
Painless ruby deployment on shelly cloudPainless ruby deployment on shelly cloud
Painless ruby deployment on shelly cloud
Giedrius Rimkus
 

Tendances (19)

Usecase examples of Packer
Usecase examples of Packer Usecase examples of Packer
Usecase examples of Packer
 
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platform
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platformDrupal camp South Florida 2011 - Introduction to the Aegir hosting platform
Drupal camp South Florida 2011 - Introduction to the Aegir hosting platform
 
CHI - YAPC NA 2012
CHI - YAPC NA 2012CHI - YAPC NA 2012
CHI - YAPC NA 2012
 
CHI-YAPC-2009
CHI-YAPC-2009CHI-YAPC-2009
CHI-YAPC-2009
 
Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)
 
Puppet and the HashiCorp Suite
Puppet and the HashiCorp SuitePuppet and the HashiCorp Suite
Puppet and the HashiCorp Suite
 
Building Windows Images with Packer
Building Windows Images with PackerBuilding Windows Images with Packer
Building Windows Images with Packer
 
Infraestrutura Imutável na AWS usando Packer, Ansible, CloudFormation e Kuber...
Infraestrutura Imutável na AWS usando Packer, Ansible, CloudFormation e Kuber...Infraestrutura Imutável na AWS usando Packer, Ansible, CloudFormation e Kuber...
Infraestrutura Imutável na AWS usando Packer, Ansible, CloudFormation e Kuber...
 
Automating with Ansible
Automating with AnsibleAutomating with Ansible
Automating with Ansible
 
Automating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWSAutomating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWS
 
Using Ansible for Deploying to Cloud Environments
Using Ansible for Deploying to Cloud EnvironmentsUsing Ansible for Deploying to Cloud Environments
Using Ansible for Deploying to Cloud Environments
 
Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013
 
Painless ruby deployment on shelly cloud
Painless ruby deployment on shelly cloudPainless ruby deployment on shelly cloud
Painless ruby deployment on shelly cloud
 
Getting Started with Ansible
Getting Started with AnsibleGetting Started with Ansible
Getting Started with Ansible
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
Ansible basics workshop
Ansible basics workshopAnsible basics workshop
Ansible basics workshop
 
Packer, where DevOps begins
Packer, where DevOps beginsPacker, where DevOps begins
Packer, where DevOps begins
 
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
 
Introducing to node.js
Introducing to node.jsIntroducing to node.js
Introducing to node.js
 

En vedette (6)

Open Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up IntroOpen Source Jumpstart Tooling Up Intro
Open Source Jumpstart Tooling Up Intro
 
Benjamin mitchell agile x
Benjamin mitchell   agile xBenjamin mitchell   agile x
Benjamin mitchell agile x
 
Feature Injection River Glide
Feature Injection River GlideFeature Injection River Glide
Feature Injection River Glide
 
DDD eXchange
DDD eXchangeDDD eXchange
DDD eXchange
 
Notagile2010 leadership
Notagile2010 leadershipNotagile2010 leadership
Notagile2010 leadership
 
Plug 20110217
Plug   20110217Plug   20110217
Plug 20110217
 

Similaire à Itb session v_memcached

Similaire à Itb session v_memcached (20)

Running and Scaling Magento on AWS
Running and Scaling Magento on AWSRunning and Scaling Magento on AWS
Running and Scaling Magento on AWS
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011
 
AutoScaling and Drupal
AutoScaling and DrupalAutoScaling and Drupal
AutoScaling and Drupal
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Reusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modulesReusable, composable, battle-tested Terraform modules
Reusable, composable, battle-tested Terraform modules
 
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...
AWS Study Group - Chapter 03 - Elasticity and Scalability Concepts [Solution ...
 
Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...
Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...
Gianluca Arbezzano Wordpress: gestione delle installazioni e scalabilità con ...
 
The Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with RubyThe Future is Now: Leveraging the Cloud with Ruby
The Future is Now: Leveraging the Cloud with Ruby
 
Virtualization and Cloud Computing with Elastic Server On Demand
Virtualization and Cloud Computing with Elastic Server On DemandVirtualization and Cloud Computing with Elastic Server On Demand
Virtualization and Cloud Computing with Elastic Server On Demand
 
A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)
 
Cloud Talk
Cloud TalkCloud Talk
Cloud Talk
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
 
Wordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionWordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccion
 
How Zalando runs Kubernetes clusters at scale on AWS - AWS re:Invent
How Zalando runs Kubernetes clusters at scale on AWS - AWS re:InventHow Zalando runs Kubernetes clusters at scale on AWS - AWS re:Invent
How Zalando runs Kubernetes clusters at scale on AWS - AWS re:Invent
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardHow I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
 

Plus de Skills Matter

Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheim
Skills Matter
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-dive
Skills Matter
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_t
Skills Matter
 

Plus de Skills Matter (20)

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applications
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheim
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberl
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.js
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source world
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testing
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-dive
 
Serendipity-neo4j
Serendipity-neo4jSerendipity-neo4j
Serendipity-neo4j
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
Lug presentation
Lug presentationLug presentation
Lug presentation
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_t
 
Plug saiku
Plug   saikuPlug   saiku
Plug saiku
 
Huguk lily
Huguk lilyHuguk lily
Huguk lily
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Itb session v_memcached

  • 1. Running memcached clusters on Amazon EC2 In The Brain of Daniel Sikar Skills Matter – London, UK 01.12.2010
  • 2.
  • 3. Daniel Sikar Consultant Developer Trainer Internet & scientific data acquisition applications Runs Amazon Web Services, Oracle Coherence and Intro to Hadoop courses at Skills Matter [email_address]
  • 4.  
  • 5. LCD memcached? High performance memory object caching system Clusters? Group of computers working together AWS? Infrastructure as a Service
  • 7.
  • 10. Caching... Used to decrease latency.
  • 12.
  • 15. Clusters... If a unit falls off, the cluster continues behaving the same way. Units can be added and subtracted as needed.
  • 16. Clusters... The cluster functions as a whole.
  • 18.
  • 21. EC2
  • 22. Amazon Machine Image (AMI) > Instance > EC2 Key Concepts I
  • 23. One AMI can launch one or more instances EC2 Key Concepts II
  • 24.  
  • 25. $ wget http://(..)ec2-api-tools.zip # unpack to /usr # config env vars $ env | grep EC2 (...) EC2 tools
  • 26. EC2 tools $ ls /usr/bin/ec2* $ ls /usr/lib/ec2* $ ec2ver $ ec2dim -a > amis.txt $ cat amis.txt | grep <...>
  • 27. $ ec2auth -h $ ec2addgrp -h $ ec2dgrp -h EC2 – Security Groups (firewall)
  • 28. $ ec2addgrp dbgroup -d &quot;db security group&quot; $ ec2addgrp mcgroup -d &quot;mc security group&quot; $ ec2addgrp wbgroup -d &quot;wb security group&quot; EC2 – Security Groups (firewall)
  • 29. EC2 – Security Groups (firewall)
  • 30. $ ec2auth dbgroup -o wbgroup -u <account id> $ ec2auth wbgroup -o dbgroup -u <account id> $ ec2auth wbgroup -o mcgroup -u <account id> $ ec2auth mcgroup -o wbgroup -u <account id> EC2 – Security Groups (firewall)
  • 31. EC2 – Security Groups (firewall)
  • 32. $ ec2auth dbgroup -p 3306 -s 0.0.0.0/0 $ ec2auth wbgroup -p 80 -s 0.0.0.0/0 $ ec2auth wbgroup -p 22 -s 0.0.0.0/0 $ ec2auth dbgroup -p 22 -s 0.0.0.0/0 $ ec2auth mcgroup -p 22 -s 0.0.0.0/0 $ ec2dgrp dbgroup mcgroup wbgroup EC2 – Security Groups (firewall)
  • 33. AMI Instance Running EC2 Instances
  • 35. Generating a key pair $ ec2addkey aws_key > ~/.ssh/aws_key.pem $ chmod 600 ~/.ssh/aws_key.pem
  • 36. Running EC2 instances $ ec2run ami-f4340180 -g dbgroup -t t1.micro -z eu-west-1a -k aws_key # plus one web and one memcached server $ ssh -i ~/.ssh/aws_key.pem <user>@<dns>
  • 37. Configuring a database server $ sudo apt-get install mysql server $ sudo vim /etc/mysql/my.cnf #bind-address = 127.0.0.1 bind-address = 0.0.0.0 # notice caching configuration option $ sudo /etc/init.d/mysql restart $ mysql -u root -p mysql> create user 'dbuser'@'%' identified by <pwd> mysql> grant all privileges on *.* to 'dbuser'@'%' # add some data
  • 38.  
  • 39. Configuring a memcached server $ ssh -i ~/.ssh/aws_key.pem <user>@<dns> $ sudo apt-get update $ sudo apt-get install memcached $ memcached -h | head $ ps aux | grep memcached $ sudo vim /etc/memcached.conf # mods $ sudo /etc/init.d/memcached restart $ ps aux | grep memcached
  • 40.
  • 41. PHP
  • 42. Java
  • 44. Ruby
  • 45. Perl
  • 46.
  • 49. Lua
  • 50. Lisp
  • 52. OCaml
  • 53. (...)
  • 54. Running a memcache(d) php client $ sudo apt-get install php5-memcached $ sudo apt-get install libmemcached-dev $ sudo apt-get install php5-dev php-pear $ sudo apt-get install php5-mysql $ sudo pecl install memcache $ sudo vim /etc/php5/apache2/php.ini extension=memcache.so $ sudo /etc/init.d/apache2 restart $ wget http://localhost/phpinfo.php $ cat phpinfo.php | grep memcache # copy files
  • 55. What about the memcache cluster?
  • 57. Creating a memcached AMI $ ec2din (...) <volume id> (...) $ ec2addsnap <volume id> (...) <snapshot id> (...) $ ec2dim ami-f4340180 $ ec2reg -s <snapshot id> --kernel <kernel id> -n &quot;name&quot; -d &quot;desc&quot; $ ec2dim <ami id> $ ec2run <ami id> -g mcgroup -t t1.micro -z eu-west-1a -k aws_key -n 2 # add to cluster & test
  • 58. Tidying up $ ec2kill <instance id>
  • 59.
  • 60. Conclusion Setting up and running memcached clusters is easy on IAAS environments such as Amazon EC2
  • 62. Coming up next: Intro to Hadoop 20.12.2010 Amazon Web Services 24.01.2011 Skills Matter – London, UK
  • 63. Thank you for attending! Running memcached clusters on Amazon EC2 In The Brain of Daniel Sikar Skills Matter – London, UK 01.12.2010