월간 인기 게시물

게시물 718건
   
Liberty LBaas (neutron lb-*)
글쓴이 : 최고관리자 날짜 : 2015-11-06 (금) 14:35 조회 : 5873
                                
참고 : 
Kilo과 차이없음
http://www.chonnom.com/bbs/board.php?bo_table=OpenStack&wr_id=63&page=4


root@controller:~# apt-get install neutron-lbaas-agent 
root@controller:~# vim /etc/neutron/neutron.conf 
[DEFAULT]
service_plugins = router,lbaas

[service_providers]  
# 섹션새로 생성
service_provider = LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default

root@controller:~# service neutron-server restart

root@controller:~# vim /etc/neutron/lbaas_agent.int
[DEFAULT]
device_driver = neutron.services.loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver

#interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver

[service_providers]
service_provider=LOADBALANCER:Haproxy:neutron_lbaas.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default

root@network:~# service neutron-lbaas-agent restart


대쉬보드에 삽입 
 :: 수정할 필요없음 (기본설정이 lb True)
root@controller:~# vim /etc/openstack-dashboard/local_settings.py
OPENSTACK_NEUTRON_NETWORK = {
    'enable_router': True,
    'enable_quotas': True,
    'enable_ipv6': True,
    'enable_distributed_router': False,
    'enable_ha_router': False,
    'enable_lb': True,
    'enable_firewall': True,
    'enable_vpn': True,

root@controller:~# service apache2 restart
 * Restarting web server apache2  

root@controller:~# neutron agent-list 
+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+
| id                                   | agent_type         | host       | alive | admin_state_up | binary                    |
+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+
| 0871be25-b4ce-48aa-9cbe-9191840f3ca9 | Linux bridge agent | controller | :-)   | True           | neutron-linuxbridge-agent |
| 5ad6ef6a-6044-4e9d-a17a-6aedfd4ab2c2 | Loadbalancer agent | controller | :-)   | True           | neutron-lbaas-agent       |
| 5ee3e9eb-bef9-4a2b-8a88-86c0f167ea9b | DHCP agent         | controller | :-)   | True           | neutron-dhcp-agent        |
| 8933e199-6034-43b8-866f-67a21c04176a | Linux bridge agent | compute1   | :-)   | True           | neutron-linuxbridge-agent |
| a6a2d297-43d7-4f27-80de-292185300086 | L3 agent           | controller | :-)   | True           | neutron-l3-agent          |
| f0379919-bfbd-41a7-9cd6-86270082deaf | Metadata agent     | controller | :-)   | True           | neutron-metadata-agent    |
+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+

root@controller:~# neutron subnet-list 
+--------------------------------------+---------+-----------------+------------------------------------------------------+
| id                                   | name    | cidr            | allocation_pools                                     |
+--------------------------------------+---------+-----------------+------------------------------------------------------+
| 5161eee9-14d3-4d8e-be08-466501541752 | public  | 115.68.206.0/24 | {"start": "115.68.206.101", "end": "115.68.206.199"} |
| bf47d6f1-1741-4b38-baf9-2422e5e15d00 | private | 192.168.6.0/24  | {"start": "192.168.6.2", "end": "192.168.6.254"}     |
+--------------------------------------+---------+-----------------+------------------------------------------------------+
 
순서 
1. LB Pool 생성
  - 이름, 분배 알고리즘, 분배포트, 네트워크를 지정
2. 분배대상 인스턴스(VM) 확인
3. LB Pool에  분배대상 인스턴스 멤버 추가 
4. 모니터 설정 
 - 헬스를 체크에 대한 정의  
5. 설정한 모니터를 LB Pool로 지정
6. LB VIP 생성 (외부에 공개된 IP)
7. 공인아이피를 LB VIP에 지정 

root@controller:~# neutron lb-pool-create --name LB1 --lb-method ROUND_ROBIN --protocol HTTP --subnet-id bf47d6f1-1741-4b38-baf9-2422e5e15d00
Created a new pool:
+------------------------+--------------------------------------+
| Field                  | Value                                |
+------------------------+--------------------------------------+
| admin_state_up         | True                                 |
| description            |                                      |
| health_monitors        |                                      |
| health_monitors_status |                                      |
| id                     | 9f6f1a71-1b6b-4e0e-9f1a-8016e3cb5838 |
| lb_method              | ROUND_ROBIN                          |
| members                |                                      |
| name                   | LB1                                  |
| protocol               | HTTP                                 |
| provider               | haproxy                              |
| status                 | PENDING_CREATE                       |
| status_description     |                                      |
| subnet_id              | bf47d6f1-1741-4b38-baf9-2422e5e15d00 |
| tenant_id              | 05b2b44dafd446059e0d5bc90c99800c     |
| vip_id                 |                                      |
+------------------------+--------------------------------------+


분배대상 인스턴스 (멤버) 추가 
VM1 : 192.168.6.5 
VM2 : 192.168.6.6

root@controller:~# neutron lb-member-create --address 192.168.6.5 --protocol-port 80 LB1
Created a new member:
+--------------------+--------------------------------------+
| Field              | Value                                |
+--------------------+--------------------------------------+
| address            | 192.168.6.5                          |
| admin_state_up     | True                                 |
| id                 | 0b4162e6-71c5-4763-91e4-c28d85a82f92 |
| pool_id            | 9f6f1a71-1b6b-4e0e-9f1a-8016e3cb5838 |
| protocol_port      | 80                                   |
| status             | PENDING_CREATE                       |
| status_description |                                      |
| tenant_id          | 05b2b44dafd446059e0d5bc90c99800c     |
| weight             | 1                                    |
+--------------------+--------------------------------------+

