Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building a BeagleBone Black Super Cluster

You're reading from  Building a BeagleBone Black Super Cluster

Product type Book
Published in Nov 2014
Publisher
ISBN-13 9781783989447
Pages 156 pages
Edition 1st Edition
Languages
Author (1):
Andreas J Reichel Andreas J Reichel
Profile icon Andreas J Reichel

Chapter 3. Operating System Setup and Configuration

After you have set up the hardware of your cluster, you can bring it alive by installing the operating system. This chapter will guide you through the process of installing Linux and configuring all the required hardware links between the cluster nodes. It will teach you the differences between the master and the slave node and how to configure remote access and external network storage. For file sharing, Samba will be used, which is well known among Linux users. The first steps will be executed in an already existing Linux environment. If you don't have one, you can download Knoppix, Ubuntu, or other distributions and boot your PC or laptop from CD or DVD. If you don't have a CD or DVD drive in your laptop, you can prepare a USB stick and boot from that instead. Instructions on how to do this can be found at http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows.

This system will be called a host environment in this chapter...

The Linux host environment


The Linux host environment provides you with a basic platform for the easy creation of installation images. Actually, it is not necessary to use Linux. and you can also create bootable microSD cards from within other operating systems. However, creating the master installation image on the microSD card won't be different compared to copying the installation image onto the nodes' internal eMMC memory. Thus, for the sake of simplicity, a Linux environment is highly recommended. Another point of view is that Linux only does what you tell it to do. If you tell it to overwrite every single byte on the card with the contents of a binary file, it will do so, and the command is very simple. On Windows, you need very specialized software for such a task.

Creating the master node's installation image


Here, we will guide you through the process of creating the installation image for your cluster's master node. First, you need to download the cluster operating system you want to use and copy it to a bootable microSD card. Afterwards, you can boot up your master node with the microSD card and either copy the OS to its internal memory or continue using the microSD card for operation. This book will use the second approach and use a 16 GB microSD card for additional swap space. Let's first start with a short introduction to bootable SD cards.

Bootable SD cards and partition tables

There are some vendors who announce that their cards are bootable and others might not be. This is simply not true. Every microSD card and every memory stick is bootable. The only thing that has to be done is to create the correct partition table in the master boot record.

To give an example, let's assume that your SD card is inserted into your computer running your Linux...

Installing the operating system on the master node


If you do not want to boot from BBB's internal memory, you have to keep in mind that it will use its first boot code to boot from the internal card or external card, if inserted. If the Linux partition on the external card differs from the internal memory, BBB will crash. To prevent it from crashing you have to activate the second boot code in order to boot from the external card by pressing the boot-selection button. As this is annoying, the better solution is to write the installation image into the internal memory as well. This will update the boot sector of the internal memory, which will automatically boot our external memory card without the need to press the boot-selection button.

If you have adapted the installation image to the size of your memory card that is larger than the internal eMMC memory of your BBB, you can copy the original .img file onto the microSD card, producing an image within an image. This is quite helpful because...

The external network storage


When executing multiprocessor applications, every CPU must have access to any software library required. As every CPU means every BBB in our case, every BBB must have access to the same software libraries. If we store those libraries locally, this would:

  • Waste a lot of memory

  • Cause a lot of work if we update something, because we would have to update every single node

  • Generate error sources because some nodes might have other versions installed, leading to inconsistency

To avoid these problems, an external network storage can be used. In this book, we will use a shared Samba folder. Samba can be easily installed on any Linux operating system. Ports for other OSes are also available. You can visit www.samba.org for more information.

In the following text, we will assume that you have a working Samba share on a server in your LAN with the following configuration:

[MPIShare]
comment = MPIShare
browseable = yes
readonly = no
valid users = ubuntu
path = /any_path_you_want_on_your_smb_server...

Installing and configuring the slave nodes


Configuring the slave nodes is actually the same as configuring the master node, except that we do not need a Samba server on it. Instead, we have to configure the automount to mount the share of the master node. Also, we have to modify the network configuration.

Creating the slave node's installation image

The slave nodes will not be booted from external microSD cards. Instead, the operating system will be booted from internal eMMC memory. To install Ubuntu into the internal eMMC, you can create an installation card exactly as described for the master node. The only difference is that your memory card must match the internal eMMC memory. Let's assume that you have the old BBB version with 2 GB internal memory. Then, you need a 2 GB installation image that is already provided with this book. On your host environment, copy the decompressed .img image file onto the microSD card by issuing the same command as the one described for the master node:

sudo...

A crash course in developing applications


The aim of this section is to provide you with a short crash course in programming on Linux operating systems. However, it is not possible to deal with this topic in all its glory. It takes years to get the hang of it and write good programs. However, this section tries to provide you with a basis you can build upon. If you want to get more detail on this topic, there is a lot of information on the Internet.

As you might not have developed applications previously, this section will give you a short introduction to this topic. As we have already seen in Chapter 1, BeagleBone Black System Board, in the Software programming section, there is a certain set of tools that have to be used with the source code in order to generate a binary file that can be executed—the actual program. Let's first see how this toolchain is actually installed.

Installing development tools

Now that we have our cluster system running the operating system and the basic network configuration...

Transferring files from and to the BeagleBone master node


Of course, it will be necessary to back up your code and other files or simply transfer anything you want between a remote computer and the cluster's master node. There are different ways through which you can accomplish this. The easiest way is to use the Samba share that you have already configured.

However, you can use other ways such as file transfer protocol (FTP), of course.

The FTP server

For secure FTP server functionality, you can install the vsftpd package, which stands for very secure ftp daemon. This is a package that was created in order to provide a very secure version of the FTP server software. You can install it by typing the following:

sudo apt-get install vsftpd

I got an error message after this, but I just repeated the command and it finished successfully. After the installation and configuration process, the server is started automatically. By default, the server is anonymous, which means that it does not allow...

Summary


In this chapter, I showed you how to install the operating system on your BBBs. You learned about the small differences between configuring the master and slaves nodes. Additionally, I showed you how to write smaller system images to larger memory cards and how to adapt the filesystem size to use the full card size.

Examples of a network configuration were given to provide a basic system setup. This included the configuration of SSH, which is a powerful console tool that executes commands on your BBB from a remote location.

After a step-by-step guide on how to install the basic programming environment, you were given an example of how to write your first application in Linux on your BBB.

The chapter ended by configuring some additional tools such as FTP and Samba, and you were shown how to access and transfer files from and to your cluster.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Building a BeagleBone Black Super Cluster
Published in: Nov 2014 Publisher: ISBN-13: 9781783989447
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}