kolla-build镜像时,问题汇总
记录下kolla-build镜像时,遇到的一些问题,既为了方便自己以后问题的查找,也为了帮助别人避免踩这些坑。遇到的问题会持续更新在博客里面。
问题1:使用的kolla 版本是ocata版本,本地已经搭建好yum源,并且在以前制作镜像的时候,一直是好的,今天再次编译镜像,一直报如下的错误
INFO:kolla.image.build.base:---> Package pciutils-libs.x86_64 0:3.5.1-3.el7 will be installed
INFO:kolla.image.build.base:---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed
INFO:kolla.image.build.base:---> Package perl-parent.noarch 1:0.225-244.el7 will be installed
INFO:kolla.image.build.base:---> Package sysvinit-tools.x86_64 0:2.88-14.dsf.el7 will be installed
INFO:kolla.image.build.base:--> Finished Dependency Resolution
INFO:kolla.image.build.base:Error: Package: 7:device-mapper-event-1.02.146-4.el7.x86_64 (base)
INFO:kolla.image.build.base: Requires: device-mapper = 7:1.02.146-4.el7
INFO:kolla.image.build.base: Installed: 7:device-mapper-1.02.149-10.el7_6.2.x86_64 (@Updates)
INFO:kolla.image.build.base: device-mapper = 7:1.02.149-10.el7_6.2
INFO:kolla.image.build.base: Available: 7:device-mapper-1.02.146-4.el7.x86_64 (base)
INFO:kolla.image.build.base: device-mapper = 7:1.02.146-4.el7
INFO:kolla.image.build.base:
INFO:kolla.image.build.base: You could try using --skip-broken to work around the problem
INFO:kolla.image.build.base: You could try running: rpm -Va --nofiles --nodigest
原因分析:遇到这个问题的时候,一开始以为自己的yun源出现了问题,所以去本地yum源里面去查找是否有device-mapper-event-1.02.146-4.el7.x86_64这个rpm包,在base/update里面,检查了一遍都存在这个包。后来怀疑是centos基础镜像有问题,就使用docker run -it centos启动了一个容器,在容器里面使用rpm -qa |grep device命令查看的时候,发现系统里面安装了device-mapper-1.02.149-10.el7_6.2.x86_64。kolla build编译进行需要的是device-mapper-event-1.02.146-4.el7.x86_64这个rpm包,但是系统已经安装了149的版本,造成了这种问题。处理方式时,幸亏以前搭建的kolla build服务器还在,把对应的centos基础镜像拷贝过来,导入到该环境里,启动一个容器以后,再次检查他的devcie相关包,发现确实是146的版本,所以以前的编译没有问题。
[root@localhost base]# docker run -it 75835a67d134 /bin/bash
[root@730fd71696a2 /]# rpm -qa |grep device
device-mapper-1.02.146-4.el7.x86_64
device-mapper-libs-1.02.146-4.el7.x86_64
[root@730fd71696a2 /]#
导入基础centos镜像以后,在编译镜像时,使用特定的私有仓库中的基础镜像
kolla-build -b centos --base-tag 7 --base-image 172.19.146.34:5001/centos/centos --tag ocata --type source keystone
问题的根因是kolla-build -b centos --base-tag 7 --tag ocata --type source keystone命令行执行的时候,每次都去官网拉去一遍centos基础镜像,再进行下一步的操作。而官网的centos基础镜像几乎每天都有新的rpm更新,导致与本地的yum源不匹配,造成异常
教训:在kolla-build镜像的时候,搭建自己的yum源,并且成功编译出镜像时,一定要把基础镜像保存一份,以后一直用这个基础镜像,否则一直拉取官网的最新镜像,在编译openstack镜像时,会造成各种异常的情况,并且一直更新yum源也很费事
问题2:kolla-ansible -i ./all-in-one pull 编译的镜像时,一直提示如下的错误
TASK [common : include] *******************************************************************************************************************************
included: /usr/share/kolla-ansible/ansible/roles/common/tasks/bootstrap.yml for localhost TASK [common : Creating log volume] *****************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "msg": "'Traceback (most recent call last):\\n
File \"/tmp/ansible_7mwoMR/ansible_module_kolla_docker.py\", line 802, in main\\n dw = DockerWorker(module)\\n
File \"/tmp/ansible_7mwoMR/ansible_module_kolla_docker.py\", line 221, in __init__\\n self.dc = get_docker_client()(**options)\\n
File \"/usr/lib/python2.7/site-packages/docker/client.py\", line 99, in __init__\\n self._version = self._retrieve_server_version()\\n
File \"/usr/lib/python2.7/site-packages/docker/client.py\", line 124, in _retrieve_server_version\\n
\\'Error while fetching server API version: {0}\\'.format(e)\\n
DockerException: Error while fetching server API version: Timeout value connect was Timeout(connect=60, read=60, total=None),
but it must be an int, float or None.\\n'"}
to retry, use: --limit @/usr/share/kolla-ansible/ansible/site.retry PLAY RECAP *******************************************************************************************************************************************
localhost : ok=19 changed=8 unreachable=0 failed=1
原因分析:第一次拉取不管是官方镜像还是自己源码编译的镜像,都能成功的部署起来,但是执行命令kolla-ansible destroy --include-images --yes-i-really-really-mean-it把
部署的容器和缓存的镜像去掉,重新部署的时候,一直报以前的错误。后来谷歌了一下,是requests版本太高的问题。方法是把requests的版本降到requests==2.17.3就可以了
过程如下:
[root@controller ~]# pip list |grep requests
requests 2.19.1
requestsexceptions 1.4.0
[root@controller ~]#
[root@controller ~]# pip uninstall requests
Uninstalling requests-2.19.1:
Would remove:
/usr/lib/python2.7/site-packages/requests-2.19.1.dist-info/*
/usr/lib/python2.7/site-packages/requests/*
Would not remove (might be manually added):
/usr/lib/python2.7/site-packages/requests/packages/__init__.py
/usr/lib/python2.7/site-packages/requests/packages/__init__.pyo
Proceed (y/n)? y
Successfully uninstalled requests-2.19.1
[root@controller ~]#
[root@controller ~]# pip install requests==2.17.3
备注:requests 2.18.xx 系列也有这个问题,为了保险起见,最好直接使用requests==2.17.3或者使用2.20.1
[root@localhost ~]# pip list |grep requests
requests 2.20.1
requestsexceptions 1.4.0
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# python
Python 2.7.5 (default, Jul 13 2018, 13:06:57)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker
>>> c = docker.Client(base_url='unix://var/run/docker.sock', version='1.15', timeout=2.0)
>>> l = c.containers(all=True)
>>> quit()
[root@localhost ~]#
问题3:kolla-ansible部署完以后,执行openstack 命令报如下错误
[root@controller ~]# source /etc/kolla/admin-openrc.sh
[root@controller ~]# openstack service list
Traceback (most recent call last):
File "/usr/bin/openstack", line 7, in <module>
from openstackclient.shell import main
File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 23, in <module>
from osc_lib import shell
File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 33, in <module>
from osc_lib.cli import client_config as cloud_config
File "/usr/lib/python2.7/site-packages/osc_lib/cli/client_config.py", line 18, in <module>
from openstack.config import exceptions as sdk_exceptions
File "/usr/lib/python2.7/site-packages/openstack/__init__.py", line 17, in <module>
import openstack.connection
File "/usr/lib/python2.7/site-packages/openstack/connection.py", line 166, in <module>
from openstack import cloud as _cloud
File "/usr/lib/python2.7/site-packages/openstack/cloud/__init__.py", line 20, in <module>
from openstack.cloud.openstackcloud import OpenStackCloud
File "/usr/lib/python2.7/site-packages/openstack/cloud/openstackcloud.py", line 49, in <module>
from openstack.cloud import _utils
File "/usr/lib/python2.7/site-packages/openstack/cloud/_utils.py", line 28, in <module>
from decorator import decorator
ImportError: No module named decorator
原因是 decorator包为3.4.0版本太低,导致,升级完以后,就没有问题了
[root@controller ~]# pip list |grep decorator
decorator 3.4.0
[root@controller ~]# pip install -U decorator
Looking in indexes: http://172.19.146.225:8081/
Collecting decorator
Downloading http://172.19.146.225:8081/packages/decorator-4.3.0-py2.py3-none-any.whl
Installing collected packages: decorator
Found existing installation: decorator 3.4.0
Uninstalling decorator-3.4.0:
Successfully uninstalled decorator-3.4.0
Successfully installed decorator-4.3.0
问题4:kolla-ansible部署完以后,执行openstack 命令报如下错误
Traceback (most recent call last):
File "/usr/bin/openstack", line 7, in <module>
from openstackclient.shell import main
File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 22, in <module>
from osc_lib.api import auth
File "/usr/lib/python2.7/site-packages/osc_lib/api/auth.py", line 22, in <module>
from osc_lib.i18n import _
File "/usr/lib/python2.7/site-packages/osc_lib/i18n.py", line 16, in <module>
import oslo_i18n
File "/usr/lib/python2.7/site-packages/oslo_i18n/__init__.py", line 14, in <module>
from ._gettextutils import *
File "/usr/lib/python2.7/site-packages/oslo_i18n/_gettextutils.py", line 24, in <module>
from babel import localedata
ImportError: No module named babel
原因是babel包 为2.3.4版本太低导致,升级完包以后,就可以了
[root@controller ~]# pip unintall Babel
[root@controller ~]# pip install Babel
Looking in indexes: http://172.19.146.50:8081/
Requirement already satisfied: Babel in /usr/lib/python2.7/site-packages (2.3.4)
Requirement already satisfied: pytz in /usr/lib/python2.7/site-packages (from Babel) (2016.10)
[root@controller ~]# pip install Babel==2.6.0
Looking in indexes: http://172.19.146.50:8081/
Collecting Babel==2.6.0
问题5:有时升级包时出现如下错误
[root@controller ~]# pip install -U wrapt
Looking in indexes: http://172.19.146.225:8081/simple/
Collecting wrapt
Downloading http://172.19.146.225:8081/packages/simple/wrapt/wrapt-1.10.11.tar.gz
Installing collected packages: wrapt
Found existing installation: wrapt 1.10.8
Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to
only a partial uninstall.
解决方法:
[root@controller ~]# pip install --ignore-installed -U wrapt
Looking in indexes: http://172.19.146.225:8081/simple/
Collecting wrapt
Downloading http://172.19.146.225:8081/packages/simple/wrapt/wrapt-1.10.11.tar.gz
Installing collected packages: wrapt
Running setup.py install for wrapt ... done
Successfully installed wrapt-1.10.11
[root@controller ~]#
kolla-build镜像时,问题汇总的更多相关文章
- 树莓派及其他硬件平台国内外Linux镜像站全汇总
转载至segmentfault. 本文收集整理国内对于Raspberry Pi.CubieBoard.pcDuino等各种Linux开源硬件平台,所使用的Raspbian.Arch Linux ARM ...
- 快速解决docker生成镜像时提示Could not resolve ‘archive.ubuntu.com’问题
今天在其中一台Linux 中使用Docker命令创建镜像时失败,报错提示: Temporary failure resolving ‘archive.ubuntu.com’ 典型的DNS解析问题,尝试 ...
- howto:在构建基于debian的docker基础镜像时,更换国内包源
debian经常被用作构建应用镜像的基础镜像,如微软在构建linux下的dotnetcore基础镜像时,提供了基于debian 8(jessie)和debian 9(stretch)的镜像. 由于这些 ...
- Linux上通过MySQL命令访问MySQL数据库时常见问题汇总
Linux上通过mysql命令访问MySQL数据库时常见问题汇总 1)创建登录账号 #创建用户并授权 #允许本地访问 create user 'test'@'localhost' identified ...
- docker 执行 docker system prune 导致Azure Devops build镜像失败
运行docker的centos上, 只分配了16G的空间, 装了个mysql, 还有个rancher, 就只剩下2G的空间了, Azure Devops build镜像就出错了, 显示存储空间不足, ...
- 使用dockerfile文件创建镜像时docker build没有反应
问题: 先 docker pull centos:7 拉取了一个官方的基础镜像,为后续创建jdk8镜像做准备,在创建如下的dockerfile文件 执行docker build -t jdk_8u19 ...
- Gradle Build速度加快方法汇总
Android Studio用起来越来越顺手,但是却发现Build的速度实在不敢恭维,在google和度娘了几把(....)之后,大体就是分配更高的内存,步骤:Setting-->搜索gradl ...
- kolla出现问题时的定位方式
前提,对官网问题的一个翻译 Troubleshooting Guide排障手册 1.Failures(失败) If Kolla fails, often it is caused by a CTRL- ...
- # 构建以及运行Springboot Docker镜像时的变量传递
Docker可以把我们的运行环境打包,然后我们只要run就可以了.大部分hello world都是这么写的.但都缺少了实际应用环节.以springboot为例,hello world的Dockerfi ...
随机推荐
- boost1_55_0编译和安装
1.在www.boost.org下载文件并解压 2.进行解压目录 2.1 编译前的配置工作 执行bootstrap.bat windows 使用vs2010: 修改\boost_1_55_0\too ...
- 机器学习:多项式回归(scikit-learn中的多项式回归和 Pipeline)
一.scikit-learn 中的多项式回归 1)实例过程 模拟数据 import numpy as np import matplotlib.pyplot as plt x = np.random. ...
- 2018年长沙理工大学第十三届程序设计竞赛 J杯子
链接:https://www.nowcoder.com/acm/contest/96/J来源:牛客网 杯子 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言655 ...
- L2-002. 链表去重(map结构体,精彩的代码)
链表去重 时间限制 300 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 给定一个带整数键值的单链表L,本题要求你编写程序,删除那些键值的绝对值 ...
- c语言-单链表(二)
继续复习链表知识点,本章包含单链表的增加,删除,判断是否为空,和链表长度,以及链表的排序 几个知识点 1.链表的判断是否为空 //1.判断链表是否为空 bool isempty_list(PNODE ...
- Celery-4.1 用户指南: Monitoring and Management Guide (监测和管理指南)
简介 Celery 提供了监控和探查celery集群的工具. 这篇文档描述了一些工具,以及与监控相关的一些特性,例如事件和广播命令. 工作单元 命令行管理工具(inspect/control) Cel ...
- Oracle中REGEXP_SUBSTR函数(字符串转多行)
Oracle中REGEXP_SUBSTR函数 Oracle中REGEXP_SUBSTR函数的使用说明: 题目如下: 在oracle中,使用一条语句实现将'17,20,23'拆分成'17','20',' ...
- sqlserver 查询int类型 in (字符串) 报转换int类型出错的问题
, , '') ) AS c_departNames FROM t_user AS A LEFT JOIN t_role AS B ON A.c_roleId=B.c_roleId 用 CHARIND ...
- cf688B-Lovely Palindromes
http://codeforces.com/problemset/problem/688/B B. Lovely Palindromes time limit per test 1 second me ...
- Linux 大页面使用与实现简介(转)
引言 随着计算需求规模的不断增大,应用程序对内存的需求也越来越大.为了实现虚拟内存管理机制,操作系统对内存实行分页管理.自内存“分页机制”提出之始,内存页面的默认大小便被设置为 4096 字节(4KB ...