Question
How can I automatically install the CRX repository on an Amazon EC2 instance. Amazon provides an infrastructure-as-a-service platform - called EC2 - that can be used to host CRX repositories. This document the necessary steps to setup and run CRX on EC2.
Pre-requirements:
- System administration skills with Linux
- for Windows users - know how to connect to Linux via SSH
Answer
This is a step-by-step guide.
Step 1
- Sign-up for Amazon EC2 on: http://aws.amazon.com/ec2/
- Get familiar with the service: tasks such as start and stop instances, get access with SSH
Tutorial for Mac users: Starting Amazon EC2 with Mac OS X (on reactive.io)
Tutorial for Windows users: Managing Amazon EC2 with Windows (on keywordintellect.com)
Step 2
- Create a Security Group that has Port 22 and 7402 open.
- Start an EC2 instance. We recommend Linux CentOS AIMs - for example:
- ami-4a24d623 (411009282317/RightImage_CentOS_5.4_x64_v5.6.28_EBS) for 64bit
- ami-5624d63f (411009282317/RightImage_CentOS_5.4_i386_v5.6.28_EBS) for 32bit
- Download the shell script aws-deploy-crx220-public.sh at the bottom of this page. This script executed from your local machine against the EC2 instance installs Java, sets the permissions, installs CRX and starts it.
- Open the downloaded script in an editor and add your license key under LICENSE_KEY. If you don't have a license yet - get a Developer license here. Set if you install on a 32bit or 64bit EC2 instance and feel free to change the port number.
- Run the following command in the local terminal/command line. Replace the location of the ssh key and the hostname of the EC2 instance.
- on Linux/Mac:
cat aws-deploy-crx220-linux-public.sh | ssh -i ~/.ssh/ec2-keypair root@ec2- .compute-1.amazonaws.com
- on Windows (Cygwin users): use the same command as on Linux/Mac
- on Windows (PuTTY users): use
plink root@ec2- .compute-1.amazonaws.com aws-deploy-crx220-linux-public.sh
- on Linux/Mac:
- Wait until the script is finish. Then use the browser and browse to EC2 instance hostname on port 7402.
The script does following:
- installes Java 6 SDK
- CRX is installed in
/mnt/crx/crx-quickstart/..
- creates an user
crx
to run the java process
Step 3
To start/stop CRX, go into the directory /mnt/crx/crx-quickstart/server
- start server:
su -s /bin/bash crx ./start
- stop server:
./stop
To backup CRX, use the method documented on Online Backup. Note that the script installs the repository on a volatile disk.
Applies
CRX 2.2.0
下载