-
Notifications
You must be signed in to change notification settings - Fork 277
Installing AppScale on Raspberry Pi 2
This page provides instructions on installing AppScale onto a Raspberry Pi 2 single-board computer running a fresh installation of Ubuntu 14.04 LTS. Credits to lmandres for writing the original guide.
This installation will require the following items:
- A Raspberry Pi 2 single-board computer
- A MicroSD memory card with at least 16 GB of memory
- A way to communicate with the shell terminal of the Raspberry Pi 2
- A USB keyboard
- A screen that connects to the HDMI port on the Raspberry Pi 2
- Alternatively, you may use an RCA connection to a CRT monitor. However, you will need a specialized cable to do this.
- An Internet connection
- A way to image Ubuntu onto the MicroSD card
- A separate computer to install additional programs
- The SDFormatter program
- The Win32DiskImager program
- A working power source
These instructions assume that you understand how to:
- Communicate with the shell terminal of the Raspberry Pi 2
- Connect the Rasberry Pi 2 to the internet
- Connect your Raspberry Pi 2 to a power source
- Pay your electricity bill so that your Raspberry Pi 2 has power
While there are multiple ways to image Ubuntu onto the MicroSD card, these instructions will specifically go over imaging Ubuntu from a Microsoft Windows based system. For other methods, refer to the instructions at:
https://wiki.ubuntu.com/ARM/RaspberryPi#Download
First, we will need to format the MicroSD card. These instructions will use SDFormatter downloadable from:
https://www.sdcard.org/downloads/formatter_4/
Instructions to install SDFormatter are included on the web site above. Once SDFormatter has been installed onto your computer, format the MicroSD card. To do this:
- Insert the MicroSD card into your separate computer (from the Raspberry Pi 2).
- Open the SDFormatter program (you may need to give administrator permissions for this application to run).
- Select the drive of your MicroSD card (make sure this is the drive for the MicroSD card that you are formatting and not other devices that may be plugged in to your computer).
- Click on the "Format" button.
- The program will ask for confirmation that you want to format your MicroSD card. Click on "OK" for both of these dialog boxes.
- When the program has completed formatting the MicroSD card, click on "OK" on the resulting message box.
- Exit the SDFormatter program by clicking on the "Exit" button of the main program window.
Once you have formatted the MicroSD card, you will need to download the Win32DiskImager program and install it onto your separate computer (from the Raspberry Pi 2). The Win32DiskImager installation application can be downloaded from:
http://sourceforge.net/projects/win32diskimager/files/latest/download?source=navbar
Once the Win32DiskImager installation program has been downloaded to your separate computer, double-click the resulting program and run the installer.
The Ubuntu installation image that these instructions use can be downloaded from:
http://www.finnie.org/software/raspberrypi/2015-04-06-ubuntu-trusty.zip
Save the file onto your computer and unzip it. This should result in a file on your computer named "2015-04-06-ubuntu-trusty.img".
Next, open the Win32DiskImager program and write the "2015-04-06-ubuntu-trusty.img" file to your MicroSD card.
- Double click on the Win32DiskImager program to run it. You may need to provide administrator permissions to run the program.
- Make sure that the device with the MicroSD card is selected under the "Device" label.
- Click on the folder icon under the "Image File" label and provide the path to the "2015-04-06-ubuntu-trusty.img" file.
- Click on the "Write" button.
- The program will confirm whether you want to write the image onto the MicroSD card. Click on the "Yes" button.
- Once the image has been written to the MicroSD card, a "Write Successful." dialog box will appear. Click on the "OK" button.
- Click on the "Exit" button of the main Win32DiskImager program to exit.
Lastly, eject the MicroSD card from your computer, and install it into the Raspberry Pi 2.
Prepare the Raspberry Pi 2 to run by plugging in the MicroSD, plugging in an ethernet cable with Internet access to the Raspberry Pi 2, plugging in a USB keyboard, and plugging the cable into the monitor.
The Raspberry Pi 2 must initially be connected to a monitor because the Ubuntu image does not initially ship with the OpenSSH server installed. As a result, these instruction describe the installation as initially connected to a physical monitor.
While an HDMI monitor may be used, it is also possible to a RCA video monitor by way of a specialized cable. This cable is available at Fry's and Radio Shack. However, differing cables yield differing results. The following part should work. However, I have not personally tested it.
http://www.frys.com/product/8448138
Initially, on the Ubuntu install for Raspberry Pi 2, the username and password are both set to "ubuntu". These instructions will assume that this has not changed. However, it is recommended that the password for all accounts on the Raspberry Pi 2 are changed.
- First, power on the Raspberry Pi 2 by plugging in a MicroUSB power source to the Raspberry Pi 2.
- From the Ubuntu login screen, login to the computer using the following credentials:
- Login: ubuntu
- Password: ubuntu
Next, you will need to expand the filesystem. Initially, the filesystem image is around 2GB. Since these instructions assume that you are using a 16GB MicroSD card or larger, we assume that the filesystem needs to be expanded. Instructions on expanding the filesystem can be found at:
https://wiki.ubuntu.com/ARM/RaspberryPi#Download
Enter the following command:
$ sudo fdisk /dev/mmcblk0
Delete the second partition (d, 2), then re-create it using the defaults (n, p, 2, enter, enter), then write and exit (w). Reboot the system by entering the following command:
$ sudo reboot
Once you have logged in again, enter the following command:
$ sudo resize2fs /dev/mmcblk0p2
Next, you will need to update the apt-get repository and install cURL and Git by issuing the following commands:
$ sudo apt-get update
$ sudo apt-get install curl git
This should result in an Ubuntu system that is 16GB large with cURL and Git installed.
Instructions for installing AppScale on a Linux machine are provided at:
https://github.com/AppScale/appscale/wiki/Virtualized-Cluster
However, this installation will break. Instead, we will do an initial install of AppScale using the instruction to install onto a Virtualized Cluster, then running a modified script which includes patches to allow the AppScale installation to run to completion. Issue the following commands:
$ sudo su
# cd /root
# curl -Lo bootstrap.sh http://bootstrap.appscale.com
# bash bootstrap.sh --tag dev
These commands log the root user into the command shell, and allows it to download the AppScale bootstrap install scripts into the /root directory. The changes to install AppScale onto Raspberry Pi are available in the "dev" release, specified with the "--tag" option.
Lastly, we need to activate the SSH login for the root user. While still logged in as root, issue the following command:
# passwd
You will get prompts to change the password for the root user. Choose a password and follow these prompts.
You will then need to allow the root user to login using SSH on the computer. To do this use a text editor to edit the file at /etc/ssh/sshd_config. An example is to use Nano by issuing the following command:
# nano /etc/ssh/sshd_config
Go to the following line in /etc/ssh/sshd_config:
PermitRootLogin without-password
and change it to read:
PermitRootLogin yes
Then reboot the computer by entering the following command:
# reboot
Once the installation has completed, continue with Step 3 of the "Deploying AppScale on Virtualized Clusters" instructions, available at:
https://github.com/AppScale/appscale/wiki/Virtualized-Cluster