kolla-ansible 部署openstack train 版本(all-in-one)fail

零 修订记录

序号 修订内容 修订时间
1 新增 20210331

一 摘要

本文介绍kolla-ansible 部署openstack train 版本,并把相关资源下载到本地。

二 环境信息

(一)软件信息

2.1.1 操作系统

阿里云虚机

[root@openstack-train ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
[root@openstack-train ~]#

2.1.2 kolla 相关

2.1.3 ansible

2.1.4 docker

2.1.5

三 实施

(零) 准备工作

3.0.1关闭防火墙

[root@openstack-train ~]# systemctl stop firewalld
[root@openstack-train ~]# systemctl disable firewalld
[root@openstack-train ~]#

3.0.2 永久关闭selinux

[root@openstack-train sysconfig]# cp selinux selinux.bak.orig
[root@openstack-train sysconfig]# vim selinux
[root@openstack-train sysconfig]# pwd
/etc/sysconfig
[root@openstack-train sysconfig]#

主要修改此处

SELINUX=disabled

重启服务器

(一) 安装docker

3.1.1 安装基础工具yum-utils

首先下载到本地,为以后离线安装准备

[root@openstack-train basetools]# yum install --downloadonly --downloaddir=/root/train/basetools  yum-utils

安装

[root@openstack-train sysconfig]# yum localinstall /root/train/basetools/*.rpm


3.1.2 配置docker 源

[root@openstack-train basetools]#  yum-config-manager  --add-repo  https://download.docker.com/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
[root@openstack-train basetools]#

3.1.3 下载docker

[root@openstack-train basetools]# yum install --downloadonly --downloaddir=/root/train/docker  docker-ce
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

3.1.4 docker包安装

[root@openstack-train docker]# yum localinstall /root/train/docker/*.rpm
Loaded plugins: fastestmirror
Examining /root/train/docker/audit-2.8.5-4.el7.x86_64.rpm: audit-2.8.5-4.el7.x86_64

3.1.5 设置docker 开机启动

[root@openstack-train docker]# systemctl restart docker && systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@openstack-train docker]#

3.1.6 检查docker 状态

[root@openstack-train docker]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2021-03-31 17:07:16 CST; 31s ago
     Docs: https://docs.docker.com
 Main PID: 11832 (dockerd)
   CGroup: /system.slice/docker.service
           └─11832 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Mar 31 17:07:16 openstack-train dockerd[11832]: time="2021-03-31T17:07:16.426967917+08:00" level=info msg="scheme \"unix\" not regis...le=grpc
Mar 31 17:07:16 openstack-train dockerd[11832]: time="2021-03-31T17:07:16.426987845+08:00" level=info msg="ccResolverWrapper: sendin...le=grpc
Mar 31 17:07:16 openstack-train dockerd[11832]: time="2021-03-31T17:07:16.427006344+08:00" level=info msg="ClientConn switching bala...le=grpc
Mar 31 17:07:16 openstack-train dockerd[11832]: time="2021-03-31T17:07:16.451697517+08:00" level=info msg="Loading containers: start."
Mar 31 17:07:16 openstack-train dockerd[11832]: time="2021-03-31T17:07:16.570283105+08:00" level=info msg="Default bridge (docker0) ...ddress"
Mar 31 17:07:16 openstack-train dockerd[11832]: time="2021-03-31T17:07:16.614769485+08:00" level=info msg="Loading containers: done."
Mar 31 17:07:16 openstack-train dockerd[11832]: time="2021-03-31T17:07:16.630210996+08:00" level=info msg="Docker daemon" commit=363...20.10.5
Mar 31 17:07:16 openstack-train dockerd[11832]: time="2021-03-31T17:07:16.630294319+08:00" level=info msg="Daemon has completed init...zation"
Mar 31 17:07:16 openstack-train systemd[1]: Started Docker Application Container Engine.
Mar 31 17:07:16 openstack-train dockerd[11832]: time="2021-03-31T17:07:16.654673417+08:00" level=info msg="API listen on /var/run/docker.sock"
Hint: Some lines were ellipsized, use -l to show in full.
[root@openstack-train docker]# docker --version
Docker version 20.10.5, build 55c4c88
[root@openstack-train docker]#

(二) 安装基础依赖

3.2.1 下载

[root@openstack-train docker]# yum install --downloadonly --downloaddir=/root/train/basedependencies python-devel libffi-devel gcc openssl-devel libselinux-python git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies

3.2.2 安装

[root@openstack-train basedependencies]# yum localinstall /root/train/basedependencies/*.rpm
Loaded plugins: fastestmirror
Examining /root/train/basedependencies/cpp-4.8.5-44.el7.x86_64.rpm: cpp-4.8.5-44.el7.x86_64
Marking /root/train/basedependencies/cpp-4.8.5-44.el7.x86_64.rpm as an update to cpp-4.8.5-36.el7_6.2.x86_64

(三)安装Python virtual environments (需调整)

3.3.1离线下载

[root@openstack-train local]# yum install --downloadonly --downloaddir=/root/train/pythonvirtualenv  python-virtualenv
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check

3.3.2 安装

[root@openstack-train local]# yum localinstall /root/train/pythonvirtualenv/*.rpm
Loaded plugins: fastestmirror
Examining /root/train/pythonvirtualenv/python-backports-1.0-8.el7.x86_64.rpm: python-backports-1.0-8.el7.x86_64
Marking /root/train/pythonvirtualenv/python-backports-1.0-8.el7.x86_64.rpm to be installed

3.3.3 Create a virtual environment and activate it

[root@openstack-train local]# virtualenv /path/to/virtualenv
New python executable in /path/to/virtualenv/bin/python
Please make sure you remove any previous custom paths from your /root/.pydistutils.cfg file.
Installing setuptools, pip, wheel...done.
[root@openstack-train local]# source /path/to/virtualenv/bin/activate
(virtualenv) [root@openstack-train local]# pip -v

3.3.3 pip 升级

3.3.3.1 下载升级包

(virtualenv) [root@openstack-train local]# pip download -i https://pypi.tuna.tsinghua.edu.cn/simple -d /root/train/pythonpip/pipupgrade pip
Collecting pip
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl (1.5MB)
    100% |████████████████████████████████| 1.5MB 866kB/s
  Saved /root/train/pythonpip/pipupgrade/pip-20.3.4-py2.py3-none-any.whl
Successfully downloaded pip
You are using pip version 9.0.1, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(virtualenv) [root@openstack-train local]#

3.3.3.2 安装

(virtualenv) [root@openstack-train local]# ll /root/train/pythonpip/pipupgrade/
total 1488
-rw-r--r-- 1 root root 1522101 Mar 31 17:41 pip-20.3.4-py2.py3-none-any.whl
(virtualenv) [root@openstack-train local]# pip install --no-index --find-links=/root/train/pythonpip/pipupgrade pip==20.3.4
Collecting pip==20.3.4
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-20.3.4
(virtualenv) [root@openstack-train local]# pip -V
pip 20.3.4 from /path/to/virtualenv/lib/python2.7/site-packages/pip (python 2.7)
(virtualenv) [root@openstack-train local]#


安装python36

[root@openstack-train train]# yum install --downloadonly --downloaddir=/root/train/python36 python36 python36-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package python3.x86_64 0:3.6.8-18.el7 will be installed

[root@openstack-train python36]# yum localinstall /root/train/python36/*.rpm
Loaded plugins: fastestmirror
Examining /root/train/python36/dwz-0.11-3.el7.x86_64.rpm: dwz-0.11-3.el7.x86_64
Marking /root/train/python36/dwz-0.11-3.el7.x86_64.rpm to be installed
[root@openstack-train python36]# python3 -V
Python 3.6.8
[root@openstack-train python36]#

[root@openstack-train python36]# pip3 -V
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)
[root@openstack-train python36]#

(四)安装ansible

3.4.1 下载离线版

Currently, Kolla Ansible requires Ansible 2.6 to 2.9.
[root@openstack-train ~]# yum install --downloadonly --downloaddir=/root/train/ansible ansible
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package ansible.noarch 0:2.9.18-1.el7 will be installed
--> Processing Dependency: PyYAML for package: ansible-2.9.18-1.el7.noarch

3.4.2 使用离线版安装

使用下载到本地的 包安装

[root@openstack-train ~]# yum localinstall /root/train/ansible/*.rpm
Loaded plugins: fastestmirror
Examining /root/train/ansible/ansible-2.9.18-1.el7.noarch.rpm: ansible-2.9.18-1.el7.noarch

3.4.3 修改配置

[root@openstack-train ~]# cd /etc/ansible/
[root@openstack-train ansible]# ll
total 28
-rw-r--r-- 1 root root 19985 Feb 21 05:33 ansible.cfg
-rw-r--r-- 1 root root  1016 Feb 21 05:33 hosts
drwxr-xr-x 2 root root  4096 Feb 21 05:33 roles
[root@openstack-train ansible]# cp ansible.cfg  ansible.cfg.bak.orig
[root@openstack-train ansible]# vim ansible.cfg


[defaults]

inventory  = $HOME/ansible/hosts
host_key_checking=False
pipelining=True
forks=10

