Hôm trước mình có tìm hiểu Cloudbreak triển khai trên OpenStack thì được biết là Cloudbreak hỗ trợ tới phiên bản OpenStack Mitaka (1), nhưng Mitaka đã hết hạn hỗ trợ (end-of-life) nên sẽ không thể các đặt theo cách thông thường (2). Mình thử tìm hiểu cách cài Mitaka và đã thành công. Tutorial như bên dưới.
Mình triển khai trên máy ảo VMWare cấu hình:
- OS CentOS 7 (minimal)
- Processor: 4 core (enable Virtual Intel VT-x/EPT or AMD-V/RVI)
- Memory: 8 GB
- Hard disk (SCSI): 50GB
- Network Adapter: NAT
- Yêu cầu setup dưới user có quyền sudo
Cấu hình Static IP
- Tắt NetworkManager
systemctl stop NetworkManager
systemctl disable NetworkManager
- Cấu hình IP Static
systemctl stop NetworkManager
systemctl disable NetworkManager
- Cấu hình IP Static
vi /etc/sysconfig/network-scripts/ifcfg-ens33
# Thay đổi như bên dưới
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.168.128
Lưu ý: IPADDR phải dựa trên dải IP trong NAT network card của VMWare, ví dụ như mình có Subnet IP là 192.168.168.0 và DHCP start từ 192.168.168.3
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.168.128
Lưu ý: IPADDR phải dựa trên dải IP trong NAT network card của VMWare, ví dụ như mình có Subnet IP là 192.168.168.0 và DHCP start từ 192.168.168.3
- Update Gateway
vi /etc/sysconfig/network
# Cấu hình như bên dưới
NETWORKING=yes
GATEWAY=192.168.168.2
Lưu ý: Gateway này trong NAT Settings của network card.
- Update DNS
vi /etc/resolv.conf
# Thêm dòng bên dưới
nameserver 8.8.8.8
- Sau cùng là restart network
systemctl restart network
- Để chắc chắn VM đã kết nối được internet dùng
$ ping google.com
PING google.com (216.58.203.238): 56 data bytes
64 bytes from 216.58.203.238: icmp_seq=0 ttl=55 time=83.547 ms
64 bytes from 216.58.203.238: icmp_seq=1 ttl=55 time=92.967 ms
64 bytes from 216.58.203.238: icmp_seq=2 ttl=55 time=67.525 ms
Tắt SELINUX
SELinux (Security-Enhanced Linux) là một mô đun bảo mật ở nhân của Linux, cung cấp cơ chế hỗ trợ các chính sách bảo mật kiểm soát truy cập (access control), bao gồm các điều khiển truy nhập bắt buộc theo phong cách Bộ Quốc phòng Hoa Kỳ (MAC).
- Để chắc chắn VM đã kết nối được internet dùng
$ ping google.com
PING google.com (216.58.203.238): 56 data bytes
64 bytes from 216.58.203.238: icmp_seq=0 ttl=55 time=83.547 ms
64 bytes from 216.58.203.238: icmp_seq=1 ttl=55 time=92.967 ms
64 bytes from 216.58.203.238: icmp_seq=2 ttl=55 time=67.525 ms
Tắt SELINUX
SELinux (Security-Enhanced Linux) là một mô đun bảo mật ở nhân của Linux, cung cấp cơ chế hỗ trợ các chính sách bảo mật kiểm soát truy cập (access control), bao gồm các điều khiển truy nhập bắt buộc theo phong cách Bộ Quốc phòng Hoa Kỳ (MAC).
Nếu để SELinux sẽ ảnh hưởng một số phần về network trong OpenStack.
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
Reboot sync;reboot sau đó check bằng
sestatus
SELinux status: disabled
Cài đặt các dependencies cần thiết
yum install -y qemu-kvm libvirt-client libvirt-daemon libvirt-daemon-driver-qemu python-setuptools
Khai báo repos cho OpenStack Mitaka
yum install -y https://repos.fedorapeople.org/repos/openstack/EOL/openstack-mitaka/rdo-release-mitaka-7.noarch.rpm
yum clean metadata
yum install -y centos-release-openstack-mitaka
Sau khi chạy hết block lệnh trên sẽ ra lỗi
yum clean metadata
yum install -y centos-release-openstack-mitaka
Sau khi chạy hết block lệnh trên sẽ ra lỗi
failure: repodata/repomd.xml from openstack-mitaka: [Errno 256] No more mirrors to try.
http://mirror.centos.org/centos/7/cloud/x86_64/openstack-mitaka/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Nguyên nhân là repo này đã bị xóa khỏi mirror trên Centos, vì vậy mình đã thử tìm mirror khác. Sau khi search openstack-mitaka/repodata/repomd.xml thì thấy có mirror http://mirror.neu.edu.cn còn repo của Mitaka.
http://mirror.centos.org/centos/7/cloud/x86_64/openstack-mitaka/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Nguyên nhân là repo này đã bị xóa khỏi mirror trên Centos, vì vậy mình đã thử tìm mirror khác. Sau khi search openstack-mitaka/repodata/repomd.xml thì thấy có mirror http://mirror.neu.edu.cn còn repo của Mitaka.
Lỗi trên fix bằng
# đổi baseurl thành bên dưới
http://mirror.neu.edu.cn/centos/7/cloud/$basearch/openstack-mitaka/
Setup OpenStack PackStack
yum install -y openstack-packstack
failure: repodata/repomd.xml from openstack-mitaka: [Errno 256] No more mirrors to try.
http://mirror.centos.org/centos/7/cloud/x86_64/openstack-mitaka/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Fix bằng cách
vi /etc/yum.repos.d/CentOS-OpenStack-mitaka.repo
# đổi baseurl thành
http://mirror.neu.edu.cn/centos/7/cloud/$basearch/openstack-mitaka/
Error: Package: centos-release-openstack-mitaka-1-5.el7.noarch (openstack-mitaka)
Requires: centos-release-ceph-hammer
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Fix bằng cách
Chạy dòng trên sẽ bắt gặp lỗi
http://mirror.centos.org/centos/7/cloud/x86_64/openstack-mitaka/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
vi /etc/yum.repos.d/CentOS-OpenStack-mitaka.repo
# đổi baseurl thành
http://mirror.neu.edu.cn/centos/7/cloud/$basearch/openstack-mitaka/
Tiếp theo sẽ bị lỗi về Ceph (vẫn là vấn đề version cũ)
Requires: centos-release-ceph-hammer
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Fix bằng cách
vi /etc/yum.repos.d/CentOS-Ceph-Hammer.repo
# đổi baseurl thành
http://mirror.neu.edu.cn/centos/7/storage/$basearch/ceph-hammer/
Tiến hành cài đặt OpenStack
packstack --allinone
192.168.168.128_ceilometer.pp: [ DONE ]
Applying 192.168.168.128_aodh.pp
192.168.168.128_aodh.pp: [ DONE ]
Applying 192.168.168.128_nagios.pp
Applying 192.168.168.128_nagios_nrpe.pp
192.168.168.128_nagios.pp: [ DONE ]
192.168.168.128_nagios_nrpe.pp: [ DONE ]
Applying Puppet manifests [ DONE ]
Finalizing [ DONE ]
**** Installation completed successfully ******
Additional information:
* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
* File /root/keystonerc_admin has been created on OpenStack client host 192.168.168.128. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://192.168.168.128/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
* To use Nagios, browse to http://192.168.168.128/nagios username: nagiosadmin, password: 931ed527ae664521
* The installation log file is available at: /var/tmp/packstack/20190711-042748-EHS6Gc/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20190711-042748-EHS6Gc/manifests
Sau khi hoàn thành
- Mình sẽ login bằng account admin trong file ~/keystonerc_admin từ máy host (máy cài VMWare).
- File cấu hình (còn gọi là file answer, dùng để setup những lần sau) sẽ nằm ở ~/packstack-answers-xxxxxxxx-xxxxxx.txt
- Để cài đặt lại cùng với cấu hình cũ ta có thể dùng
packstack --answer-file ~/packstack-answers-xxxxxxxx-xxxxxx.txt
Giờ mình test thử tạo VM như thế nào, thử ngon chưa
- Image có sẵn: cirros
- Tạo cấu hình tối thiểu, attach vào public network card trong OpenStack (cũng không cần thiết có network)
Sau khi Init xong, thử login vào bằng NoVNC
Như vậy là mình đã setup được OpenStack version EOL, các verion cũ có thể setup tương tự.
EXP
- Vấn đề ở đây là repo doesn't exist, vì vậy ta phải tốn công tìm repo mới.
- Các version cũ tồn tại bug hoặc không tương thích với các dependencies mới.
- Packstack hỗ trợ setup OpenStack nhanh, dùng tốt trong các mô hình PoC (Proof of concept), không thích hợp dùng cho production; khi setup bị lỗi khó trace được lỗi.
Tham khảo
(1) https://docs.hortonworks.com/HDPDocuments/Cloudbreak/Cloudbreak-2.9.1/install-os/content/cb_supported-linux-distributions.html
(2) http://linuxpitstop.com/openstack-mitaka-rdo-on-centos-7/
Applying 192.168.168.128_aodh.pp
192.168.168.128_aodh.pp: [ DONE ]
Applying 192.168.168.128_nagios.pp
Applying 192.168.168.128_nagios_nrpe.pp
192.168.168.128_nagios.pp: [ DONE ]
192.168.168.128_nagios_nrpe.pp: [ DONE ]
Applying Puppet manifests [ DONE ]
Finalizing [ DONE ]
**** Installation completed successfully ******
Additional information:
* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
* File /root/keystonerc_admin has been created on OpenStack client host 192.168.168.128. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://192.168.168.128/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
* To use Nagios, browse to http://192.168.168.128/nagios username: nagiosadmin, password: 931ed527ae664521
* The installation log file is available at: /var/tmp/packstack/20190711-042748-EHS6Gc/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20190711-042748-EHS6Gc/manifests
Sau khi hoàn thành
- Mình sẽ login bằng account admin trong file ~/keystonerc_admin từ máy host (máy cài VMWare).
- File cấu hình (còn gọi là file answer, dùng để setup những lần sau) sẽ nằm ở ~/packstack-answers-xxxxxxxx-xxxxxx.txt
- Để cài đặt lại cùng với cấu hình cũ ta có thể dùng
packstack --answer-file ~/packstack-answers-xxxxxxxx-xxxxxx.txt
Giờ mình test thử tạo VM như thế nào, thử ngon chưa
- Image có sẵn: cirros
- Tạo cấu hình tối thiểu, attach vào public network card trong OpenStack (cũng không cần thiết có network)
Sau khi Init xong, thử login vào bằng NoVNC
Như vậy là mình đã setup được OpenStack version EOL, các verion cũ có thể setup tương tự.
EXP
- Vấn đề ở đây là repo doesn't exist, vì vậy ta phải tốn công tìm repo mới.
- Các version cũ tồn tại bug hoặc không tương thích với các dependencies mới.
- Packstack hỗ trợ setup OpenStack nhanh, dùng tốt trong các mô hình PoC (Proof of concept), không thích hợp dùng cho production; khi setup bị lỗi khó trace được lỗi.
Tham khảo
(1) https://docs.hortonworks.com/HDPDocuments/Cloudbreak/Cloudbreak-2.9.1/install-os/content/cb_supported-linux-distributions.html
(2) http://linuxpitstop.com/openstack-mitaka-rdo-on-centos-7/





mình cài theo bị lỗi ruby vs không thấy sinh ra các file CentOS-Ceph-Hammer.repo ( update 19-3-2020 )
Trả lờiXóaà mình vừa thử cài bản centos 7.2 thì ok đó bạn. Có lẽ note thêm phiên bản OS vào vì nếu dùng OS mới thì các gói trên OS mới sẽ ko tương thích để cài với các gói ở repo cũ nữa
Xóa