¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 715°Ç
   
LBaas API Âü°í
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2015-12-15 (È­) 15:38 Á¶È¸ : 3808
                                
½Å±ÔÀ¯Àú 

 - °í°´º° °¡»ó¶ó¿ìÅÍ »ý¼º
 CMD> neutron net-create mojily_private
# curl -g -i -X POST http://controller:9696/v2.0/networks.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}f2e2e0f920be0eed344d75efe408812bcba43926" -d '{"network": {"name": "mojily_private", "admin_state_up": true}}'

CMD> neutron subnet-create mojily_private 172.16.1.0/24 --name mojily_private --dns-nameserver 8.8.4.4 --gateway 172.16.1.1
# curl -g -i -X POST http://controller:9696/v2.0/subnets.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}1aee2cc5023e55609ed27b4660048d7aa2c085a3" -d '{"subnet": {"name": "mojily_private", "network_id": "9805b0f9-4d65-4bdd-81c9-8bd4aec8e977", "dns_nameservers": ["8.8.4.4"], "gateway_ip": "172.16.1.1", "ip_version": 4, "cidr": "172.16.1.0/24"}}'

CMD> neutron router-create mojily_router
# curl -g -i -X POST http://controller:9696/v2.0/routers.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}d9f6c460a347021d42d24e16d9ef4c995c42bf00" -d '{"router": {"name": "mojily_router", "admin_state_up": true}}'
 
CMD> neutron router-interface-add mojily_router mojily_private
# curl -g -i -X PUT http://controller:9696/v2.0/routers/e7f4e7de-14bd-4252-8b86-e32c07f69fa9/add_router_interface.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}de82ac618194c1092b02a2f216ef86c121a94ef8" -d '{"subnet_id": "1af6a23c-2393-4415-85fb-5c7936e12829"}'

CMD> neutron router-gateway-set mojily_router public
# curl -g -i -X PUT http://controller:9696/v2.0/routers/e7f4e7de-14bd-4252-8b86-e32c07f69fa9.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}5a46e71ae419d3483250cde0683d597abc15ac2a" -d '{"router": {"external_gateway_info": {"network_id": "e2f0d382-3a9d-4ddd-aa8c-bb5c660d57df"}}}'




·Îµå¹ë·£¼­

 1. ·Îµå¹ë·£¼­ »ý¼º
CMD> neutron lbaas-loadbalancer-create --name mojily_lb1 mojily_private
# curl -g -i -X POST http://controller:9696/v2.0/lbaas/loadbalancers.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}16897e8b3d072b64b41ce6aa6692cf7e45156865" -d '{"loadbalancer": {"vip_subnet_id": "7ececf26-ec76-47b9-a052-2d5cbb349199", "name": "mojily_lb1", "admin_state_up": true}}'

 2. Æ÷Æ®¸®½ºÅÍ »ý¼º 
CMD> neutron lbaas-listener-create --loadbalancer mojily_lb1 --protocol HTTP --protocol-port 80 --name listener1
# curl -g -i -X POST http://controller:9696/v2.0/lbaas/listeners.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}7813bc69c0ed8f4085cbaf17cf1711b607b6d6bd" -d '{"listener": {"protocol_port": "80", "protocol": "HTTP", "loadbalancer_id": "d7cf01b2-a674-49c8-9eb2-f1e93ef05fea", "name": "listener1", "admin_state_up": true}}'

 3. ·Îµå¹ë·£¼­ Ç®»ý¼º
CMD> neutron lbaas-pool-create --lb-algorithm ROUND_ROBIN --listener listener1 --protocol HTTP --name POOL1
# curl -g -i -X POST http://controller:9696/v2.0/lbaas/pools.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}565359694996e04e7f31dc69026188995e870ee5" -d '{"pool": {"lb_algorithm": "ROUND_ROBIN", "listener_id": "2c3ae3e7-2727-4b71-9f4b-e5e66ff56798", "protocol": "HTTP", "name": "POOL1", "admin_state_up": true}}'

 4. ·Îµå¹ë·£¼­ ¸â¹ö¼³Á¤
:: ÀÌ¹Ì Á¸ÀçÇÏ´Â ÀνºÅϽº ¼±Åà (OR ½Å±Ô·Î ºÐ»ê¹ÞÀ» ¼­¹ö »ý¼º)
CMD> neutron lbaas-member-create --subnet mojily_private --address 172.16.1.6 --protocol-port 80 POOL1
CMD> neutron lbaas-member-create --subnet mojily_private --address 172.16.1.7 --protocol-port 80 POOL1
# curl -g -i -X POST http://controller:9696/v2.0/lbaas/pools/1bd17996-c365-46ad-a818-2e94fe5ab337/members.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}450bea10859fc3caff3b9cb8104f9bbc3706346d" -d '{"member": {"subnet_id": "7ececf26-ec76-47b9-a052-2d5cbb349199", "protocol_port": "80", "address": "172.16.1.6", "admin_state_up": true}}'
# curl -g -i -X POST http://controller:9696/v2.0/lbaas/pools/1bd17996-c365-46ad-a818-2e94fe5ab337/members.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}205c9b978f7e761819b622e4b5cf933c66e4b3b3" -d '{"member": {"subnet_id": "7ececf26-ec76-47b9-a052-2d5cbb349199", "protocol_port": "80", "address": "172.16.1.7", "admin_state_up": true}}'

 5. Çコ¸ð´ÏÅÍ ¼³Á¤
CMD> neutron lbaas-healthmonitor-create --delay 3 --type HTTP --max-retries 3 --timeout 3 --pool POOL1
# curl -g -i -X POST http://controller:9696/v2.0/lbaas/healthmonitors.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}d4dc85c9d73f13a764d05e57d61556b42dff37b9" -d '{"healthmonitor": {"admin_state_up": true, "pool_id": "1bd17996-c365-46ad-a818-2e94fe5ab337", "delay": "3", "max_retries": "3", "timeout": "3", "type": "HTTP"}}'

 6. ·Îµå¹ë·±½º Æ÷Æ®¿Í VIP ¾ÆÀÌÇÇ¿Í ¸ÅÇÎ
CMD> Port_ID=neutron port-list |grep $(neutron lbaas-loadbalancer-list | awk '/mojily_lb1/ {print $6}') | awk '{print $2}'
e8a3622a-02f1-4d43-8db3-1657e71fc43e
CMD> neutron floatingip-create public --port-id e8a3622a-02f1-4d43-8db3-1657e71fc43e
# curl -g -i -X POST http://controller:9696/v2.0/floatingips.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}f10a947f2bd73485d42cb952721e2ba1fa1d774a" -d '{"floatingip": {"floating_network_id": "e2f0d382-3a9d-4ddd-aa8c-bb5c660d57df", "port_id": "e8a3622a-02f1-4d43-8db3-1657e71fc43e"}}'


 -->> Æ÷Æ®Ãß°¡
 7. ·Îµå¹ë·£¼­ Æ÷Æ® ¸®½ºÅÍ Ãß°¡ 
 8. ·Îµå¹ë·£¼­ ¸â¸Ó¼³Á¤
 9. Çコ¸ð´ÏÅÍ 

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.