Install OpenStack on CentOS 7

The https://rdoproject.org installer is exactly what is needed to streamline configuring OpenStack and help you to keep your local OS cloud running current software. RDO stands for “Ridiculously Dedicated Openstackers” and I’m impressed with their work.

if [ `getenforce` == "Enabled" ]; then
  echo "ERROR: SE-Linux must not be enabled"
  exit 1
fi

sudo systemctl disable firewalld NetworkManager
sudo systemctl stop firewalld NetworkManager

sudo yum update -y
sudo yum install -y centos-release-openstack-stein
sudo yum update -y

sudo yum install -y openstack-packstack
sudo packstack --allinone

The latest OpenStack version is “stein” as of writing this post. The next version is due in May of 2020 and is called Ussuri. It is an LTS version that will run on CentOS 8 and with Python3.

Pre-reqs to build PostgreSQL on CentOS 7/8

sudo yum -y groupinstall "Development Tools"

sudo yum -y install readline-devel zlib-devel openssl-devel \
   libxml2-devel libxslt-devel sqlite-devel \
   pam-devel openldap-devel python3-devel libcurl-devel \
   unixODBC-devel llvm-devel clang-devel chrpath \
   docbook-dtds docbook-style-xsl cmake \
   perl-ExtUtils-Embed libevent-devel postgresql-devel

Compile Postgres on Ubuntu 18

(1) Install pre-req’s

 

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3 python3-pip git 
sudo apt-get install build-essential libreadline-dev zlib1g-dev \ flex bison libxml2-dev libxslt-dev libssl-dev
sudo apt-get install libperl-dev clang llvm

(2) Download the PostgreSQL 11+ source code file

V=11.6
ftpPG=https://ftp.postgresql.org
wget $ftpPG/pub/source/v$V/postgresql-$V.tar.gz
tar -xvf postgresql-$V.tar.gz
cd postgresql-$V

(3) Configure, compile, & install

./configure --with-openssl --with-llvm \
 --with-libxml --with-libxslt --with-perl \   
 --with-python PYTHON=/usr/bin/python3 \
 --with-libedit-preferred
make -j 4
sudo make install

Configure NTP on Ubuntu

sudo apt-get install ntp
sudo systemctl restart ntp

Now confirm it is working:

sudo service status ntp
● ntp.service - LSB: Start NTP daemon
    Loaded: loaded (/etc/init.d/ntp; bad; vendor preset: enabled)
    Active: active (running) since Thu 2019-11-28 11:25:48 PST; 8s ago
      Docs: man:systemd-sysv-generator(8)
   Process: 2060 ExecStop=/etc/init.d/ntp stop (code=exited, status=0/SUCCESS)
   Process: 2072 ExecStart=/etc/init.d/ntp start (code=exited, status=0/SUCCESS)
     Tasks: 2
    Memory: 668.0K
       CPU: 27ms
    CGroup: /system.slice/ntp.service
            └─2086 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 111:117
 Nov 28 11:25:53 bfu16 ntpd[2086]: Soliciting pool server 108.61.73.244
 Nov 28 11:25:53 bfu16 ntpd[2086]: Soliciting pool server 23.131.160.7
 Nov 28 11:25:53 bfu16 ntpd[2086]: Soliciting pool server 199.217.116.151
 Nov 28 11:25:53 bfu16 ntpd[2086]: Soliciting pool server 91.189.89.199
 Nov 28 11:25:53 bfu16 ntpd[2086]: Soliciting pool server 159.203.158.197
 Nov 28 11:25:54 bfu16 ntpd[2086]: Soliciting pool server 91.189.94.4
 Nov 28 11:25:54 bfu16 ntpd[2086]: Soliciting pool server 138.68.46.177
 Nov 28 11:25:54 bfu16 ntpd[2086]: Soliciting pool server 64.22.253.155
 Nov 28 11:25:54 bfu16 ntpd[2086]: Soliciting pool server 72.30.35.88
 Nov 28 11:25:54 bfu16 ntpd[2086]: Soliciting pool server 69.164.202.202

Configure Passwordless SSH

Make sure you have RSA public and private keys on your client machine with the ssh-keygen command:

cd ~
ls .ssh
ls: cannot access .ssh: No such file or directory

ssh-keygen -t rsa
  <hit enter three or four times>

ls .ssh
id_rsa  id_rsa.pub

Now copy the public key of the client machine to the authorized_keys file of the server machine via the ssh-copy-id command:

ssh-copy-id -f server-user@server-name

Now simply login to your server with no password:

ssh server-user@server-name

Configure NTP on CentOS

Chrony is the default NTP system for CentOS. Install it as follows:

sudo yum -y update
sudo yum -y install chrony
sudo systemctl enable chronyd
sudo systemctl restart chronyd

Now confirm it’s working:

sudo chronyd -Q; date  
2019-11-25T19:28:26Z chronyd version 3.4 starting (+CMDMON +NTP  +REFCLOCK +RTC
 +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)  
2019-11-25T19:28:26Z Disabled control of system clock  
2019-11-25T19:28:26Z Frequency 49.086 +/- 0.776 ppm read from /var/lib/chrony/drift  
2019-11-25T19:28:31Z System clock wrong by -0.001395 seconds (ignored)  
2019-11-25T19:28:31Z chronyd exiting  Mon Nov 25 11:28:31 PST 2019  

Get external IP with CURL

This little command can be useful to run from a machine to understand what IP address an external client see you coming from. First we maker sure curl is installed.

sudo yum update -y
sudo yum install -y libcurl

Now we use curl to make an http call to an external webserver that simply echo’s back the IP address it sees you coming from.

curl --ipv4 --silent icanhazip.com