Setting up our work environment
In order for our devices to communicate with one another, we need to set up the networking hardware and cable connections. We will also need to connect the necessary peripherals in order to interact with the Raspberry Pi's boot loading software.
Provided is a list of recommended and optional items you will need and following this we will discuss each of them in detail:
- Two Raspberry Pi Model B's, preferred with 512 MB RAM
- HDMI-capable or VGA/DVI monitor with appropriate adapter or adapter cable
- USB keyboard
- USB mouse
- Two 1A at 5 V Micro-USB power units
- A desk-mounted power strip with both USB and mains outlets (optional)
- Three Ethernet/RJ45 network cables
- A small network switch
- An existing Internet connection
- Two SD cards that are compatible with the Raspberry Pi
- Housing units for the Raspberry Pi boards (optional)
- USB hard drives (optional)
- Lego (optional)
HDMI-capable monitor or VGA/DVI monitor and adapter
The Raspberry Pi provides two easy options for connecting visual display units. This is via the RCA jack, which allows you to attach the Raspberry Pi to a TV and an HDMI port for connecting HD TV's and HD monitors to the Raspberry Pi.
When following this book we recommend using an HDMI or VGA/DVI monitor with appropriate cabling and adapters for simple ease of use. Being able to easily switch the plug on your monitor between your Raspberry Pi nodes will make debugging issues and setting up software easier.
USB keyboard and mouse
Most standard USB keyboards and mice should work with the Raspberry Pi. The eLinux website provides a list of peripherals that have been verified to work with your device. You can find this list at the following URL:
http://elinux.org/RPi_VerifiedPeripherals
Two micro-USB power units
When it comes to powering the Raspberry Pis, you will need two 1A at 5 V power units with micro-USB connectors or a USB hub and two micro USB cables. If you plan on extending your setup beyond three Raspberry Pi's you should consider a USB hub with multiple ports.
There have been a number of problems with power units not working with the Raspberry Pi. You should be aware that USB 2.0 specifies up to 500 mA per port, which is below what the Raspberry Pi can draw at peak (700 mA). This can result in problems especially with cheaper USB hubs.
Before purchasing any power units it is recommended that you review the details on the eLinux Wiki detailing power usage notes:
http://elinux.org/RPi_VerifiedPeripherals#Power_Usage_Notes
A desk-mounted power strip with both USB and mains outlets (optional)
Based upon the power usage notes on eLinux, you may wish to find hardware that mimics the following setup. If you are working on a desk having a power strip that contains at least two mains outlets and two USB ports should be easier to access. It will allow you to place your Pi's and monitor close to the power source and thus cut down on trailing wires and having to clamber around below a desk plugging in and unplugging cables.
A device similar to the one shown in the following image should be sufficient:
Three Ethernet/RJ45 network cables
In order to set up your parallel system, you will need three network cables. If you plan on adding more Raspberry Pi units to your setup in the future, you will need one additional cable per Pi.
One network cable will be connecting your switch to your modem and the other two cables will connect your Raspberry Pis to the switch.
A small network switch
For completing the projects in this book it is recommended you purchase a small network switch. A switch is a device that links multiple machines together on a network. For example, when using a switch, if it is connected to a router/modem, devices connected to the switch can share the Internet connection. When working with the Raspberry Pi you will only need a 10/100 desktop switch and although having a gigabit switch is nice, it is not necessary.
Many wireless routers provided by cable companies come equipped with several network ports allowing you to connect multiple Ethernet devices to them. While this is convenient, you may find it easier to isolate your Raspberry Pi so it is connected to a switch and then attach the switch to the router. This will likely give you more Ethernet ports, thus allowing you to expand your parallel computing setup. Also if your router is not located near your work area, cut down on the number of cables you will need to run and the length of cable you need to purchase.
An existing Internet connection
In order to download the operating system, Hadoop, and other software used in this book you will need an Internet connection.
Two SD cards that are compatible with the Raspberry Pi
The Raspberry Pi device uses a Secure Digital (SD) card in order to boot. The tutorials in this book will also be using the SD card as the Raspberry Pi's hard drive, although in the Appendix we do discuss incorporating a USB hard drive if you wish.
Therefore, you will need two Raspberry Pi-compatible SD cards in order to complete the examples in each chapter and an additional SD card for each further Raspberry Pi device you wish to add in the future.
A list of compatible SD card brands can be found at:
http://elinux.org/RPi_SD_cards
This subject is also covered later in this chapter.
Housing units for the Raspberry Pi boards and Lego (optional)
The Raspberry Pi usually comes shipped as just the board with the case being optional.
If you plan on using just two Raspberry Pis, a number of inpidual cases are available for purchase. If you intend on expanding the number of devices in your system, you may wish to consider a housing unit that allows for easy expansion.
The Appendix of this book provides a list of suppliers and housing units in either the singular form or designed for expansion for multiple devices. You will also find a brief guide to using Lego for building an expandable housing rack and a guide on the types of blocks you need.
While a housing unit is not required, providing one for your Raspberry Pis helps to cut down on the risk of them getting damaged.
USB hard drives (optional)
Once you have completed the examples in the book you may explore using USB hard drives in order to store your applications. If you do decide to use a USB hard drive you will need to have a powered USB hub in order to ensure it runs reliably.
SD cards have a limited (although large) number of write operations before the device starts to degrade. A USB hard drive is a more robust device, usually much faster than SD and will hold up better to many read/write cycles. The Appendix of this book discusses this subject in further detail.
Should you wish to try this out please refer to the eLinux verified peripherals list first: