Use devstack to install the openstack multi-node ussuri version under ubuntu18.04

Please refer to the official devstack document "Multi-Node Lab" to install multi-node openstack.
However, because the official documents did not consider domestic network issues, the installation was basically impossible. For specific solutions, please refer to the previous document "Common problems when installing openstack with devstack under ubuntu18.04" .

In addition, the official devstack document points out that only the multi-node installation of the ussuri version (as of 2020.07.27) is currently supported, so you can only use the ussuri version of devstack to install the ussuri version of openstack. Please pay attention.

For the specific installation steps, please refer to "Using Devstack to Install the Latest Version of Single Node Openstack under Ubuntu 18.04Lts" . There are small differences in steps 6, 9 and 10, you can compare them, and it will be more useful to install openstack using devstack. Experience.

Required resources:
Two physical machines or virtual machines, respectively configured with uncontrolled nodes and nova computing nodes.
Both have dual network cards.
Internal network segment: 10.4.128.0/20
External network segment: 192.168.42.0/24
Floating ip network segment: 192.168.42.128/25 In
this example, the control node addresses are 192.168.42.11 and 10.42.128.11. The computing node addresses are 192.168.42.12 and 10.4.128.12

1 Install the ubuntu18.04lts server or virtual host codenamed bionic. Please Baidu for specific methods.

2 After logging in, switch to the root user:

sudo su – root

3 Replace the ubuntu source with a domestic source. After several tests, the Tsinghua source is finally used:

mv /etc/apt/sources.list /etc/apt/sources.list.bak
vim /etc/apt/sources.list

Add the following content:

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

Update ubuntu18.04:

apt update -y && apt -y upgrade

4 Set the time zone:

dpkg-reconfigure tzdata

Select Asia -> select Shanghai -> OK

同步时间命令:
#安装时间同步工具
sudo apt-get install ntpdate
#与网络服务器同步时间
sudo ntpdate cn.pool.ntp.org
#查看时间是否已经同步
date

5 Replace pip with Doubanyuan

mkdir .pip
vi .pip/pip.conf

Add the following content:

[global]
index-url = http://pypi.douban.com/simple/
trusted-host = pypi.douban.com

6 Download devstack, the directory here is ~, and the downloaded version is ussuri. The official documentation states that multi-node only supports ussuri, and the updated v version does not support it yet. It is still under development.

git clone https://github.com/openstack-dev/devstack -b stable/ussuri

7 Create a stack user

devstack/tools/create-stack-user.sh

8 Put the devstack directory under /opt/stack and set permissions

mv devstack /opt/stack
chown -R stack:stack /opt/stack/devstack
sudo chmod -R 777 /opt/stack
sudo echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

9 Switch to the stack user, and you will be under the stack user until the openstack installation is successful.

sudo su - stack
mkdir ~/.ssh; chmod 700 ~/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyYjfgyPazTvGpd8OaAvtU2utL8W6gWC4JdRS1J95GhNNfQd657yO6s1AH5KYQWktcE6FO/xNUC2reEXSGC7ezy+sGO1kj9Limv5vrvNHvF1+wts0Cmyx61D2nQw35/Qz8BvpdJANL7VwP/cFI/p3yhvx2lsnjFE3hN8xRB2LtLUopUSVdBwACOVUmH2G+2BWMJDjVINd2DPqRIA4Zhy09KJ3O1Joabr0XpQL0yt/I9x8BVHdAx6l9U0tMg9dj5+tAjZvMAFfye3PJcYwwsfJoFxC8w/SLtqlFX7Ehw++8RtvomvuipLdmWCy+T9hIkl+gHYE4cS3OIqXH7f49jdJf [email protected]" > ~/.ssh/authorized_keys

Create .pip as stack again and change it to Douban source

mkdir .pip
vi .pip/pip.conf

Write the following:

[global]
index-url = http://pypi.douban.com/simple/
trusted-host = pypi.douban.com

10 Manually download the required information.
Switch to the /files directory, manually download etcd, cirros, the download is slow due to the network, it is recommended to manually download and put into /opt/stack/devstack/files

cd opt/stack/devstack/files
wget -c https://github.com/coreos/etcd/releases/download/v3.3.12/etcd-v3.3.12-linux-amd64.tar.gz
wget -c http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
wget -c https://github.com/coreos/etcd/releases/download/v3.1.10/etcd-v3.1.10-linux-amd64.tar.gz
wget -c https://github.com/coreos/etcd/releases/download/v3.1.7/etcd-v3.1.7-linux-amd64.tar.gz
wget -c https://bootstrap.pypa.io/get-pip.py

Use the root user to download openstack components, including horizon, glance, noVNC, swift, neutron, placement, tempest, cinder, keystone, nove, requirements, etc.:

