-
Notifications
You must be signed in to change notification settings - Fork 277
AppScale on Amazon EC2
AppScale can deploy on Amazon EC2 to provide you with a quick, simple way to run AppScale on a public cloud. Follow the directions below to deploy AppScale on a single node in EC2.
You'll need a machine that has the AppScale Tools installed on it to run AppScale.
In the machine on which the tools are installed, create an AppScale configuration file:
$ appscale init cloud
Modify the AppScalefile in your current working directory and indicate that you want to run on Amazon EC2:
infrastructure: 'ec2'
And specify your AWS credentials in your AppScalefile:
EC2_ACCESS_KEY: 'YYYY'
EC2_SECRET_KEY: 'ZZZZ'
See docs on AWS credentials for more information about how to get these values.
Next, specify that only a single virtual machine should be used:
min: 1
max: 1
Also, indicate that you want to use the public AppScale AMI. You can find the latest AMI in us-east-1 here:
machine: ami-XXXXXXXX
Optionally, use an elastic IP if you require one:
static_ip: 1.2.3.4
Start AppScale by running:
$ appscale up
And you should see output resembling the following:
$ appscale up
Machine image ami-XXXXXXXX does exist
Starting AppScale over the ec2 cloud.
Verifying that keyname appscale-key is not already registered.
Creating key pair: appscale-key
Creating security group: appscale-group
Starting 1 machines with machine id ami-XXXXXXXX, with instance type m1.large, keyname appscale-key, in security group appscale-group
Using on-demand instances
Waiting for your instances to start...
Waiting for your instances to start...
Waiting for your instances to start...
Started 1 on-demand instances in 44 seconds
Please wait for your instance to boot up.
Root login not enabled - enabling it now.
Log in to your head node: ssh -i /Users/you/.appscale/appscale-key.key root@ec2-54-243-5-73.compute-1.amazonaws.com
Head node successfully initialized at ec2-54-243-5-73.compute-1.amazonaws.com. It is now starting up cassandra.
Copying over deployment credentials
Starting AppController at ec2-54-243-5-73.compute-1.amazonaws.com
Please wait for the AppController to finish pre-processing tasks.
Please wait for AppScale to prepare your machines for use.
UserAppServer is at ec2-54-243-5-73.compute-1.amazonaws.com
Enter your desired admin e-mail address: test@example.com
Enter new password:
Confirm password:
Creating new user account test@example.com
Creating new user account test@ec2-54-243-5-73.compute-1.amazonaws.com
Your XMPP username is test@ec2-54-243-5-73.compute-1.amazonaws.com
Granting admin privileges to test@example.com
AppScale successfully started!
View status information about your AppScale deployment at http://ec2-54-243-5-73.compute-1.amazonaws.com:1808/status
If you wish, you can navigate to this URL above to see the status of your AppScale deployment. Alternatively, you can see the status of your AppScale deployment via the tools by running "appscale status", which tells us the following:
$ appscale status
Status of node at ec2-54-243-5-73.compute-1.amazonaws.com:
Currently using 9.5 Percent CPU and 19.68 Percent Memory
Hard disk is 51 Percent full
Is currently: load_balancer, shadow, db_master, zookeeper, login, memcache, taskqueue_master, appengine
Database is at ec2-54-243-5-73.compute-1.amazonaws.com
Is in cloud: cloud1
Current State: Preparing to run AppEngine apps if needed
Hosting the following apps: none
View status information about your AppScale deployment at http://ec2-54-243-5-73.compute-1.amazonaws.com/status
You can deploy Google App Engine applications by running:
$ appscale deploy ~/path-to-your-app
And you should see output resembling the following:
$ appscale deploy ~/sample-apps/python/guestbook
Enter your desired e-mail address: test@example.com
Uploading guestbook
We have reserved guestbook for your app
Creating remote directory to copy app into
Tarring application
Copying over application
Please wait for your app to start serving.
Your app can be reached at the following URL: http://ec2-54-243-5-73.compute-1.amazonaws.com:8080
Navigate on your host machine's browser to this address to interact with your app.
Shut down your apps and AppScale deployment by running:
$ appscale down
If you do not have disks attached then it will warn you of data loss. See Automated Data Persistence on persisting data.
$ appscale down
About to terminate instances spawned with keyname appscale-key
Terminating instances: i-6446e708
Deleting keyname appscale-key
Deleting security group appscale-group
Successfully shut down your AppScale deployment.
If the AMI is not found check your AWS credentials and try again. Verify that you're in the right availability zone. Check the logs on your nodes by using the $ appscale logs
command for further investigation.
If you run into any problems, please send an email to us via the AppScale Community group or join us on #appscale on freenode.