大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
这篇文章主要介绍了kolla-ansible如何安装openstack企业级高可用集群,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
创新互联是一家专注于网站设计制作、做网站与策划设计,宝安网站建设哪家好?创新互联做网站,专注于网站建设10余年,网设计领域的专业建站公司;建站业务涵盖:宝安等地区。宝安做网站价格咨询:18982081108
每台设备两块网卡:
第一块:NAT模式,用于下载软件包,设置好IP可以上网
第二块:桥接模式,用于External网络,用于虚拟机连接外部网络,不用设置IP
hosts:
host | eth0 | eth2 |
---|---|---|
deploy | 9.110.187.130 | |
controller01 | 9.110.187.131 | 不需要IP |
controller02 | 9.110.187.132 | 不需要IP |
compute01 | 9.110.187.133 | 不需要IP |
compute02 | 9.110.187.134 | 不需要IP |
storage | 9.110.187.135 | 不需要IP |
ssh-keygen ssh-copy-id root@controller01 ssh-copy-id root@controller02 ssh-copy-id root@compute01 ssh-copy-id root@compute02 ssh-copy-id root@storage
要启动cinder存储服务,需先添加一块新的硬盘,然后创建pv、vg
[root@storage ~]# pvcreate /dev/sdb [root@storage ~]# vgcreate cinder-volumes /dev/sdb //vg名取名为 cinder-volumes,这里主要跟 kolla配置文件里vg名一致
只允许vm实例访问块存储卷,对LVM可能出现异常做设置
vim /etc/lvm/lvm.conf
#修改 devices 下面的,有多少块硬盘就写多少块,如果不想使用系统盘,则不写a|sda filter = [ "a|sda|", "a|sdb|", "r|.*|" ] #重启lvm服务 systemctl restart lvm2-lvmetad.service
所有节点都需要配置
mkdir ~/.pip cat << EOF > ~/.pip/pip.conf [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple/ [install] trusted-host=pypi.tuna.tsinghua.edu.cn EOF
#安装依赖 yum install -y python-devel libffi-devel gcc openssl-devel libselinux-python #安装PIP yum install -y python-pip pip install --upgrade pip
所有节点都安装
yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo yum install docker-ce
配置Docker共享挂载
mkdir /etc/systemd/system/docker.service.d tee /etc/systemd/system/docker.service.d/kolla.conf << 'EOF' [Service] MountFlags=shared EOF
使用阿里加速地址
mkdir -p /etc/docker systemctl daemon-reload && systemctl enable docker && systemctl restart docker systemctl status docker
pip install docker //这个其它节点也需要安装,否则后面会报错
yum install -y ansible pip install -U ansible
Kolla-Ansible 可以从pip安装,也可以从git安装,这里演示从pip安装
pip install kolla kolla-ansible
错误解决方案
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.
解决:强制更新
pip install --ignore-installed PyYAML
如果出现
requests 2.20.0 has requirement idna<2.8,>=2.5, but you'll have idna 2.4 which is incompatible.
错误,则强制更新requets
库pip install --ignore-installed requests
配置kolla-ansible
1)拷贝globals.yml 和passwords.yml 到 /etc/kolla 目录
cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/
2)拷贝kolla-ansible的主机清单文件(all-in-one和multinode)
cp /usr/share/kolla-ansible/ansible/inventory/* /home/
注:如果是在虚拟机里再启动虚拟机,那么需要把virt_type=qemu,默认是kvm
mkdir -p /etc/kolla/config/nova cat << EOF > /etc/kolla/config/nova/nova-compute.conf [libvirt] virt_type=qemu cpu_mode = none EOF
kolla-genpwd
修改下面字段,使用方便的密码
vim /etc/kolla/passwords.yml keystone_admin_password: devops
grep -Ev "^$|^[#;]" /etc/kolla/globals.yml
kolla_base_distro: "centos" kolla_install_type: "source" openstack_release: "rocky" kolla_internal_vip_address: "9.110.187.180" network_interface: "eth0" api_interface: "{{ network_interface }}" neutron_external_interface: "eth2" neutron_plugin_agent: "openvswitch" enable_cinder: "yes" enable_cinder_backend_iscsi: "yes" enable_cinder_backend_lvm: "no" enable_haproxy: "yes" enable_heat: "yes" glance_enable_rolling_upgrade: "no" ironic_DNSmasq_dhcp_range: tempest_image_id: tempest_flavor_ref_id: tempest_public_network_id: tempest_floating_network_name:
编辑/home/multinode文件
[control] controller01 controller02 [network] controller01 controller02 [inner-compute] [external-compute] compute01 compute02 [compute:children] inner-compute external-compute [monitoring] deploy [storage] storage [deployment] localhost ansible_connection=local ........
这里physnet1是对外网络的名字,在dashboard里创建供应商网络的名字要和这里对应
vim /usr/share/kolla-ansible/ansible/roles/neutron/templates/ml2_conf.ini.j2
[ml2_type_vlan] {% if enable_ironic | bool %} network_vlan_ranges = physnet1 {% else %} network_vlan_ranges = physnet1 {% endif %}
kolla-ansible -i ./multinode pull -vvv
ansible -m ping all -i ./multinode
kolla-ansible -i ./multinode bootstrap-servers
kolla-ansible -i ./multinode prechecks
kolla-ansible -i ./multinode deploy 注:可以加-vvv,显示更多
生成环境变量和脚本
kolla-ansible -i ./multinode post-deploy 此时会在/etc/kolla下面生成admin-openrc.sh脚本,执行一下
至此multinodes部署完成,浏览器输入外网访问地址:http://9.110.187.180,即可访问Openstack的登陆页面,用户名和密码都是之前设置的
各节点上服务常用目录
/etc/kolla 服务配置目录
/var/lib/docker/volumes/kolla_logs/_data 服务日志目录
/var/lib/docker/volumes 服务数据映射的目录
kolla-ansible destroy -i ./multinode --yes-i-really-really-mean-it
感谢你能够认真阅读完这篇文章,希望小编分享的“kolla-ansible如何安装openstack企业级高可用集群”这篇文章对大家有帮助,同时也希望大家多多支持创新互联,关注创新互联行业资讯频道,更多相关知识等着你来学习!