TranslateProject/sources/tech/20201202 Set up OpenStack on a Raspberry Pi cluster.md
DarkSun 0b2a579b67 选题[tech]: 20201202 Set up OpenStack on a Raspberry Pi cluster
sources/tech/20201202 Set up OpenStack on a Raspberry Pi cluster.md
2020-12-03 05:03:45 +08:00

11 KiB

Set up OpenStack on a Raspberry Pi cluster

Since Arm processors are "first-class citizens" in OpenStack, and Raspberry Pis are built on Arm, why not combine them? Raspberries with pi symbol overlay

In the year since the Raspberry Pi 4 was released, I've seen many tutorials (like this and this) and articles on how well the 4GB model works with container platforms such as Kubernetes (K8s), Lightweight Kubernetes (K3s), and Docker Swarm. As I was doing research, I read that Arm processors are "first-class citizens" in OpenStack. Since Raspberry Pi is built on Arm, I decided to test this theory by installing OpenStack on a Raspberry Pi cluster.

Prerequisites

There are a few things I need to consider for this project:

  1. Whether to use Ubuntu 64-bit or CentOS 64-bit for Raspberry Pi to boot headless; Raspberry Pi OS will not suffice, even as a Debian derivative, because there are no OpenStack packages for it.
  2. I need the latest version of OpenStack that will run in my distribution because I don't think the latest versions have an AArch64 image.
  3. I doubt that there is any documentation for automating a ground-up installation, so I will use a step-by-step process.

Materials used:

  1. Four Raspberry Pi 4Bs, 4GB model (8GB recommended)
  2. Four 32GB MicroSD cards
  3. Four Raspberry Pi cases with fans and heatsinks (very important)
  4. Four Raspberry Official Power supply

Configure the base operating system

I used the CentOS AArch64 image; as I suspected, there is not a CentOS 8 image available for Raspberry Pi, so I used CentOS 7 AArch64 with this prebuilt image. It didn't work when I tried installing it with dd, but it worked like a charm when I used balenaEtcher.

balenaEtcher

(Aaron John Canlas, CC BY-SA 4.0)

After burning the images on the SD cards, I plugged the Raspberry Pis into my router to check their IP addresses so I could remotely access them using SSH. I configured their WiFi and hostnames using nmtui to access them without any cables attached (except for their power source, of course). The default user is root, and the default password is centos.

SSH console in CentOS 7 AArch64

(Aaron John Canlas, CC BY-SA 4.0)

I updated the operating system:

`[root@rpi4b4-0 ~]# yum update -y`

I repeated this process on all my Raspberry Pis then rebooted them.

Install OpenStack

The latest OpenStack releases (Ussuri and Victoria) require CentOS 8, so I used Train, as it's the most recent version that uses CentOS 7.

Confirming OpenStack Train's availability

(Aaron John Canlas, CC BY-SA 4.0)

I used the OpenStack Foundation's installation steps, but I encountered some issues with it. To make it easier for others to install OpenStack on CentOS 7, I compiled the following links and tips.

Prerequisites

  1. Network Time Protocol (NTP) 1. Controller node installation 2. Compute node installation 3. Verify operation
  2. OpenStack packages: Run the Train version of the installation (this link includes all versions)
  3. SQL database: Controller node installation
  4. Message queue: Controller node installation
  5. Memcached: Controller node installation
  6. Etcd: Controller node installation

OpenStack services

  1. Identity service (Keystone) 1. Controller node installation
2. [Verify operation][19]

Keystone verification

(Aaron John Canlas, CC BY-SA 4.0)

  1. Imaging service (Glance) 1. Controller node installation
2. [Verify operation][22]

TIP: Instead of downloading the CirrOS image mentioned in the documents, make sure to use the AArch64 CirrOS image for Raspberry Pis.

Glance verification

(Aaron John Canlas, CC BY-SA 4.0)

  1. Placement service (Placement) 1. Controller node installation
2. [Verify operation][26]

Placement verification

(Aaron John Canlas, CC BY-SA 4.0)

  1. Compute service (Nova) 1. Controller node installation
2. [Compute node installation][29]

3. [Verify operation][30]

TIP: In the last part of the verify operation, nova-status upgrade check fails due to a packaging error. To fix it, edit the following file in the controller: [code]

[root@rpi4b4-0 ~]# vim /etc/httpd/conf.d/00-placement-api.conf (…) <Directory /usr/bin>    <IfVersion >= 2.4>       Require all granted    </IfVersion>    <IfVersion < 2.4>       Order allow,deny       Allow from all    </IfVersion> </Directory>

If you run `nova-status upgrade check` now, it will work.

![Nova verification][31]

(Aaron John Canlas, [CC BY-SA 4.0][8])



  5. Networking service (Neutron)
    1. [Controller node installation][32]

    2. [Controller for Option 2: Self-service network installation][33]
To enable the `br_netfiler` module: [code]

[root@rpi4b4-0 ~]# modprobe br_netfilter
[root@rpi4b4-0 ~]# echo "br_netfilter" &gt; /etc/modules-load.d/br_netfilter.conf
[root@rpi4b4-0 ~]# lsmod|grep br_netfilter
3. [Compute node installation][34]

4. [Compute for Option 2: Self-service network installation][35]

To enable the br_netfiler module: [code]

[root@rpi4b4-X ~]# modprobe br_netfilter [root@rpi4b4-X ~]# echo "br_netfilter" > /etc/modules-load.d/br_netfilter.conf [root@rpi4b4-X ~]# lsmod|grep br_netfilter

    5. [Verify operation][36]

    6. [Verify operation for Option 2: Self-service network installation][37]

![Neutron verification][38]

(Aaron John Canlas, [CC BY-SA 4.0][8])

  6. Dashboarding service (Horizon)
    1. [Controller node installation][39]
TIP: Upon restarting the httpd service, you will get a 404 error. To resolve it, add this line to the end of the `/etc/openstack-dashboard/local_settings`: [code]`WEBROOT = '/dashboard'`[/code] Then restart httpd as usual: [code]`[root@rpi4b4-X ~]# systemctl restart httpd.service`
2. [Verify operation][40]

Horizon verification

(Aaron John Canlas, CC BY-SA 4.0)

How well does it work?

This was a fun and successful experiment. In terms of performance, it's quite slow considering that my controller only has four cores and 4GB RAM, but it's useful for managing multiple computers in one dashboard. My next step will be to try this with a TripleO deployment and a Ceph storage cluster to enable live migration. I might try using the Raspberry Pi's Ethernet if I have a larger cluster and workload in mind; for now, Grafana is working fine for internet monitoring.


via: https://opensource.com/article/20/12/openstack-raspberry-pi

作者:AJ Canlas 选题:lujun9972 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出