Use Devstack to install the latest version of single-node Openstack under Ubuntu 18.04Lts

The official installation manual: https://docs.openstack.org/devstack/latest/ , since the sources of the official version are all foreign and the network delay is large, there are many problems during the installation process and need to be replaced with domestic sources.

In addition, openstack relies heavily on the devstack version. After testing, please use the latest version of openstack to install openstack.

This article is a single-node installation, if it is a multi-node, the main difference is local.conf.

 

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 upgrade –y

 

4 Set time zone:

 

dp kg-reconfigure tzdata
select Asia -> select Shanghai -> OK

 

Synchronization time command:

sudo apt-get install ntpdate // install the time synchronization tool
sudo ntpdate  cn.pool.ntp.org  // synchronize the time with the network server
date // check whether the time is synchronized

After syncing

reboot

 

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

 

Upgrade pip, other: (when installing the latest u version or later, you don’t need to install it, because openstack after u version has cancelled the support for python2.7, and python3.6 will be automatically installed in the devstack script)

 

apt install python-pip
pip install --upgrade pip
pip install -U os-testr

 

pip –V

Check the installed pip version, it is now 20.1.1

 

6 Download devstack, the directory here is ~, and the download is the latest version. I started to specify the stein version, but after repeated installation, it was found that the installation was unsuccessful due to the inconsistency of the versions of devstack and openstack and the dependency on the python pip version. It is recommended to download the latest version of devstack directly according to the official documentation.

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

 

Note 1

 

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 Enter the devstack directory and create the local.conf configuration file:

cd devstack

vi local.conf

Write the following:

[[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"

 

# use TryStack git mirror But now the trystack.cn website seems to have just hung up. . .

# GIT_BASE=http://git.trystack.cn

# NOVNC_REPO = http: //git.trystack.cn/kanaka/noVNC.git

# SPICE_REPO=http://git.trystack.cn/git/spice/sice-html5.git

# use github mirror But now the trystack.cn website seems to have just hung up. . .

#Use 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

DATABASE_PASSWORD=admin

ADMIN_PASSWORD=admin

SERVICE_PASSWORD=admin

SERVICE_TOKEN=admin

RABBIT_PASSWORD=admin

#FLAT_INTERFACE=enp0s3

 

HOST_IP=***.***.***.***

 

enable_service placement-api
enable_service placement-client

 

Note: ***.***.***.***=server or virtual host ip. Use "sudo ifconfig -a" to query

 

11 Switch to the /files directory and manually download etcd and cirros. The download is slow due to the network. It is recommended to manually download and put into /opt/stack/devstack/files

cd 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

 

12 Go back to the /opt/stack/devstack directory:

 

cd /opt/stack/devstack
 

To start the formal installation, it is recommended that you do not use putty in the novice stage, but use the stack account on the server and remotely log in with putty. Putty hangs due to too many messages and you do not know whether the installation is successful:

 

./stack.sh
 

If all goes well without error, the whole process will last 30-60 minutes according to the network speed.

After the installation is successful, there will be a similar display:https://images2017.cnblogs.com/blog/739632/201801/739632-20180116224009740-403046422.png

 

 

 

After the installation is successful, enter in the browser: Server IP address/dashboard

https://forum.huawei.com/enterprise/zh/data/attachment/forum/202002/19/105009bzmkmpci6u9kkpmk.png

 

If you encounter other errors, mainly check local.conf , and then clean up the last misconfiguration./unstack.sh and clean.sh , and then execute the ./stack.sh configuration and wait for completion. If you encounter a timeout error, directly execute again./stack.sh

 

 

This article refers to the following articles, thank you.

https://forum.huawei.com/enterprise/zh/thread-602016.html

https://blog.csdn.net/hunjiancuo5340/article/details/85005995?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase

https://www.cnblogs.com/love9527/p/8298959.html

https://blog.csdn.net/qiqishuang/article/details/51990662

 

Note 1: (The following is a description of the devstack and openstack versions, which is very instructive:

 

By default, both Devstack and OpenStack use Master's code for installation. This often happens. The installation is successful today, and it fails tomorrow, and the code changes all the time. So we not only need to specify the version of OpenStack, but also the version of Devstack to provide the probability of successful installation.

 

apt-get install git 

git clone http://git.trystack.cn/openstack-dev/devstack.git -b stable/mitaka 

or

$git clone https://github.com/openstack-dev/devstack.git #Clone devstack's Git code repository 

cd devstack /

git branch -a #Display local branch 

git checkout -b mitaka origin/stable/mitaka #Switch to the specified mitaka branch or label)

Guess you like

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