[LINUX] Distributed environment construction with Raspberry PI series (7: tftp route setting and startup test for each Raspberry Pi)

Introduction (serialization list)

  1. Construction of distributed environment with Raspberry PI series (Part 1: Summary of availability of diskless client by model)
  2. Building a distributed environment with Raspberry PI series (Part 2: Analysis of PiServer and design of alternative system)
  3. Building a distributed environment with Raspberry PI series (Part 3: Installing and setting dnsmasq)
  4. Building a distributed environment with Raspberry PI series (Part 4: Build NFS server and import OS for clients)
  5. Building a distributed environment with the Raspberry PI series (Part 5: Customizing the Raspberry PI OS for cluster nodes (1))
  6. Building a distributed environment with Raspberry PI series (Part 6: Customization of Raspberry PI OS for cluster nodes (2))
  7. Building a distributed environment with Raspberry PI series (7: tftp route setting and startup test for each Raspberry Pi)

This article is part 7.

Last time uses qemu-user-static installed on an NFS (or PXE) server to customize the OS image for clients copied to an NFS machine. However, this time I will do a boot test as a tftp root by creating a symbolic link to the / boot directory of this OS image (this time it is short).

Reference (author's environment)

RaspiCloudSystem.png

Actual work

Describe the NFS server and PXE server as separate.

1. Mount the NFS server shared directory from the PXE server

1.1. Create and mount a mount point on the PXE server

NFS server IP
192.168.172.17
Shared directory name
/ exports / os4pi

If you have qemu-user-static installed on both NFS / PXE servers and want to customize the OS for Raspberry Pi from either, set it to rw, but if you don't need to customize it on the PXE server, you can use ro. ..

# mkdir /mnt/os4pi
# mount -t nfs -o proto=tcp,vers=3,rw,noatime 192.168.172.17:/exports/os4pi /mnt/os4pi

1.2. Add a line to / etc / fstab on the PXE server to persist

192.168.172.17:/exports/os4pi   /mnt/os4pi   nfs    tcp,vers=3,rw,noatime,_netdev    0  0

2. Create a symbolic link to the tftp route set in dnsmasq

conditions

tftp root (reference directory)
/ srv / tftp
MAC address of Raspberry Pi 2B
b8-27-eb-GG-HH-II
Fixed IP assigned to Raspberry Pi 2B
192.168.172.32
OS / boot location for Raspberry Pi 2B
/ mnt / os4pi / raspbian / armhf / boot
MAC address of Raspberry Pi 3B
b8-27-eb-XX-YY-ZZ
Fixed IP assigned to Raspberry Pi 3B
192.168.172.33
OS / boot location for Raspberry Pi 3B
/ mnt / os4pi / raspbian / armhf_64 / boot
MAC address of Raspberry Pi 4B
dc-a6-32-PP-QQ-RR
Fixed IP assigned to Raspberry Pi 4B
192.168.172.34
OS / boot location for Raspberry Pi 4B
/ mnt / os4pi / raspbian / aarch64 / boot
# cd /srv/tftp
# rm -Rf b8-27-eb-GG-HH-II
# ln -sf /mnt/os4pi/raspbian/armhf/boot b8-27-eb-GG-HH-II
# ln -sf /mnt/os4pi/raspbian/armhf/boot 192.168.172.32
# rm -Rf b8-27-eb-XX-YY-ZZ
# ln -sf /mnt/os4pi/raspbian/armhf_64/boot b8-27-eb-XX-YY-ZZ
# ln -sf /mnt/os4pi/raspbian/armhf_64/boot 192.168.172.33
# rm -Rf dc-a6-32-PP-QQ-RR
# ln -sf /mnt/os4pi/raspbian/aarch64/boot dc-a6-32-PP-QQ-RR
# ln -sf /mnt/os4pi/raspbian/aarch64/boot 192.168.172.34

Notes

3. Raspberry Pi test launch

3.0. Preparation

  1. Turn on the power in the order of NFS server → PXE server. Wait until you can log in.
  2. Refer to Part 1 and make each model ready for diskless boot.

3.1. For Raspberry PI 2B

  1. Copy only the bootcode.bin file from the latest RaspberryPI OS installer image to an empty microSD (which can be small) with the first partition FAT formatted and insert it into the Raspberry Pi
  2. Connect HDMI, keyboard, LAN
  3. Connect USB (power supply)
  4. Confirm that the bootcode.bin on the microSD has been read and the color gradation appears on the monitor. If you don't see it, either the microSD is dead (including if it's not in FAT format), the Raspberry Pi's microSD drive is bad, or the bootcode.bin file copy failed.
  5. Confirm that the LAN access lamp lights up. If it doesn't light up, it's possible that your Raspberry Pi's GPU / SoC is out of order or your network connection isn't working properly.
  6. Confirm that the rasp pie logo and boot log appear on the screen (it means that tftp settings are OK). If the screen remains black and does not proceed, there is a misconfiguration of the tftp server itself or a misconfiguration of the config.txt file on the tftp server.
  7. Confirm that you can log in. If it stops in the middle, it may be due to a misconfiguration of cmdline.txt on the tftp server, a misconfiguration of the NFS server, or a misconfiguration of the / etc / fstab file.

