Ubuntu 24.04
Sponsored Link

OpenStack Dalmatian : Octavia (नेटवर्क नोड) कॉन्फ़िगर करें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] Octavia सेवाएँ स्थापित करें। इंस्टालेशन के दौरान प्रश्नों के लिए, सभी के लिए [नहीं] ठीक है।
root@network:~#
apt -y install octavia-api octavia-health-manager octavia-housekeeping octavia-worker python3-ovn-octavia-provider
[2] ऐसे प्रमाणपत्र बनाएं जिनका उपयोग लोड बैलेंसर इंस्टेंस और Octavia सेवाओं के बीच किया जाता है।
root@network:~#
mkdir -p /etc/octavia/certs/private

root@network:~#
mkdir ~/work

root@network:~#
cd ~/work

root@network:~/work#
git clone https://opendev.org/openstack/octavia.git

root@network:~/work#
cd octavia/bin

root@network:~/work/octavia/bin#
./create_dual_intermediate_CA.sh

root@network:~/work/octavia/bin#
cp -p ./dual_ca/etc/octavia/certs/server_ca.cert.pem /etc/octavia/certs

root@network:~/work/octavia/bin#
cp -p ./dual_ca/etc/octavia/certs/server_ca-chain.cert.pem /etc/octavia/certs

root@network:~/work/octavia/bin#
cp -p ./dual_ca/etc/octavia/certs/server_ca.key.pem /etc/octavia/certs/private

root@network:~/work/octavia/bin#
cp -p ./dual_ca/etc/octavia/certs/client_ca.cert.pem /etc/octavia/certs

root@network:~/work/octavia/bin#
cp -p ./dual_ca/etc/octavia/certs/client.cert-and-key.pem /etc/octavia/certs/private

root@network:~/work/octavia/bin#
chown -R octavia /etc/octavia/certs

[3] Octavia कॉन्फ़िगर करें।
root@network:~#
mv /etc/octavia/octavia.conf /etc/octavia/octavia.conf.org

root@network:~#
vi /etc/octavia/octavia.conf
# नया निर्माण

[DEFAULT]
# RabbitMQ कनेक्शन जानकारी
transport_url = rabbit://openstack:password@dlp.srv.world

[api_settings]
bind_host = 127.0.0.1
bind_port = 9876
auth_strategy = keystone
api_base_uri = https://network.srv.world:9876

# MariaDB कनेक्शन जानकारी
[database]
connection = mysql+pymysql://octavia:password@dlp.srv.world/octavia

[health_manager]
bind_ip = 10.0.0.50
bind_port = 5555

# Keystone प्रामाणिक जानकारी
[keystone_authtoken]
www_authenticate_uri = https://dlp.srv.world:5000
auth_url = https://dlp.srv.world:5000
memcached_servers = dlp.srv.world:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = octavia
password = servicepassword
# यदि Apache2 Keystone पर स्व-हस्ताक्षरित प्रमाणपत्र का उपयोग कर रहे हैं, तो [true] पर जाएँ
insecure = false

# [2] पर बनाए गए प्रमाणपत्र निर्दिष्ट करें
[certificates]
ca_private_key = /etc/octavia/certs/private/server_ca.key.pem
ca_certificate = /etc/octavia/certs/server_ca.cert.pem
server_certs_key_passphrase = insecure-key-do-not-use-this-key
ca_private_key_passphrase = not-secure-passphrase

# [2] पर बनाए गए प्रमाणपत्र निर्दिष्ट करें
[haproxy_amphora]
server_ca = /etc/octavia/certs/server_ca-chain.cert.pem
client_cert = /etc/octavia/certs/private/client.cert-and-key.pem

# [2] पर बनाए गए प्रमाणपत्र निर्दिष्ट करें
[controller_worker]
client_ca = /etc/octavia/certs/client_ca.cert.pem

[oslo_messaging]
topic = octavia_prov

# Keystone प्रामाणिक जानकारी
[service_auth]
auth_url = https://dlp.srv.world:5000
memcached_servers = dlp.srv.world:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = octavia
password = servicepassword
# यदि Apache2 Keystone पर स्व-हस्ताक्षरित प्रमाणपत्र का उपयोग कर रहे हैं, तो [true] पर जाएँ
insecure = false

root@network:~#
vi /etc/octavia/policy.yaml
# नया निर्माण

"context_is_admin": "role:admin or role:load-balancer_admin"
"admin_or_owner": "is_admin:True or project_id:%(project_id)s"
"load-balancer:read": "rule:admin_or_owner"
"load-balancer:read-global": "is_admin:True"
"load-balancer:write": "rule:admin_or_owner"
"load-balancer:read-quota": "rule:admin_or_owner"
"load-balancer:read-quota-global": "is_admin:True"
"load-balancer:write-quota": "is_admin:True"

root@network:~#
chmod 640 /etc/octavia/{octavia.conf,policy.yaml}

root@network:~#
chgrp octavia /etc/octavia/{octavia.conf,policy.yaml}
[4] प्रॉक्सी सेटिंग्स के लिए Nginx कॉन्फ़िगर करें।
root@network:~#
vi /etc/nginx/nginx.conf
# [stream] अनुभाग में जोड़ें

stream {
    upstream neutron-api {
        server 127.0.0.1:9696;
    }
    server {
        listen 10.0.0.50:9696 ssl;
        proxy_pass neutron-api;
    }
    upstream octavia-api {
        server 127.0.0.1:9876;
    }
    server {
        listen 10.0.0.50:9876 ssl;
        proxy_pass octavia-api;
    }
    ssl_certificate "/etc/letsencrypt/live/network.srv.world/fullchain.pem";
    ssl_certificate_key "/etc/letsencrypt/live/network.srv.world/privkey.pem";
}
[5] डेटाबेस में डेटा जोड़ें और Octavia सेवाएँ प्रारंभ करें।
root@network:~#
su -s /bin/bash octavia -c "octavia-db-manage --config-file /etc/octavia/octavia.conf upgrade head"

root@network:~#
systemctl restart octavia-api octavia-health-manager octavia-housekeeping octavia-worker nginx

मिलान सामग्री