這篇文章主要介紹了kolla-ansible如何安裝openstack企業(yè)級高可用集群,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
創(chuàng)新互聯(lián)是一家專注于網(wǎng)站設(shè)計(jì)制作、做網(wǎng)站與策劃設(shè)計(jì),寶安網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)10余年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:寶安等地區(qū)。寶安做網(wǎng)站價格咨詢:18982081108
每臺設(shè)備兩塊網(wǎng)卡:
第一塊:NAT模式,用于下載軟件包,設(shè)置好IP可以上網(wǎng)
第二塊:橋接模式,用于External網(wǎng)絡(luò),用于虛擬機(jī)連接外部網(wǎng)絡(luò),不用設(shè)置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存儲服務(wù),需先添加一塊新的硬盤,然后創(chuàng)建pv、vg
[root@storage ~]# pvcreate /dev/sdb [root@storage ~]# vgcreate cinder-volumes /dev/sdb //vg名取名為 cinder-volumes,這里主要跟 kolla配置文件里vg名一致
只允許vm實(shí)例訪問塊存儲卷,對LVM可能出現(xiàn)異常做設(shè)置
vim /etc/lvm/lvm.conf
#修改 devices 下面的,有多少塊硬盤就寫多少塊,如果不想使用系統(tǒng)盤,則不寫a|sda filter = [ "a|sda|", "a|sdb|", "r|.*|" ] #重啟lvm服務(wù) systemctl restart lvm2-lvmetad.service
所有節(jié)點(diǎn)都需要配置
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
所有節(jié)點(diǎn)都安裝
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 //這個其它節(jié)點(diǎn)也需要安裝,否則后面會報錯
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.
解決:強(qiáng)制更新
pip install --ignore-installed PyYAML
如果出現(xiàn)
requests 2.20.0 has requirement idna<2.8,>=2.5, but you'll have idna 2.4 which is incompatible.
錯誤,則強(qiáng)制更新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的主機(jī)清單文件(all-in-one和multinode)
cp /usr/share/kolla-ansible/ansible/inventory/* /home/
注:如果是在虛擬機(jī)里再啟動虛擬機(jī),那么需要把virt_type=qemu,默認(rèn)是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是對外網(wǎng)絡(luò)的名字,在dashboard里創(chuàng)建供應(yīng)商網(wǎng)絡(luò)的名字要和這里對應(yīng)
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,顯示更多
生成環(huán)境變量和腳本
kolla-ansible -i ./multinode post-deploy 此時會在/etc/kolla下面生成admin-openrc.sh腳本,執(zhí)行一下
至此multinodes部署完成,瀏覽器輸入外網(wǎng)訪問地址:http://9.110.187.180,即可訪問Openstack的登陸頁面,用戶名和密碼都是之前設(shè)置的
各節(jié)點(diǎn)上服務(wù)常用目錄
/etc/kolla 服務(wù)配置目錄
/var/lib/docker/volumes/kolla_logs/_data 服務(wù)日志目錄
/var/lib/docker/volumes 服務(wù)數(shù)據(jù)映射的目錄
kolla-ansible destroy -i ./multinode --yes-i-really-really-mean-it
感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“kolla-ansible如何安裝openstack企業(yè)級高可用集群”這篇文章對大家有幫助,同時也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關(guān)知識等著你來學(xué)習(xí)!