3.2. For Raspberry PI 3B / 3B +

  1. Unplug the microSD
  2. Connect HDMI, keyboard, LAN
  3. Connect USB (power supply)
  4. Confirm that the LAN access lamp lights up. If it doesn't light up, it's possible that 3B-specific preparations haven't been made, the network isn't properly connected, or the GPU / SoC is bad. [^ Bad]
  5. Confirm that the color gradation is displayed on the monitor. If you can confirm this, it is OK to download bootcode.bin from the tftp server. If you don't see the color gradient, it's possible that your tftp server is misconfigured.
  6. Confirm that the Raspeye logo and boot log appear on the screen. If the screen remains black and does not proceed, there is a misconfiguration in the config.txt file on the tftp server.
  7. Confirm that you can log in. If it stops in the middle, it may be due to a misconfiguration of cmdline.txt on the tftp server, a misconfiguration of the NFS server, or a misconfiguration of the / etc / fstab file.

[^ Bad]: In fact, I had one 3B individual that often caused the microSD to fail to boot immediately after purchase. I always thought "microSD is dead / incompatible", but while testing diskless boot, I realized that "this is an initial failure". Initial failure that I noticed for the first time 4 years after purchase ...

3.3. For Raspberry PI 4B

  1. Unplug the microSD
  2. Connect HDMI, keyboard, LAN
  3. Connect USB (power supply)
  4. Confirm that the LAN access lamp lights up. If it does not light up, it may be due to unprepared, poorly connected networks, or a bad EEPROM / SoC.
  5. Confirm that the color gradation is displayed on the monitor and blacked out. It can be confirmed that there is no initial failure of the EEPROM.
  6. Confirm that the Raspeye logo and boot log appear on the screen. If the screen remains black and does not proceed, there is a misconfiguration in the config.txt file on the tftp server.
  7. Confirm that you can log in. If it stops in the middle, it may be due to a misconfiguration of cmdline.txt on the tftp server, a misconfiguration of the NFS server, or a misconfiguration of the / etc / fstab file.

Next time preview

That's all for this time. Next time, I would like to build the simplest distributed environment, a load distribution (redundant) web server using Apache.

Recommended Posts

Distributed environment construction with Raspberry PI series (7: tftp route setting and startup test for each Raspberry Pi)
Distributed environment construction with Raspberry PI series (Part 4: NFS server construction and client OS import)
Build a distributed environment with Raspberry PI series (Part 3: Install and configure dnsmasq)
Environment construction, simple confirmation and skill test for each language
Construction of Cortex-M development environment for TOPPERS using Raspberry Pi
Raspberry pi initial setting (for myself)
VPN server construction with Raspberry Pi
Environment construction with pyenv and pyenv-virtualenv
Building a distributed environment with the Raspberry PI series (Part 1: Summary of availability of diskless clients by model)
Realize environment construction for "Deep Learning from scratch" with docker and Vagrant
Pet monitoring with Rekognition and Raspberry pi
Build a Tensorflow environment with Raspberry Pi [2020]
Try fishing for smelt with Raspberry Pi
Simple VPN construction of IPsec gateway with Ubuntu 20.04 and Raspberry Pi ―― 1. StrongSwan introduced
Cross-compiling Raspberry Pi and building a remote debugging development environment with VS Code
[For beginners] I made a motion sensor with Raspberry Pi and notified LINE!
IPsec gateway VPN construction with CentOS 8 and openSUSE (Raspberry Pi) --2 StrongSwan VPN connection confirmation
MacOS 10.11 environment construction: Powerline with Anaconda and Dein.vim
Media programming with Raspberry Pi (preparation for audio)
Create execution environment for each language with boot2docker
MQTT RC car with Arduino and Raspberry Pi
Pillow environment construction --For Docker + iPython (and OpenCV)
Rollback DB for each test with Flask + SQLAlchemy
Get temperature and humidity with DHT11 and Raspberry Pi
Simple VPN construction of IPsec gateway with CentOS 8 and openSUSE (Raspberry Pi) ―― 1. StrongSwan introduced