OpenStack Dalmatian : लोड बैलेंसर छवि बनाएं2024/10/24 |
OpenStack लोड बैलेंसिंग को एक सेवा (Octavia) के रूप में स्थापित करें।
यह उदाहरण निम्न प्रकार से पर्यावरण पर आधारित है।
------------+--------------------------+--------------------------+------------ | | | eth0|10.0.0.30 eth0|10.0.0.50 eth0|10.0.0.51 +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [ dlp.srv.world ] | | [ network.srv.world ] | | [ node01.srv.world ] | | (Control Node) | | (Network Node) | | (Compute Node) | | | | | | | | MariaDB RabbitMQ | | Open vSwitch | | Libvirt | | Memcached Nginx | | Neutron Server | | Nova Compute | | Keystone httpd | | OVN-Northd | | Open vSwitch | | Glance Nova API | | Nginx iSCSI Target | | OVN Metadata Agent | | Cinder API | | Cinder Volume | | OVN-Controller | | | | Octavia Services | | | +-----------------------+ +-----------------------+ +-----------------------+ |
[1] | एक लोड बैलेंसर छवि बनाएं और इसे Glance में जोड़ें। किसी भी नोड पर काम करना ठीक है. (नीचे उदाहरण नियंत्रण नोड पर है) |
# एक उदाहरण छवि बनाएँ root@dlp ~(keystone)# apt -y install podman root@dlp ~(keystone)# mkdir /var/lib/containers/tmpdisk root@dlp ~(keystone)# podman run --privileged -it -v /var/lib/containers/tmpdisk:/mnt centos:stream9 /bin/bash [root@48cc0b37e9fb /]# cd /mnt [root@48cc0b37e9fb mnt]# dnf -y install centos-release-openstack-dalmatian epel-release sudo [root@48cc0b37e9fb mnt]# dnf --enablerepo=crb -y install openstack-octavia-diskimage-create debootstrap python3-octaviaclient [root@48cc0b37e9fb mnt]# octavia-diskimage-create.sh -i centos-minimal ..... ..... Successfully built the amphora image using amphora-agent from the master branch. Amphora image size: /mnt/amphora-x64-haproxy.qcow2 540686848[root@48cc0b37e9fb mnt]# exit
# Glance में जोड़ें root@dlp ~(keystone)# openstack image create "Amphora" --tag "Amphora" --file /var/lib/containers/tmpdisk/ubuntu-amphora-haproxy-amd64.qcow2 --disk-format qcow2 --container-format bare --private --project service
# Amphora उदाहरण के लिए [flavor] जोड़ें root@dlp ~(keystone)# openstack flavor create --id 100 --vcpus 1 --ram 2048 --disk 10 m1.octavia --private --project service
# Amphora उदाहरण के लिए एक सुरक्षा समूह जोड़ें root@dlp ~(keystone)# openstack security group create lb-mgmt-sec-group --project service
# सुरक्षा समूह के लिए आवश्यक पोर्ट की अनुमति दें root@dlp ~(keystone)# openstack security group rule create --protocol icmp --ingress lb-mgmt-sec-group root@dlp ~(keystone)# openstack security group rule create --protocol tcp --dst-port 22:22 lb-mgmt-sec-group root@dlp ~(keystone)# openstack security group rule create --protocol tcp --dst-port 80:80 lb-mgmt-sec-group root@dlp ~(keystone)# openstack security group rule create --protocol tcp --dst-port 443:443 lb-mgmt-sec-group root@dlp ~(keystone)# openstack security group rule create --protocol tcp --dst-port 9443:9443 lb-mgmt-sec-group |
[2] | इंस्टेंस आईडी या सुरक्षा समूह आईडी सेट करने के लिए Octavia सेवा कॉन्फ़िगर करें। |
root@network:~# openstack image list +--------------------------------------+------------+--------+ | ID | Name | Status | +--------------------------------------+------------+--------+ | 9097a3f4-8ab8-453d-9c2a-3773190b7326 | Amphora | active | | a9d10f1d-d836-424d-8117-ff3fc8c5e966 | Ubuntu2404 | active | +--------------------------------------+------------+--------+root@network:~# openstack flavor list --all +-----+------------+-------+------+-----------+-------+-----------+ | ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public | +-----+------------+-------+------+-----------+-------+-----------+ | 1 | m1.tiny | 2048 | 10 | 0 | 1 | True | | 100 | m1.octavia | 2048 | 10 | 0 | 1 | False | | 2 | m1.small | 4096 | 10 | 0 | 2 | True | | 3 | m1.medium | 8192 | 10 | 0 | 4 | True | | 4 | m1.large | 16384 | 10 | 0 | 8 | True | | 5 | m2.medium | 8192 | 10 | 10 | 4 | True | +-----+------------+-------+------+-----------+-------+-----------+root@network:~# openstack network list +---------------------------------+---------+----------------------------------+ | ID | Name | Subnets | +---------------------------------+---------+----------------------------------+ | 2da36a04-0d3e-4de8-9be8- | private | bc45dd3e-0b15-42ca-a37b- | | a2972c15bbe4 | | 94f2feaf341e | | ce38ba4f-6066-4e93-ae59- | public | 22837749-299e-4323-bfc3- | | de238fb6ed08 | | 3120c8c2d635 | +---------------------------------+---------+----------------------------------+root@network:~# openstack security group list +-----------------+-----------------+-----------------+-----------------+------+ | ID | Name | Description | Project | Tags | +-----------------+-----------------+-----------------+-----------------+------+ | 30b0ad97-6e6a- | secgroup01 | secgroup01 | 84e315c8d65e4b3 | [] | | 4391-a154- | | | cb33aaf69c9eed0 | | | 959ad288f75a | | | c3 | | | 347d1dac-e8d4- | default | Default | 84e315c8d65e4b3 | [] | | 4224-a589- | | security group | cb33aaf69c9eed0 | | | 48ff2baac3f7 | | | c3 | | | e86e5243-4864- | lb-mgmt-sec- | lb-mgmt-sec- | 0b61bc880cd64b6 | [] | | 4f1f-9a53- | group | group | 7946dd6352a138e | | | 6cf96d0214ac | | | 30 | | +-----------------+-----------------+-----------------+-----------------+------+
root@network:~#
vi /etc/octavia/octavia.conf # [controller_worker] अनुभाग में जोड़ें
[controller_worker]
client_ca = /etc/octavia/certs/client_ca.cert.pem
amp_image_tag = Amphora
# Amphora उदाहरण के लिए [flavor] आईडी निर्दिष्ट करें
amp_flavor_id = 100
# Amphora उदाहरण के लिए सुरक्षा समूह आईडी निर्दिष्ट करें
amp_secgroup_list = e86e5243-4864-4f1f-9a53-6cf96d0214ac
# Amphora उदाहरण को बूट करने के लिए नेटवर्क आईडी निर्दिष्ट करें (नीचे दिया गया उदाहरण सार्वजनिक नेटवर्क को निर्दिष्ट करता है [public])
amp_boot_network_list = ce38ba4f-6066-4e93-ae59-de238fb6ed08
network_driver = allowed_address_pairs_driver
compute_driver = compute_nova_driver
amphora_driver = amphora_haproxy_rest_driver
root@network:~# |
Sponsored Link |
|