您好,登錄后才能下訂單哦!
這篇文章主要介紹了kolla-ansible如何安裝openstack企業級高可用集群,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
每臺設備兩塊網卡:
第一塊: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企業級高可用集群”這篇文章對大家有幫助,同時也希望大家多多支持億速云,關注億速云行業資訊頻道,更多相關知識等著你來學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。