安装python3 并修改默认pip python 软链接

[root@openstack-train pipupgrade]# ln -s /bin/pip3.6 /bin/pip
ln: failed to create symbolic link ‘/bin/pip’: File exists
[root@openstack-train pipupgrade]# rm /bin/pip
rm: remove regular file ‘/bin/pip’? y
[root@openstack-train pipupgrade]# ln -s /bin/pip3.6 /bin/pip
[root@openstack-train pipupgrade]#

[root@openstack-train pipupgrade]#  ln -s /usr/bin/python3 /usr/bin/python
ln: failed to create symbolic link ‘/usr/bin/python’: File exists
[root@openstack-train pipupgrade]# rm /usr/bin/python
rm: remove symbolic link ‘/usr/bin/python’? y
[root@openstack-train pipupgrade]#  ln -s /usr/bin/python3 /usr/bin/python
[root@openstack-train pipupgrade]#

修改/usr/bin/yum文件


[root@openstack-train pipupgrade]# cp /usr/bin/yum /usr/bin/yum.bak.orig
[root@openstack-train pipupgrade]# vim /usr/bin/yum
修改第一行即可

#!/usr/bin/python2.7

修改/usr/libexec/urlgrabber-ext-down文件

[root@openstack-train libexec]# cp /usr/libexec/urlgrabber-ext-down /usr/libexec/urlgrabber-ext-down.bak.orig
[root@openstack-train libexec]# vim /usr/libexec/urlgrabber-ext-down
[root@openstack-train libexec]#

修改第一句即可
#! /usr/bin/python2.7

[root@openstack-train libexec]# pip -V
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)
[root@openstack-train libexec]# python -V
Python 3.6.8
[root@openstack-train libexec]#

(五) pip3安装kolla

3.5.1下载kolla

将下载好的kolla 上传到/root/train/kolla并解压。

[root@openstack-train kolla]# ll
total 684
drwxr-xr-x 13 root root   4096 Jan 27 04:35 kolla-9.3.1
-rw-r--r--  1 root root 696121 Mar 31 18:19 kolla-9.3.1.zip
[root@openstack-train kolla]# pwd
/root/train/kolla
[root@openstack-train kolla]#

3.5.2 下载kolla 依赖包

[root@openstack-train python36]# pip download -i https://pypi.tuna.tsinghua.edu.cn/simple -d /root/train/kolla/kollapip  -r  /root/train/kolla/kolla-9.3.1/requirements.txt
Ignoring GitPython: markers 'python_version < "3.0"' don't match your environment
Collecting pbr!=2.1.0,>=2.0.0 (from -r /root/train/kolla/kolla-9.3.1/requirements.txt (line 4))

3.5.3 本地包安装kolla

[root@openstack-train kolla-9.3.1]# pip install /root/train/kolla/kolla-9.3.1 --no-index --find-links=/root/train/kolla/kollapip

[root@openstack-train kolla-9.3.1]# kolla-build --version
0.0.0
[root@openstack-train kolla-9.3.1]#

(六) 安装kolla-ansible

3.6.1 下载kolla-ansible 并上传到服务器

[root@openstack-train kollaansible]# pwd
/root/train/kollaansible
[root@openstack-train kollaansible]# ll
total 1692
drwxr-xr-x 13 root root    4096 Jan 24 20:20 kolla-ansible-9.3.1
-rw-r--r--  1 root root 1728164 Apr  1 09:24 kolla-ansible-9.3.1.zip
[root@openstack-train kollaansible]#

pip 升级了

  pip download -i https://pypi.tuna.tsinghua.edu.cn/simple -d /root/train/pythonpip3/pip3upgrade pip==21.0.1
  
  pip install --no-index --find-links=/root/train/pythonpip3/pip3upgrade pip==21.0.1

3.6.2 下载kolla-ansible 依赖包

python -m pip download -i https://pypi.tuna.tsinghua.edu.cn/simple -d  /root/train/kollaansible/kollaansiblepip  -r  /root/train/kollaansible/kolla-ansible-9.3.1/requirements.txt

3.6.3 安装

git init


  python -m pip install /root/train/kollaansible/kolla-ansible-9.3.1 --no-index --find-links=/root/train/kollaansible/kollaansiblepip

posted on 2021-03-31 17:45  weiwei2021  阅读(350)  评论(0编辑  收藏  举报