Phase 1 — Planning — Server Architecture *If you missed the intro story with the high level overview of what we’re building you can find it here . “a journey of a thousand miles begins with a single step” — Laozi And our first step is to provide compute, storage, and . Let’s begin. network We’re using the for our compute needs. We’ll run a with four s. You can use as little as two Pis of any flavor if you so choose, although it does get interesting with more hosts when we start clustering and load balancing. Also, I’m using wireless for my network so you’ll need to make the appropriate adjustments if you have non wireless Pis. We’ll run as the OS and lean on Docker Swarm for clustering. Compute — Raspberry Pi platform Raspberry Pi 3 Model B Raspberry Pi Zero W Raspbian I’m going with cards for local Pi storage. Any brand will work so long as you’re using something fast enough( ). We’ll hang a USB drive off our wireless router for a poor man’s NAS so we have some persistent storage for our containers. Storage — these Class 10 Wires? Where we’re going, we don’t need wires. Wireless it is, 802.11n specifically. I chose the for this for two reasons. First, Amazon had a great price on them. Second, it supports and has a USB(read: NAS) port on it. Network — Linksys AC1750 DD-WRT Phase 1 — Doing — Server Architecture First things’ first. We need to stand up our compute and local storage. I’m using a Windows 10 laptop for this because it’s what I have laying around and I only ever see tutorials of this type from a Linux perspective. You’ll want to install , then we’ll use it to flash on our micro SD cards. The whole process was point and click for me, but if you run into problems there’s an on the Pi website. Etcher Raspbian Jessie Lite install guide After Etcher finishes up, go ahead and drop a file with no extension named “ssh” on the root of the SD card to enable SSH temporarily. SSH is disabled by default on Raspbian and once we get into our install we’ll want to enable SSH permanently. Our local storage is now prepped and ready to be inserted into the Pi. Time now for compute. Grab a network cable and connect the ethernet port on the Pi to the ethernet port on your laptop. On boot, the Pi will look to a DHCP server for it’s IP address. I used from Jounin to run a local DHCP server on my laptop. For some reason chrome’s safe browsing was alerting on the domain for tftpd. You are free to use whatever means you want to provide DHCP to your Pi. Setup your DHCP server by specifying which network interface you want it to run on, define your pool, and setup your DHCP options to hand out a subnet mask and default router. tftpd64 My tftpd settings Make sure you’ve inserted your SD card and then apply power to the Pi and watch your DHCP server log. The log will tell you when your Pi has pulled an address and which address it pulled. Here we see that the Pi has pulled IP address 10.3.3.50 We’ll need an SSH client to communicate with the Pi. My personal fave is . Grab a copy of it and put it somewhere that’s easy to remember. Open a command prompt and start off by pinging the Pi to ensure we’ve got good communication. putty If you get something other than replies you can reference to figure out what your error means. A few things I would check first would be: this Does the Pi have power? Is the ethernet cable plugged in securely to your computer/Pi? Do you have link lights (yellow/green) on the Pi? Did you see the Pi grab an IP address from your DHCP server? Depending on the laptop you are using, you may need to use an ethernet . Instead of the cable, you can insert a cheap switch between your Pi and laptop. crossover cable Moving on. and we’ll finish setting up the OS. SSH to the Pi >c:\putty.exe -ssh pi@10.3.3.50 I placed my putty executable on the root of my C drive. The default username for the Pi is… . Accept the security cert and use as the password. You are rewarded with a friendly shell. **pi** **raspberry** pi@raspberrypi:~ $ Use and do the following: [sudo raspi-config](https://www.raspberrypi.org/documentation/configuration/raspi-config.md) Enable SSH permanently by going to Interfacing Options -> SSH Change user password Change hostname Expand the file system which is now under Advanced Options Make sure each of your Pis has a different hostname. I’m going headless (no monitor) on all my Pis so I also go into Advanced Options and change the Memory Split to 16 since I’m not using the GPU. Compute is now complete. Network is the last leg of our foundation’s triangle. We’ll configure our wireless and slough off our Cat5e shackles. *Side Note* In any type of scenario where I was responsible for supporting this monstrosity, I would use a physical network. I’m going wireless with this build because all the guts are on my desk and I’m trying to keep the clutter to a minimum. I’m not going into the specifics on how to configure every wireless model device out there, but suffice it to say that you need to setup an SSID and give it a password of at least 8 characters. I use for security. I configured my SSID to be and my password as on my wireless router. I’m also using the wireless router as a DHCP server for the wireless network. You should do the same. WPA2 Personal **piparty** **turtletime** Back at the Pi command line, I fire off a quick scan to be sure everything is in working order with my wireless and after seeing listed I know I’m ready to configure my Pi as a client. **piparty** I enter the command giving it the wireless SSID and then the password when it prompts me for it. **wpa_passphrase** We’ve now generated our WPA PSK and need to configure the WPA supplicant to connect to our wireless network by modifying the config file located at /etc/wpa_supplicant/wpa_supplicant.conf with nano. sudo nano /etc/wpa_supplicant/wpa_supplicant.conf At the bottom of the file you need to add your network information from earlier. Here’s mine as an example: Don’t forget the closing bracket on the network statement! Save the file and get out of nano by pressing , then , then . Reload your wpa supplicant configuration with . Take a look at the wlan0 interface and see that you’ve acquired an IP address from your wireless router. **CTRL+X** **Y** **Enter** **sudo wpa_cli reconfigure** inet addr:192.168.1.105 = Success From the image above we see that my Pi has received the first available IP address from the DHCP server running on my wireless router. Eureka! If you’re unsuccessful, you can find more detailed information on configuring wireless for you Pi . here Follow these steps for each Pi that will be in your cluster. When you finish you should be able to ping each Pi from any device connected to your wireless network. * Shortcut for your following Pis — — — — — — — — — — — — — — — — — — Open the _wpa_supplicant.conf_ file on your working Pi with the following command: sudo nano /etc/wpa_supplicant/wpa_supplicant.conf Copy the contents of the file and paste it into a new file on your laptop/workstation and name it _wpa_supplicant.conf_ . On future Pis, place a copy of the newly created _wpa_supplicant.conf_ on the root of the SD card (in the same place you put the empty “ssh” file earlier). On boot, your new Pi will automatically connect to your wireless network and you can SSH and continue with the process above. This saves you the trouble of physically connecting each Pi to your laptop for it’s initial wireless configuration. To recap: We built individual physical servers We provisioned our local storage We networked our servers and tested connectivity We now have a foundation to build upon. In each installment we will add new functionality until we’ve built a suitable throne for our application to call home. In our next installment we’ll lay the ground work for our app to be cloud native, which is a fancy way of saying we’ll get Docker up and operational. Leave suggestions, comments, and questions below.