Hôm nay chúng ta cùng tìm hiểu về một số tính năng mở rộng của neutron như Load Balancing as a Service (LbaaS), VPN as a Service (VPNaaS) và Firewall as a Service (FwaaS)
Mô hình thử nghiệm
Cấu hình dịch vụ LBaaS (Load-Balancing-as-a-Service)
Tại Network note server, cài đặt gói
apt-get install neutron-lbaas-agent
####### Cấu hình tại Network note server ########
#Enable the HAProxy load balancer
#edit /etc/neutron/lbaas_agent.ini
[DEFAULT]
device_driver = neutron.services.loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver
#Select the required driver
#edit /etc/neutron/lbaas_agent.ini
#Enable the Open vSwitch LBaaS driver:
[DEFAULT]
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
#Or, enable the Linux Bridge LBaaS driver:
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
####### Cấu hình tại Network note và Controller note ########
#Enable the load-balancing plug-in and VPN by using the service_plugins option
#edit /etc/neutron/neutron.conf
[DEFAULT]
service_plugins = router,lbaas
#Enable the HAProxy plug-in and VPN by using the [service_providers] option
#edit /etc/neutron/neutron.conf
[service_providers]
service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
# enable dashboard the edit /etc/openstack-dashboard/local_settings.py
OPENSTACK_NEUTRON_NETWORK = {
‘enable_lb’: True,
}
#Apply the settings by restarting the neutron services.
#controller note server:
service neutron-server restart
#network note server:
service neutron-lbaas-agent restart
service neutron-dhcp-agent restart
service neutron-l3-agent restart
service neutron-metadata-agent restart
service neutron-plugin-openvswitch-agent restart
Thử nghiệm LbaaS
- Mục tiêu: thử nghiệm tính năng load balancer đối với 2 instance chạy web thông qua một VIP (Virtual IP).
- Tạo vùng mạng riêng int_net có subnet 172.16.72.0/24 kết nối với mạng ext_net thông qua router
- Launch 2 instance dùng Ubuntu 14.04 image, kết nối với int_net, sau đó cấp floating IP cho từng instance. Lưu ý rằng phải kết nối được với 2 instance thông qua http (80) và ssh(22) bằng cách thiết lập trong Security Group.
Kết nối tới các instance và cài đặt dịch vụ Apache2, sửa đổi file /var/www/index.html để dễ nhận diện mỗi web server.
Trong giao diện Load Balancer, thêm http-pool với cấu hình như dưới:
Thêm VIP cho http-pool vừa tạo
Thêm Moniter
Thêm monitor vừa tạo vào http-pool
Cấp floating IP cho VIP đã tạo ở trên
Ta sẽ thử nghiệm tính năng lb bằng cách truy cập 2 web server trên thông qua VIP
Như đã thấy ở hình trên, các truy cập sẽ được trỏ lần lượt đến web server 1 rồi đến web server 2.
Thử nghiệm trường hợp 1 trong 2 web server có sự cố, có thể tắt một trong 2 hoặc đơn giản hơn là thiết lập thông số weight trong load balacer member thành 0
Khi (web server 1) có sự cố, mọi truy cập sẽ được chuyển hướng đến web server còn lại (web server 2)
Lượt xem (1136)
Để lại bình luận: