AppScale on Eucalyptus - lmandres/appscale-raspberry-pi GitHub Wiki

Deploying AppScale on Eucalyptus

AppScale can deploy on Eucalyptus to provide you with a quick, simple way to run AppScale on a private cloud. Follow the directions below to deploy AppScale on a single node in Eucalyptus.

Step 1: Upload an AppScale image to Eucalyptus

Download AppScale 1.14.0. It should contain the following:

  • "appscale1.14.0/appscale_image-1.14.0-uuid.img": The AppScale disk image.
  • "appscale1.14.0/vmlinuz-2.6.32-45-server": The kernel image for Linux 2.6.32-45
  • "appscale1.14.0/initrd.img-2.6.32-45-server": The ramdisk image for Linux 2.6.32-45

Since you will only need to upload the image to Eucalyptus a single time (and won't need it afterwards), we place it in ~/Desktop for now and rename the image for convenience:

$ mv appscale1.14.0 ~/Desktop/
$ mv ~/Desktop/appscale1.14.0/appscale_image-1.14.0-<uuid>.img ~/Desktop/appscale1.14.0/root.img

Adding the AppScale image into Eucalyptus is no different than adding any other image, so our directions for doing so will closely mirror those on the Eucalyptus page. Begin by sourcing the "eucarc" file that came with your Eucalyptus admin credentials (if you don't have them, fetch them from "https://your.cloud.server:8443/").

$ sudo -s # if you are not root already
# source /root/.euca/eucarc
# cd ~/Desktop

Note that you should perform the process that follows only once. If for some reason you need to repeat it, make sure and remove all images from Eucalyptus, and use NEW bucket names for each of the kernel, initrd, and disk image below. Instructions on removing images from Eucalyptus can be found here.

Also, Eucalyptus will unload the image you give it to /tmp by default. Therefore, if you have /tmp on a separate partition and it is smaller than the size of your AppScale image (here, about 10GB), it will fill up /tmp and cause Eucalyptus not to function correctly. To get around this, you can use the -d flag when you run bundle-image and specify a different directory that has enough free space to contain the image.

Upload the kernel image to Eucalyptus (specify "arch" to be "x86_64" and respond with "y" to any "Are you sure" questions):

$ euca-bundle-image -i appscale1.14.0/vmlinuz-2.6.32-45-server --kernel true
$ euca-upload-bundle -b AS-kernel-x86_64.kern-bucket -m /tmp/vmlinuz-2.6.32-45-server.manifest.xml
$ euca-register AS-kernel-x86_64.kern-bucket/vmlinuz-2.6.32-45-server.manifest.xml

If your register command returns with a timeout error, the register still continues. You need to deregister the id (use euca-describe-images to obtain this value), before re-running euca-register again. If you continue to get timeout messages, remove your images from Eucalyptus, and restart Eucalyptus on your head node. If problems persist, contact the Eucalyptus team for support.

Note the return value from the register which is your kernel image id:

$ euca-register AS-kernel-x86_64.kern-bucket/vmlinuz-2.6.32-45-server.manifest.xml
IMAGE   eki-C98517F6

Remember this kernel image id for later use (here it is "eki-C98517F6"). Next, upload your ramdisk image into Eucalyptus:

$ euca-bundle-image -i appscale1.14.0/initrd.img-2.6.32-45-server --ramdisk true
$ euca-upload-bundle -b AS-initrd-x86_64.kern-bucket -m /tmp/initrd.img-2.6.32-45-server.manifest.xml
$ euca-register AS-initrd-x86_64.kern-bucket/initrd.img-2.6.32-45-server.manifest.xml

Your output should look similar to what you saw when adding in the kernel image, and again we are primarily concerned with the ramdisk image id. Our output on the register command yielded us a ramdisk image eri-16D118E2:

$ euca-register AS-initrd-x86_64.kern-bucket/initrd.img-2.6.32-45-server.manifest.xml
IMAGE   eri-16D118E2

If you forget your "eki" and "eri" values, use "euca-describe-images" to obtain them.

Finally, upload the disk image into Eucalyptus and note the disk image id you get back. This step takes significantly longer than the previous steps since the size of the disk image is substantially larger than the kernel and ramdisk images. Use this command to do so:

$ euca-bundle-image -i appscale1.14.0/root.img --kernel eki-C98517F6 --ramdisk eri-16D118E2
$ euca-upload-bundle -b AS.img-bucket -m /tmp/root.img.manifest.xml
$ euca-register AS.img-bucket/root.img.manifest.xml

Note the disk image id for later use. Below is our sample output, yielding a disk image id emi-CEDD1083:

$ euca-register AS.img-bucket/root.img.manifest.xml
IMAGE   emi-CEDD1083

Note that if you have any problems with this section, you should make sure to check the Eucalyptus site to ensure your Euca setup was done properly. After completing these steps, you should now have your image in Eucalyptus and the AppScale machine image ("emi-CEDD1083" above).

Step 2: Install the AppScale Tools

You'll need a machine that has the AppScale Tools installed on it to run AppScale. You can either install it on your own machine or use "euca-run-instances emi-CEDD1083" to run a single virtual machine that has the AppScale Tools pre-installed on it. If you use a machine in Eucalyptus, don't forget to power it off when you're done using it!

Step 3: Configure and start AppScale

Begin by creating an AppScale configuration file:

$ appscale init cloud

Modify the AppScalefile in your current working directory and indicate that you want to run on Eucalyptus:

infrastructure: 'euca'

And specify your Eucalyptus credentials in your AppScalefile:

EC2_ACCESS_KEY: 'YYYY'
EC2_SECRET_KEY: 'ZZZZ'
EC2_URL: 'http://1.2.3.4:8773/services/Eucalyptus'

Change the availability zone value to your availability zone name (you can get the name of your availability zone from the second column of the output from the euca-describe-availability-zones command). Change this line: zone : 'us-east-1b' # For Amazon EC2 in the AppScalefile to

zone : 'your-zone-name' # For Amazon EC2

Next, specify that only a single virtual machine should be used:

min: 1
max: 1

Also, indicate that you want to use the EMI of the image you uploaded in Step 2:

machine: emi-CEDD1083

Start AppScale

Start AppScale by running:

$ appscale up

And you should see output resembling the following:

About to start AppScale 1.14.0 over a cloud environment with the euca tools with instance type m1.xlarge.
New secret key is ****************************9jxn
Creating security group appscalegroup
GROUP	appscalegroup	appscalegroup
Security group appscalegroup in place
GROUP	appscalegroup
PERMISSION	appscalegroup	ALLOWS	udp	1	65535	FROM	CIDR	0.0.0.0/0
GROUP	appscalegroup
PERMISSION	appscalegroup	ALLOWS	tcp	1	65535	FROM	CIDR	0.0.0.0/0
GROUP	appscalegroup
PERMISSION	appscalegroup	ALLOWS	icmp	-1	-1	FROM	CIDR	0.0.0.0/0
Ports set for security group appscalegroup
Reported Public IPs: []
Reported Private IPs: []
euca-run-instances -k samplekey -n 1 --instance-type m1.xlarge --group appscalegroup emi-70413AA0
run_instances: [RESERVATION	r-18BC3ECA	987481471386	appscalegroup
INSTANCE	i-523940AF	emi-70413AA0	0.0.0.0	0.0.0.0	pending	samplekey	0		m1.xlarge	2013-01-20T06:13:46.872Z	cluster1	eki-95B53CB6	eri-2F4C3F9B
]
Run instances message sent successfully. Waiting for the image to start up.
[Sat Jan 19 22:13:43 -0800 2013] 2699.999994 seconds left until timeout...
RESERVATION	r-18BC3ECA	987481471386	appscalegroup
INSTANCE	i-523940AF	emi-70413AA0	0.0.0.0	0.0.0.0	pending	samplekey	0		m1.xlarge	2013-01-20T06:13:46.872Z	cluster1	eki-95B53CB6	eri-2F4C3F9B
Reported Public IPs: []
Reported Private IPs: []
[Sat Jan 19 22:14:04 -0800 2013] 2678.77971 seconds left until timeout...
RESERVATION	r-18BC3ECA	987481471386	appscalegroup
INSTANCE	i-523940AF	emi-70413AA0	129.111.179.144	10.40.5.230	pending	samplekey	0		m1.xlarge	2013-01-20T06:13:46.872Z	cluster1	eki-95B53CB6	eri-2F4C3F9B
Reported Public IPs: []
Reported Private IPs: []
[Sat Jan 19 22:14:25 -0800 2013] 2657.579715 seconds left until timeout...
RESERVATION	r-18BC3ECA	987481471386	appscalegroup
INSTANCE	i-523940AF	emi-70413AA0	129.111.179.144	10.40.5.230	running	samplekey	0		m1.xlarge	2013-01-20T06:13:46.872Z	cluster1	eki-95B53CB6	eri-2F4C3F9B
Reported Public IPs: [129.111.179.144]
Reported Private IPs: [10.40.5.230]
Please wait for your instance to complete the bootup process.
Log in to your head node: ssh -i /root/.appscale/samplekey.key [email protected]
Copying over local copy of AppScale from ~/appscale
{"autoscale"=>"true", "ec2_access_key"=>"*****************K2GU", "CLOUD_S3_URL"=>"http://129.111.179.130:8773/services/Walrus", "CLOUD_EC2_CERT"=>"/root/creds/euca2-admin-617213f9-cert.pem", "appengine"=>"1", "ec2_url"=>"http://129.111.179.130:8773/services/Eucalyptus", "keypath"=>"samplekey.key", "ips"=>"node-7--appengine:memcache:database:rabbitmq:db_slave:rabbitmq_slave..node-6--appengine:memcache:database:rabbitmq:db_slave:rabbitmq_slave..node-5--appengine:memcache:database:rabbitmq:db_slave:rabbitmq_slave..node-4--appengine:memcache:database:rabbitmq:db_slave:rabbitmq_slave..node-3--appengine:memcache:database:rabbitmq:db_slave:rabbitmq_slave..node-2--appengine:memcache:database:rabbitmq:db_slave:rabbitmq_slave..node-1--appengine:memcache:database:rabbitmq:db_slave:rabbitmq_slave", "CLOUD_EC2_ACCESS_KEY"=>"*****************K2GU", "instance_type"=>"m1.xlarge", "replication"=>"3", "CLOUD_EC2_URL"=>"http://129.111.179.130:8773/services/Eucalyptus", "min_images"=>"8", "infrastructure"=>"euca", "CLOUD_EC2_PRIVATE_KEY"=>"/root/creds/euca2-admin-617213f9-pk.pem", "keyname"=>"samplekey", "table"=>"cassandra", "hostname"=>"129.111.179.144", "group"=>"appscalegroup", "ec2_secret_key"=>"************************************Y97a", "CLOUD_EC2_SECRET_KEY"=>"************************************Y97a", "max_images"=>"8", "machine"=>"emi-70413AA0"}
Head node successfully created at 129.111.179.144. It is now starting up cassandra via the command line arguments given.
Generating certificate and private key
Copying over credentials for cloud
Starting server at 129.111.179.144
Please wait for the controller to finish pre-processing tasks.

Please wait for AppScale to prepare your machines for use.
Spawning up 7 virtual machines
Copying over needed files and starting the AppController on the other VMs
Setting up database configuration files
Starting up SOAP Server and PBServer
Run instances: UserAppServer is at 129.111.179.144

Your user account has been created successfully.

Your user account has been created successfully.
Your XMPP username is [email protected]
Please wait for AppScale to finish starting up.
No app uploaded. Use appscale-upload-app to upload an app later.
The status of your AppScale instance is at the following URL: http://129.111.179.144:1080/status

If you wish, you can navigate to this URL above to see the status of your AppScale deployment.

AppScale status

You can query the status of your AppScale deployment via the command-line interface, by running "appscale status":

Status of node at 129.111.179.144:
    Currently using 12.1 Percent CPU and 14.33 Percent Memory
    Hard disk is 25 Percent full
    Is currently: load_balancer, shadow, db_master, zookeeper, login, memcache, rabbitmq_master
    Database is at 129.111.179.144
    Is in cloud: cloud1
    Current State: Preparing to run AppEngine apps if needed
Status of node at 129.111.179.151:
    Currently using 4.4 Percent CPU and 11.38 Percent Memory
    Hard disk is 25 Percent full
    Is currently: db_slave, memcache, rabbitmq_slave, appengine
    Database is at 129.111.179.151
    Is in cloud: cloud1
    Current State: Preparing to run AppEngine apps if needed
    Hosting the following apps: guestbook
    The number of AppServers for app guestbook is: 1
Status of node at 129.111.179.147:
    Currently using 4.4 Percent CPU and 11.09 Percent Memory
    Hard disk is 25 Percent full
    Is currently: db_slave, memcache, rabbitmq_slave, appengine
    Database is at 129.111.179.147
    Is in cloud: cloud1
    Current State: Preparing to run AppEngine apps if needed
    Hosting the following apps: guestbook
    The number of AppServers for app guestbook is: 1
Status of node at 129.111.179.149:
    Currently using 4.7 Percent CPU and 12.22 Percent Memory
    Hard disk is 23 Percent full
    Is currently: db_slave, memcache, rabbitmq_slave, appengine
    Database is at 129.111.179.149
    Is in cloud: cloud1
    Current State: Preparing to run AppEngine apps if needed
    Hosting the following apps: guestbook
    The number of AppServers for app guestbook is: 1
Status of node at 129.111.179.146:
    Currently using 4.7 Percent CPU and 11.81 Percent Memory
    Hard disk is 25 Percent full
    Is currently: db_slave, memcache, rabbitmq_slave, appengine
    Database is at 129.111.179.146
    Is in cloud: cloud1
    Current State: Preparing to run AppEngine apps if needed
    Hosting the following apps: guestbook
    The number of AppServers for app guestbook is: 1
Status of node at 129.111.179.145:
    Currently using 4.6 Percent CPU and 11.13 Percent Memory
    Hard disk is 25 Percent full
    Is currently: db_slave, memcache, rabbitmq_slave, appengine
    Database is at 129.111.179.145
    Is in cloud: cloud1
    Current State: Preparing to run AppEngine apps if needed
    Hosting the following apps: guestbook
    The number of AppServers for app guestbook is: 1
Status of node at 129.111.179.150:
    Currently using 4.8 Percent CPU and 11.52 Percent Memory
    Hard disk is 25 Percent full
    Is currently: db_slave, memcache, rabbitmq_slave, appengine
    Database is at 129.111.179.150
    Is in cloud: cloud1
    Current State: Preparing to run AppEngine apps if needed
    Hosting the following apps: guestbook
    The number of AppServers for app guestbook is: 1
Status of node at 129.111.179.148:
    Currently using 4.2 Percent CPU and 11.19 Percent Memory
    Hard disk is 25 Percent full
    Is currently: db_slave, memcache, rabbitmq_slave, appengine
    Database is at 129.111.179.148
    Is in cloud: cloud1
    Current State: Preparing to run AppEngine apps if needed
    Hosting the following apps: guestbook
    The number of AppServers for app guestbook is: 1

Deploy an app

You can deploy Google App Engine applications by running:

$ appscale deploy ~/path-to-your-app

And you should see output resembling the following:

Done starting up AppScale, now in heartbeat mode

Uploading guestbook...
We have reserved the name guestbook for your application.
Creating remote directory to copy app into
Copying over app
Updating AppController
Please wait for your app to start up.

Your app can be reached at the following URL: http://129.111.179.144:8080

Navigate on your host machine's browser to this address to interact with your app.

Step 4: Shutting down AppScale and terminating your instance

If you do not have disks attached then it will warn you of data loss. See Automated Data Persistence on persistencing data.

Shut down your apps and AppScale deployment by running:

$ appscale down

and you should see:

About to terminate instances spawned via euca with keyname 'samplekey'...
Waiting for instances to shutdown
Waiting for instances to shutdown
Waiting for instances to shutdown
Waiting for instances to shutdown
Terminated AppScale in cloud deployment.

Getting help

If you run into any problems, please send an email to us via the AppScale Community group or join us on #appscale on freenode.

⚠️ **GitHub.com Fallback** ⚠️