kolla-ansible部署openstack allinone单节点

摘要:
环境准备2networkinterfaces8GBmainmemory40GBdiskspace1.修改hostnamehostnamectlset-hostnamekolla2.配置域名解析echo'10.1.10.161kolla'˃˃/etc/hostsInstallpackages1.安装依赖yuminstallpython-devellibffi-develgccopenssl-deve

环境准备

2 network interfaces

8GB main memory

40GB disk space

1.修改hostname

hostnamectl set-hostname kolla

2.配置域名解析

echo '10.1.10.161    kolla' >> /etc/hosts

Install packages

1.安装依赖

yum install python-devel libffi-devel gcc openssl-devel libselinux-python -y

2.安装 pip,ansible

##如果无法安装python-pip,先导入epel源
yum install epel-release -y
yum install python-pip ansible -y pip install -U pip

安装 docker-ce(CentOS 7 使用 yum 进行安装)

# step 1: 安装必要的一些系统工具
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
# Step 2: 添加软件源信息
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# Step 3: 更新并安装Docker-CE
sudo yum makecache fast
sudo yum -y install docker-ce
# Step 4: 开启Docker服务
systemctl enable docker;systemctl restart docker

3.配置 docker 镜像加速

mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://registry.docker-cn.com"]
}
EOF
systemctl daemon-reload;systemctl restart docker

4.安装 kolla-ansible

pip install kolla-ansible
##ERROR: Cannot uninstall 'PyYAML'. 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
##出现报错不能卸载PyYAML,使用下面命令,忽略PyYAML错误
pip install kolla-ansible --ignore-installed PyYAML
mkdir -p /etc/kolla chown $USER:$USER /etc/kolla
##Copy globals.yml and passwords.yml
cp -r /usr/share/kolla-ansible/etc_examples/kolla/*/etc/kolla
##Copy all-in-one and multinode inventory files
cp /usr/share/kolla-ansible/ansible/inventory/* .

Prepare initial configuration

1.Configure Ansible /etc/ansible/ansible.cfg

[defaults]
host_key_checking=False
pipelining=True
forks=100

2.配置主机清单文件,根据部署场景,这里选择 all-in-one 文件

[control]
kolla
[network]kolla
[compute]
kolla
[storage]
kolla
[monitoring]
kolla
[deployment]
kolla

3.对 /etc/kolla/passwords.yml 文件生成随机密码,或者修改为自定义密码

kolla-genpwd

vim /etc/kolla/passwords.yml
##admin密码可以修改为自定义,在登录dashboard会用到
keystone_admin_password: 1234qwer

4.配置 /etc/kolla/globals.yml 文件

kolla_base_distro: "centos"kolla_install_type: "source"openstack_release: "train"kolla_internal_vip_address: "10.1.10.161"network_interface: "ens32"neutron_external_interface: "ens34"enable_haproxy: "no"nova_compute_virt_type: "qemu"

5.配置 ssh 无密钥登录,授权节点

ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub root@kolla

Deployment

##检查主机连接
ansible -i all-in-one all -m ping
##检查Bootstrap servers依赖
kolla-ansible -i ./all-in-one bootstrap-servers
##检查配置
kolla-ansible -i ./all-in-one prechecks
##pull镜像
kolla-ansible pull -i ./all-in-one
##执行部署
kolla-ansible -i ./all-in-one deploy
  • 报错1:

执行kolla-ansible -i ./all-in-one bootstrap-servers

TASK [baremetal : Generate /etc/hosts for all of the nodes] ********************************************************************************************************************************
fatal: [kolla]: FAILED! => {"msg": "The conditional check 'inventory_hostname not in groups['bifrost'] or 'ansible_' + hostvars[inventory_hostname]['api_interface'] in hostvars[inventory_hostname]' failed. The error was: error while evaluating conditional (inventory_hostname not in groups['bifrost'] or 'ansible_' + hostvars[inventory_hostname]['api_interface'] in hostvars[inventory_hostname]): 'ansible.vars.hostvars.HostVars object' has no attribute u'kolla' The error appears to have been in '/usr/share/kolla-ansible/ansible/roles/baremetal/tasks/pre-install.yml': line 31, column 3, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - name: Generate /etc/hosts for all of the nodes ^ here "}
to retry, use: --limit @/usr/share/kolla-ansible/ansible/kolla-host.retry

解决办法:

yum upgrade -y

更新的软件包如图

kolla-ansible部署openstack allinone单节点第1张

  • 报错2:

执行kolla-ansible -i ./all-in-one prechecks

TASK [prechecks : Checking Docker version] *************************************************************************************************************************************************
fatal: [kolla]: FAILED! => {"msg": "The conditional check 'result is failed or result.stdout | regex_replace('.*(\\d+\\.\\d+\\.\\d+).*', '\\1') is version(docker_version_min, '<')' failed. The error was: template error while templating string: no test named 'version'. String: {% if result is failed or result.stdout | regex_replace('.*(\\d+\\.\\d+\\.\\d+).*', '\\1') is version(docker_version_min, '<') %} True {% else %} False {% endif %}"}
to retry, use: --limit @/usr/share/kolla-ansible/ansible/site.retry

解决办法:

同上,更新软件包后一并解决

  • 报错3:

执行kolla-ansible -i ./all-in-one prechecks

TASK [cinder : Checking LVM volume group exists for Cinder] ********************************************************************************************************************************
fatal: [kolla]: FAILED! => {"changed": false, "cmd": ["vgs", "cinder-volumes"], "delta": "0:00:00.023537", "end": "2019-12-27 16:37:44.519563", "failed_when_result": true, "msg": "non-zero return code", "rc": 5, "start": "2019-12-27 16:37:44.496026", "stderr": " Volume group "cinder-volumes" not found Cannot process volume group cinder-volumes", "stderr_lines": [" Volume group "cinder-volumes" not found", " Cannot process volume group cinder-volumes"], "stdout": "", "stdout_lines": []}

解决办法:

报错没错找到cinder-volumes卷
手动创建

pvcreate /dev/sdb
vgcreate cinder-volumes /dev/sdb

详细方法参考:https://www.cnblogs.com/omgasw/p/12098312.html

Using OpenStack

1.安装CLI客户端

pip install python-openstackclient

2.生成环境脚本

kolla-ansible post-deploy . /etc/kolla/admin-openrc.sh
  • 报错4:

/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.7) or chardet (2.2.1) doesn't match a supported version

pip uninstall urllib3
pip uninstall chardet
pip install --upgrade requests

https://www.cnblogs.com/omgasw/p/12054988.html

  • 报错5:

ImportError: cannot import name decorate

sed -i '/^from decorator import decorate/s/from/#from/' /usr/lib/python2.7/site-packages/dogpile/cache/region.py

https://www.cnblogs.com/omgasw/p/12054817.html

3.使用脚本文件初始化运行环境

/usr/share/kolla-ansible/init-runonce

kolla-ansible部署openstack allinone单节点第2张

kolla-ansible部署openstack allinone单节点第3张

4.删除部署的openstack环境

kolla-ansible destroy -i all-in-one --yes-i-really-really-mean-it

参考链接:

https://docs.openstack.org/kolla-ansible/latest/user/quickstart.html

免责声明:文章转载自《kolla-ansible部署openstack allinone单节点》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇FPS 游戏自瞄原理eigen Matrix详解下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

随便看看

QMap与QHash

Qt提供两个主要的关联容器类:QMap和QHash。QMap的K和T有一对方便的函数keys()和values(),它们在处理小数据集时显的特别有用。QMap重载了value,返回一个给定键多有值的QList列表。在内部,它们都依赖于QHash,且都像QHash一样对K的类型有相同的要求。...

注册支付宝沙箱并测试支付宝扫码连接

2.创建新的支付宝应用程序2.1下载支付宝生成软件密钥#访问“支付宝开发平台”登录并访问开发者中心https://open.alipay.com/platform/home.htm#您可以参考“计算机网站支付”来熟悉计算机支付的整个流程https://docs.open.alipay.com/270/105899/2.1步骤1:创建应用程序(此处使用沙盒环境...

Jboss

同时,为了扩大JBoss的企业市场,JBoss已经签署了许多渠道合作伙伴。2004年6月,JBoss宣布JBoss应用服务器已通过Sun公司的J2EE认证。这是JBoss应用服务器历史上最重要的里程碑。JBossAOP 1.0于2004年10月发布。这也证实了JBoss是一家创新型公司。JBoss应用服务器5.0于2008年12月6日正式发布。新版本的应用服...

layui使用layui-excel扩展导出xlsx格式文件

layui-excel扩展导出的文件可用office打开,正常显示;直接用table带的导出功能,导出的文件用office打开显示乱码。--导出表不展示--˃78910layui.config.use(['table','form','laydate','excel'],function(){11varform=layui.form;12vartable=l...

如何快速把ps序列图层建立帧动画?

工具ps1。将序列帧图片加载到ps新建-˃脚本-˃将文件加载到堆栈2中。创建序列帧动画窗口-˃时间线-˃时间线面板的右上菜单-˃从层3创建帧。移除多余的透明画布选择所有层-˃图像-˃剪辑-˃基于透明度4。将图层保存到图片文件-˃脚本-˃将图层保存为文件隐藏白色背景5。导出序列框架文件-˃自动-˃联系人表6存储为png...

GERBER文件

GERBER文件GERBER文件是一种国际标准的光绘格式文件,它包含RS-274-D和RS-274-X两种格式,其中RS-274-D称为基本GERBER格式,并要同时附带D码文件才能完整描述一张图形;RS-274-X称为扩展GERBER格式,它本身包含有D码信息。或GERBER描述是防焊层,并且描述之图形主要是防焊部分。若您自己将PCB文件转换成GERBER...