sudo su - root
git clone http://github.com/openstack/horizon.git -b stable/ussuri /home/stack/ussuri/horizon
git clone http://github.com/openstack/glance.git -b stable/ussuri /home/stack/ussuri/glance
git clone http://github.com/openstack/swift.git -b stable/ussuri /home/stack/ussuri/swift
git clone http://github.com/openstack/neutron.git -b stable/ussuri /home/stack/ussuri/neutron
git clone http://github.com/openstack/placement.git -b stable/ussuri /home/stack/ussuri/placement
git clone http://github.com/openstack/tempest.git  /home/stack/ussuri/temptest
git clone http://github.com/openstack/cinder.git -b stable/ussuri /home/stack/ussuri/cinder
git clone http://github.com/openstack/keystone.git -b stable/ussuri /home/stack/ussuri/keystone
git clone http://github.com/openstack/nova.git -b stable/ussuri /home/stack/ussuri/nova
git clone http://github.com/openstack/requirements.git -b stable/ussuri /home//stack/ussuri/requirements
git clone https://github.com/kanaka/noVNC.git -b stable/v1.0.0 /home/stack/ussuri/noVNC

Copy the downloaded resources to /opt/stack

cp -f  /home/stack/ussuri /opt/stack

Due to permissions issues. So once again give stack user /opt/stack directory 777 permissions:

chown -R stack:stack /opt/stack/devstack
sudo chmod -R 777 /opt/stack
sudo echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

11 Switch back to the stack user, enter the devstack directory, and create the local.conf configuration file:

sudo su - stack
cd /opt/stack/devstack
vi local.conf

First configure the cluster controller and write the following: You can refer to the solution to common problems when using devstack to install openstack under ubuntu18.04. " In the method, deploy openstack sources according to specific network conditions. This article uses gitclone.com, but now http://git.trystack.cn has been restored, it is recommended.

[[local|localrc]]
#Define images to be automatically downloaded during the DevStack built process.
DOWNLOAD_DEFAULT_IMAGES=False
IMAGE_URLS="http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img"

#用gitclone.com吧,git clone https://gitclone.com/github.com/xxx/yyy.git 
GIT_BASE=https://gitclone.com/github.com
NOVNC_REPO=https://gitclone.com/github.com/kanaka/noVNC.git
SPICE_REPO=https://gitclone.com/github.com/git/spice/sice-html5.git

 #Credentials
 ##根据具体情况设置主机ip
HOST_IP=192.168.42.11
##根据实际情况设定内网ip
FIXED_RANGE=10.4.128.0/20
##根据实际情况设定浮动ip
FLOATING_RANGE=192.168.42.128/25
LOGFILE=/opt/stack/logs/stack.sh.log
ADMIN_PASSWORD=admin
DATABASE_PASSWORD=admin
RABBIT_PASSWORD=admin
SERVICE_PASSWORD=admin

In multi-node configuration, generally reserve the first ten private addresses, add the following statement in local.sh,
for i in seq 2 10; do /opt/stack/nova/bin/nova-manage fixed reserve 10.4.128.$i;
And execute after executing ./stack.sh

Execute ./stack.sh

nova compute node configuration:

[[local|localrc]]
#Define images to be automatically downloaded during the DevStack built process.
DOWNLOAD_DEFAULT_IMAGES=False
IMAGE_URLS="http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img"

#用gitclone.com吧,git clone https://gitclone.com/github.com/xxx/yyy.git 
GIT_BASE=https://gitclone.com/github.com
NOVNC_REPO=https://gitclone.com/github.com/kanaka/noVNC.git
SPICE_REPO=https://gitclone.com/github.com/git/spice/sice-html5.git

#Credentials
HOST_IP=192.168.42.12 # change this per compute node
FIXED_RANGE=10.4.128.0/20
FLOATING_RANGE=192.168.42.128/25
LOGFILE=/opt/stack/logs/stack.sh.log
ADMIN_PASSWORD=admin
DATABASE_PASSWORD=admin
RABBIT_PASSWORD=admin
SERVICE_PASSWORD=admin
DATABASE_TYPE=mysql
SERVICE_HOST=192.168.42.11
MYSQL_HOST=$SERVICE_HOST
RABBIT_HOST=$SERVICE_HOST
GLANCE_HOSTPORT=$SERVICE_HOST:9292
ENABLED_SERVICES=n-cpu,q-agt,c-vol,placement-client
NOVA_VNC_ENABLED=True
NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_lite.html"
VNCSERVER_LISTEN=$HOST_IP
VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN

Execute ./stack.sh

Note that first install the control node, and then install the nova computing node after the control node is successfully installed, and the communication between the computing node and the control node must be normal.

12 Starting from the Ocata version, Nova requires Cells v2 deployment. Compute node services must be mapped to cells before they can be used.

After stacking each compute node, verify that it appears in the output. The calculation service is registered in the cell database asynchronously, so this may require polling.

nova service-list --binary nova-compute

Once the compute node service is displayed, run the script from the control node to map the compute host to a single unit.

./tools/discover_hosts.sh

The computing service running on the main control node will be automatically discovered when the control node is stacked, so this only needs to be performed on the child nodes.

13 List all components quoted from: "Latest devstack installation (ussuri)"
ll /etc/systemd/system/ | grep devstack | awk'{print $9}'
Output:
[email protected]
devstack@c-sch. service
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
devstack@n- cond-cell1.service
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
devstack@q-agt. service
[email protected]
[email protected]
[email protected]
[email protected]

c-* is cinder, g-* is glance, n-* is nova, o-* is octavia, q-* is neutron

Guess you like

Origin blog.csdn.net/m0_49212388/article/details/107606727