root@controller:~# neutron lb-member-create --address 192.168.6.6 --protocol-port 80 LB1
Created a new member:
+--------------------+--------------------------------------+
| Field              | Value                                |
+--------------------+--------------------------------------+
| address            | 192.168.6.6                          |
| admin_state_up     | True                                 |
| id                 | f16d1416-e0ce-4e95-93d6-ac253b3c0fb7 |
| pool_id            | 9f6f1a71-1b6b-4e0e-9f1a-8016e3cb5838 |
| protocol_port      | 80                                   |
| status             | PENDING_CREATE                       |
| status_description |                                      |
| tenant_id          | 05b2b44dafd446059e0d5bc90c99800c     |
| weight             | 1                                    |
+--------------------+--------------------------------------+

root@controller:~# neutron lb-member-list 
+--------------------------------------+-------------+---------------+--------+----------------+--------+
| id                                   | address     | protocol_port | weight | admin_state_up | status |
+--------------------------------------+-------------+---------------+--------+----------------+--------+
| 0b4162e6-71c5-4763-91e4-c28d85a82f92 | 192.168.6.5 |            80 |      1 | True           | ACTIVE |
| f16d1416-e0ce-4e95-93d6-ac253b3c0fb7 | 192.168.6.6 |            80 |      1 | True           | ACTIVE |
+--------------------------------------+-------------+---------------+--------+----------------+--------+

:: 모니터 설정
root@controller:~#  neutron lb-healthmonitor-create --delay 3 --type HTTP --max-retries 3 --timeout 2
Created a new health_monitor:
+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| admin_state_up | True                                 |
| delay          | 3                                    |
| expected_codes | 200                                  |
| http_method    | GET                                  |
| id             | ec5c516d-d455-4c89-8727-a84c3bc8d991 |
| max_retries    | 3                                    |
| pools          |                                      |
| tenant_id      | 05b2b44dafd446059e0d5bc90c99800c     |
| timeout        | 2                                    |
| type           | HTTP                                 |
| url_path       | /                                    |
+----------------+--------------------------------------+

:: 모니터에 LB1 POOL 추가 
root@controller:~# neutron lb-healthmonitor-associate ec5c516d-d455-4c89-8727-a84c3bc8d991 LB1
Associated health monitor ec5c516d-d455-4c89-8727-a84c3bc8d991
root@controller:~# neutron lb-healthmonitor-list 
+--------------------------------------+------+----------------+
| id                                   | type | admin_state_up |
+--------------------------------------+------+----------------+
| ec5c516d-d455-4c89-8727-a84c3bc8d991 | HTTP | True           |
+--------------------------------------+------+----------------+

oot@controller:~# neutron lb-vip-create --name LB1_VIP  --protocol-port 80 --protocol HTTP --subnet-id bf47d6f1-1741-4b38-baf9-2422e5e15d00 LB1
Created a new vip:
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| address             | 192.168.6.7                          |
| admin_state_up      | True                                 |
| connection_limit    | -1                                   |
| description         |                                      |
| id                  | 37a95404-383a-4e2f-bb6f-cae17dab2e42 |
| name                | LB1_VIP                              |
| pool_id             | 9f6f1a71-1b6b-4e0e-9f1a-8016e3cb5838 |
| port_id             | 635c0145-12a6-4fc8-81e9-b6a80c5f2978 |
| protocol            | HTTP                                 |
| protocol_port       | 80                                   |
| session_persistence |                                      |
| status              | PENDING_CREATE                       |
| status_description  |                                      |
| subnet_id           | bf47d6f1-1741-4b38-baf9-2422e5e15d00 |
| tenant_id           | 05b2b44dafd446059e0d5bc90c99800c     |
+---------------------+--------------------------------------+

root@controller:~# neutron lb-vip-list 
+--------------------------------------+---------+-------------+----------+----------------+--------+
| id                                   | name    | address     | protocol | admin_state_up | status |
+--------------------------------------+---------+-------------+----------+----------------+--------+
| 37a95404-383a-4e2f-bb6f-cae17dab2e42 | LB1_VIP | 192.168.6.7 | HTTP     | True           | ACTIVE |
+--------------------------------------+---------+-------------+----------+----------------+--------+

root@controller:~# neutron floatingip-create public
Created a new floatingip:
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| fixed_ip_address    |                                      |
| floating_ip_address | 115.68.206.105                       |
| floating_network_id | 4b10f8a3-f9c1-4cbd-9a26-93b37c3051d4 |
| id                  | 04634263-2e4f-4ecc-becc-7b56630696fb |
| port_id             |                                      |
| router_id           |                                      |
| status              | DOWN                                 |
| tenant_id           | 05b2b44dafd446059e0d5bc90c99800c     |
+---------------------+--------------------------------------+

:: 아이피 할당 <Floating_IP> <Port_ID>
root@controller:~# neutron floatingip-associate 04634263-2e4f-4ecc-becc-7b56630696fb 635c0145-12a6-4fc8-81e9-b6a80c5f2978
Associated floating IP 04634263-2e4f-4ecc-becc-7b56630696fb


이름 패스워드
스타일
굴림
10pt
<html> <body>
 
 
 
 
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

 



 
사이트명 : 모지리네 | 대표 : 이경현 | 개인커뮤니티 : 랭키닷컴 운영체제(OS) | 경기도 성남시 분당구 | 전자우편 : mojily골뱅이chonnom.com Copyright ⓒ www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.