Changes between Version 41 and Version 42 of InstallationGuidelines/Amazon


Ignore:
Timestamp:
11/08/12 02:04:26 (12 years ago)
Author:
Fran Boon
Comment:

Re-order

Legend:

Unmodified
Added
Removed
Modified
  • InstallationGuidelines/Amazon

    v41 v42  
    1717* The normal production 'small' instance can only run 32-bit.
    1818* Larger production instances can only run 64-bit, so can't have the exact same image used.
    19 * The community Debian Squeeze AMI seems a fine base & attached scripts turn this into an Eden instance
    2019
    2120== Instance Persistence ==
     
    2322 * For DB I/O performance increase can stripe multiple EBS
    2423  * monitoring data available to see if this is the issue
    25 * Each time you start an instance up, it will be assigned a new IP ('Public DNS') although this can be overcome using an Elastic IP
    26  * Remember to set up Reverse DNS for your Elastic IP to be able to send emails reliably:
    27   * https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request
     24
     25== AMI ==
     26* The community EBS Debian Squeeze-base i386 AMI can be turned into an Eden instance via the scripts found in [wiki:InstallationGuidelines/Linux/Server/CherokeePostgreSQL Cherokee & PostgreSQL].
     27* Alternately, pre-built "Sahana Eden" AMIs are available in some regions (us-west). These just need to be configured via:
     28{{{
     29./configure-eden-cherokee-postgis.sh
     30
     31}}}
     32
     33== Elastic IP ==
     34Each time you start an instance up, it will be assigned a new IP ('Public DNS') although this can be overcome using an Elastic IP
     35* Remember to set up Reverse DNS for your Elastic IP to be able to send emails reliably:
     36 * https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request
     37
    2838== Authentication ==
    2939=== SSH ===
     
    3545ssh -l root -i private.pem <hostname>
    3646cat ~/.ssh/authorized_keys
     47
    3748}}}
    3849SecureCRT needs the private key storing as <filename> & the public as <filename.pub> (all on one line)
     
    4051SSH will also need to be enabled in your Firewall policy (restrict the IP source, if possible)
    4152
    42 == Using Sahana Eden prebuilt AMIs ==
    43 You will find a prebuilt instance of Sahana Eden in some zones [Currently: us-west], that can help you in quickly setting up an instance.
    44 
    45 These are built using [wiki:InstallationGuidelines/Linux/Server/CherokeePostgreSQL Cherokee & PostgreSQL].
    46 
    47 * Search for "Sahana Eden" in the AMI's section.
    48 * Launch the instance.
    49 * SSH into the instance by following the steps mentioned in the section above.
    50 * run configure-eden-cherokee-postgis.sh to configure the instance.
    51 {{{
    52 
    53 ./configure-eden-cherokee-postgis.sh
    54 
    55 }}}
    56 
    57 * The disk space on the pre-built AMIs is 1GB - Instructions to grow the disk are given below.
    58 * You can add swap from a swap file :
    59 {{{
    60 
    61 dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
    62 
    63 mkswap /swapfile1
    64 chown root:root /swapfile1
    65 chmod 0600 /swapfile1
    66 swapon /swapfile1
    67 }}}
    68 
    69 Make this persistent across reboots by adding the following to your /etc/fstab
    70 {{{
    71 /swapfile1 swap swap defaults 0 0
    72 }}}
    73 == Building AMIs for easier deployment ==
    74 If your region doesn't yet have a Sahana AMI in, then it is easy to create one which allows easier deployment of future instances for both you & others. The only cost to you is a small amount of time to publish it & then using up your 1Gb Snapshot allowance within the free tier.
    75 
    76 * Choose a debian AMI in your desired ZONE with 1 GB of EBS storage [This enables AMI registration in AWS free tier.]
    77 * Launch the instance.
    78 * Copy the installation and configuration scripts -> [http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Linux/Server/CherokeePostgreSQL/install-eden-cherokee-postgis.sh install-eden-cherokee-postgis.sh] and [http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Linux/Server/CherokeePostgreSQL/configure-eden-cherokee-postgis.sh configure-eden-cherokee-postgis.sh] into the launched instance.
    79 {{{
    80 wget http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Linux/Server/CherokeePostgreSQL/install-eden-cherokee-postgis.sh
    81 chmod a+x install-eden-cherokee-postgis.sh
    82 wget http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Linux/Server/CherokeePostgreSQL/configure-eden-cherokee-postgis.sh
    83 chmod a+x configure-eden-cherokee-postgis.sh
    84 }}}
    85 
    86 * Run the install-eden-cherokee-postgis.sh script and delete it. [Note: This step takes about 10min - grab a coffee]
    87 {{{
    88 ./install-eden-cherokee-postgis.sh
    89 rm install-eden-cherokee-postgis.sh
    90 }}}
    91 
    92 * Shutdown the EBS instance.
    93 {{{
    94    shutdown -h now
    95 }}}
    96 
    97 * Go to your aws console for the current region at [https://console.aws.amazon.com/ec2/home | EC2 Console]
    98 
    99 * Select the debian instance you just prepared in the "Instances"
    100 
    101 * Select " Create Image (EBS AMI) " in the "Instance Actions" drop down.
    102 
    103 
    104 [[Image(http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Amazon/create-image.png, 75%)]]
    105 
    106 * Choose a Image name - Lets say - "Sahana Eden" and fill in a description.
    107 
    108 
    109 [[Image(http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Amazon/create-image-config.png, 75%)]]
    110 
    111 
    112 * Click "Create this Image"
    113 
    114 * Go to the "AMIS" menu and select "Owned by me" and "All Platforms" in the Viewing dropdown.
    115 
    116 [[Image(http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Amazon/ami-built.png, 75%)]]
    117 
    118 * Wait for about 5 minutes and hit refresh for the AMI you just built to appear.
    119 
    120 * Select the AMI and click the Permissions button - Select public, to make the image public.
    121 
    122 
    123 [[Image(http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Amazon/ami-permissions.png, 75%)]]
    124 
    125 === CLI ===
     53== Grow the Diskspace ==
     54The disk space on the initial image is just 1GB. This should be grown to 3Gb (don't just size the volume to 3Gb to start with as the image only uses 1Gb of it!)
     55* this is still within the 10Gb free tier.
     56
     57You can do this using the AWS EC2 Console or else you can do it via the CLI
     58
     59=== CLI Tools ===
    12660To use any of the AWS CLI tools on your own machine to remotely manage instances, then you need to generate a unique X.509 Certificate per account.
    12761This can be done from the 'Security Credentials' page within your account.
    128 == CLI Management ==
     62
     63==== CLI Management ====
    12964There are extensive CLI tools available to manipulate your instances.
    13065* Java CLI for !Windows/Linux
     
    13469* Python: http://libcloud.apache.org
    13570
    136 == Growing Storage ==
    137 1Gb EBS is too small for Eden - need to grow to 3Gb, which is still within the 10Gb free tier
     71=== CLI Script ===
     72Edit the settings as-indicated as you proceed through the script
    13873{{{
    13974# Settings for Instance
     
    208143rm -rf /var/log/vmlinuz
    209144rm -rf /var/log_old
    210 }}}
     145
     146}}}
     147
     148== Add Swapfile ==
     149* You can add swap from a swap file :
     150{{{
     151dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
     152mkswap /swapfile1
     153chown root:root /swapfile1
     154chmod 0600 /swapfile1
     155swapon /swapfile1
     156
     157}}}
     158
     159Make this persistent across reboots by adding the following to your /etc/fstab
     160{{{
     161/swapfile1 swap swap defaults 0 0
     162
     163}}}
     164
     165== Install ==
     166* Copy the installation and configuration scripts -> [http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Linux/Server/CherokeePostgreSQL/install-eden-cherokee-postgis.sh install-eden-cherokee-postgis.sh] and [http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Linux/Server/CherokeePostgreSQL/configure-eden-cherokee-postgis.sh configure-eden-cherokee-postgis.sh] into the launched instance.
     167{{{
     168wget http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Linux/Server/CherokeePostgreSQL/install-eden-cherokee-postgis.sh
     169chmod a+x install-eden-cherokee-postgis.sh
     170wget http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Linux/Server/CherokeePostgreSQL/configure-eden-cherokee-postgis.sh
     171chmod a+x configure-eden-cherokee-postgis.sh
     172}}}
     173
     174* Run the install-eden-cherokee-postgis.sh script and delete it. [Note: This step takes about 10min - grab a coffee]
     175{{{
     176./install-eden-cherokee-postgis.sh
     177rm install-eden-cherokee-postgis.sh
     178}}}
     179
     180== Configure ==
     181Run configure-eden-cherokee-postgis.sh to configure the instance:
     182{{{
     183./configure-eden-cherokee-postgis.sh
     184
     185}}}
     186
     187== Building AMIs for easier deployment ==
     188If your region doesn't yet have a Sahana AMI in, then it is easy to create one which allows easier deployment of future instances for both you & others. The only cost to you is a small amount of time to publish it & then using up your 1Gb Snapshot allowance within the free tier.
     189
     190* Install the instance as-above
     191* Don't run the configure script
     192* Shutdown the EBS instance.
     193{{{
     194shutdown -h now
     195
     196}}}
     197
     198* Go to your aws console for the current region at [https://console.aws.amazon.com/ec2/home | EC2 Console]
     199
     200* Select the debian instance you just prepared in the "Instances"
     201
     202* Select " Create Image (EBS AMI) " in the "Instance Actions" drop down.
     203
     204[[Image(http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Amazon/create-image.png, 75%)]]
     205
     206* Choose an Image name - Lets say - "Sahana Eden" and fill in a description.
     207
     208[[Image(http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Amazon/create-image-config.png, 75%)]]
     209
     210* Click "Create this Image"
     211
     212* Go to the "AMIS" menu and select "Owned by me" and "All Platforms" in the Viewing dropdown.
     213
     214[[Image(http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Amazon/ami-built.png, 75%)]]
     215
     216* Wait for about 5 minutes and hit refresh for the AMI you just built to appear.
     217
     218* Select the AMI and click the Permissions button - Select public, to make the image public.
     219
     220[[Image(http://eden.sahanafoundation.org/raw-attachment/wiki/InstallationGuidelines/Amazon/ami-permissions.png, 75%)]]
    211221
    212222Keep Templates as EBS Volumes as this is cheaper than Snapshots