Anda di halaman 1dari 32

Guide to the LBaaS plugin ver. 1.0.

2
for Fuel

Load Balancing plugin for Fuel


LBaaS
(LoadBalancingasaService)iscurrentlyanadvancedserviceofNeutronthatprovidesloadbalancingforNeutronmultinodeenvironments.
ItimplementsHAProxytoprovidenetworkloadbalancingofincomingrequests.
InthisarticlewewillshowyouhowtocreateyourowncloudwithLBaaS(LoadBalancerasaService).Wevetriedtocreateuserfriendlydescription
withhelpfulscreenshotsforeachstep.UsingthisHowToyoucancreateaLBaaScloudbyfollowingalongwiththescreenshots(exceptforplugin
installationprocedure).
Manysystemsrequireloadbalancingbetweenidenticalnodestoreducetheloadoneachnode(sharedhosting,hugesites,etc.).Theloaddistribution
willenableusersfasteraccesstothenecessarydata,sinceeveryotherrequestwillbesenttothenextnodeinthecluster.
Thus,itispossibletosignificantlyreducetheuserswaitingtimeforcontentaccess.Asaresult,theuserwillnotlookforafastersiteorgetfrustrated
withwastedtimewhilewaitingforthecontenttodownload.
Soloadbalancingallowsyou,intheliteralsense,tobeclosertotheusers.

Requirements

Requirement

Version/Comment

Fuel

6.1

OpenStackcompatibility

2014.2.2Juno

Neutron

TheonlynetworkingconfigurationLBaaSsupports.

Limitations
PleasenotethatthecurrentversionoftheLBaaSpluginforFueldoesnotsupportHA.ThismeansthatalthoughtheLBaaSplugincanbedeployedonanHA
configurationofcontrollers,thereisnofailoverofloadbalancedobjects.Additionally,thisversionofLBaaSdoesnotprovideHTTPStermination.

Please
donotuse
thepluginforproductiondeployments.

Installation Guide
Youcannavigatethisdocumentusingtheselinks:

a)DownloadandinstallLBaaSpluginforFuel(12)
b)CreateaclusterwithLBaaSenabledusingFuel(36)
c)StepbyStepconfiguring,reatingLBaaSclusterviaHorizon,usingLBaaSplugin(717)
c.1)Createnewuserandproject(79)
c.2)CreateaprivatenetworkforLBaaScluster,createIPpoll,andvirtualIP(1013)
c.3)Createarouter,configureandmanageafloatingIP(1415)
c.4)Createaninstances,addthemintoLBaaSclusterasamembers(1617)
d)
SimpletestoftheLBaaScluster(18)

TocreateyourownLBaaScluster,youneedtofollowthesesteps:

1.InstalltheFuelMasternode.IfyoudonothaveFueldeployedyet,youcandeployatestenvironmentonyourlocaldevicebyfollowingthe
instructionsinthe
QuickStartGuide
.
2.InstallLBaaSpluginitself
2.1.DownloadLBaaSpluginforFuelfromtheFuel
PluginsCommunityCatalog
.
2.2.CopytheplugintotheFuelMasternodewithsecurecopy:

# scp lbaas-1.0-1.0.2-1.noarch.rpm root@:<the_Fuel_Master_node_IP_address>:/tmp

2.3.InstallLBaaSpluginforFuel
RunthefollowingcommandsontheFuelMasternode:

# cd /tmp
#
rpm -ivh lbaas-1.0-1.0.2-1.noarch.rpm
# fuel plugins --sync
2.5Check,thatpluginisinstalled

[root@fuel ~]# fuel plugins --list


DEPRECATION WARNING: /etc/fuel/client/config.yaml existsandwillbeusedasthesourceforsettings.Thisbehavioris
deprecated. Please specify the path to your custom settings file in the FUELCLIENT_CUSTOM_SETTINGS environment
variable.

id | name | version | package_version


---|-------|---------|---------------1 | lbaas | 1.0.2

| 2.0.0

3Nowyoucancreateanewenvironment.
3.1UsingFuelUIwizard,enter
NameandselectReleasef
oryourenvironment.

3.2.As
NetworkingSetup
,selectNeutron:

3.3Onthe
Settings
taboftheFuelwebUI,scrollthepagedownandselect
LBaaSpluginforNeutron
checkboxandpress
SaveSettings
button.

4.Inthe
Nodes
taboftheFuelwebUI,addatleast1ControllernodeandtherequirednumberofComputenodes.Configurenetworkinterfacesfor
thenodes(formoreinformation,see
UserGuide
).

5Onthe
Networks
tab,specifyyournetworkconfiguration.Savethechangesandrunnetworkverificationtestbypressing
VerifyNetworks
button.

Ensurethattesthaspassed.Youwillsee
thefollowing
message:

Ifyoureceiveanerror,resolveitandrerunthetest.


6Press
DeployChanges
buttontostart.AndwaittillFuelinstallsOpenStack.Fuelwillinstalltheoperatingsystemthatwasselectedatstep
3.1
.

Aftertheoperatingsystemhasbeeninstalled,FuelwillstarttoinstallOpenStackforyou.

WhenOpenStackhasbeeninstalled,youwillseethemessageontheFuelwebUIwiththelinktoyourOpenStackDashboard(Horizon).

NowyouarereadytostartusingOpenStack.AllfurtherstepswillbedonethroughtheOpenStackDashboardcalledHorizon.
7.ClickthelinktoHorizonthathasappearedontheFuelwebUI(seethepreviousstep).
Enter
admin
as
UserName
and
Password
.Click
SignIn
buttontocontinue.

8.Createanewproject.Intheleftsidemenu,under
Identity
optionclick
Projects
.Whenthe
Projects
menuopens,press
Createproject
button.Asthe
generalrule,onepersonshouldbeasuperuserintheadminroleforallprojectsandauserwithaMemberroleshouldbeusedforgeneral
configurationpurposes.

In
CreateProject
window,fillin
Name
and
Description
fields.


AddProjectMembersyouneedusingsearchfield.

Onthe
Quota
tab,specifymaximumquotasfortheproject.Bydefault,iitalreadyhavesomequotas,soyoucanincreaseordecreasevaluesorleave
asis:


Press
CreateProject
buttontocontinue.

9Addnewuserforthisproject.
Intheleftsidemenu,under
Identity
optionclick
Users
.Whenthe
Usersm
enuopens,press
CreateUser
button.

Fillinallfieldsinthe
Createusers
window.In
PrimaryProject
,usethedropdownmenutopickthenecessaryone(youshouldselecttheonecreated
atstep
8
).Setroletomemberto
admin
or
_member_
.

Press
CreateUser
buttontocontinue.

Inoursample,wepicked
lbaasuser1
namefortheuser.

10ReloginintoHorizon,usingthe
lbaasuser1
credentials.

11Createanewnetworkfortheinstances.ItwilluseprivateIPaddresses.
Intheleftsidemenu,under
Project
optionclickNetwork.Whenthe
Networks
menuopens,press
CreateNetwork
button.
When
CreateNetwork
menuopens,fillin
NetworkName
and
AdminState
fields.Click
Next
button.

In
Subnet
tabofthe
CreateNetwork
window,select
CreateSubnet
checkbox.
Enter
SubnetName
,
NetworkAddress,IPversionandGatewayIP
information.


In
SubnetDetail
tab,select
EnableDHCP
checkbox.
Enter
AllocationPools
,
DNSNameServers
and
HostRouters
information.

Press
Create
buttontocontinue.

Anewnetworkhasbeencreated:itappearsinthe
Networks
menu.

12 Create a new pool for the Load Balancer. Pool is a logical set of devices, such as web servers, that you group together to receive and process
traffic. The load balancing function chooses which member of the pool handles the new requests or connections received on the VIP address. Each
VIPhasonepool.


Intheleftsidemenu,under
Project
optionclick
Network.
Select
LoadBalancers
option.
ProjectNetworkLoadBalancers
andcreateanewpool.

Inthe
LoadBalancer
menu,click
AddPool
button.

WewillcreateapoolofIPaddressesfortheinstancestouse.

In
AddPool
window,fillinthefollowingfields:

Name

Description

Providerhaproxy(itisthedefaultoption)

Subnettheonewecreatedpreviously.Note,thatLBaaSwillworkwithinternalIPsonly(seediagramabove).

ProtocolweselectedHTTPhereasourverysimpleexampleapplicationwillbeanHTTPserver.

Load Balancing Method Round Robin(rotatesrequestsevenlybetweenmultipleinstances).Thisis thedefaultloadbalancingmethod.Round


Robin mode passes each new connection request to the next server in line, eventually distributing connections evenly across the array of machines
beingloadbalanced.

AdminStatesettoUP

Press
Add
buttontocontinue.
Anewpoolisnowcreated:itappearson
LoadBalancer
menu.

13AddanewVIPforthepool.
VIPspecifiesthevirtualIPaddressandportwhereclienttrafficisreceived.Alsodefinesotherdetailssuchastheloadbalancingmethodtobeused,
protocol,andsoon.Thisentityissometimesknowninloadbalancingproductsasavirtualserver,vserver,orlistener.So,itwillbeusedtoaccess
instancesfromthispool.

In
LoadBalancer
menu,selecttherequiredpool(inourcase,thisistheonewevejustcreated).In
Action
column,clickthedropdownmenuand
select
AddVIP
option.

In
AddVIP
window,fillinthefollowingfields:

Poolname

Description

VIPsubnettheonecreatedatstep
11

FreeIPaddressfromtheselectedsubnetpickupanyfreeaddress

Protocolport

Protocol

SessionPersistenceinourcase,wehavenoSessionPersistence

ConnectionlimitnumberthatsetsaconnectionlimitontheVIPoronthepoolbeyondthisnumber,theloadbalancingfunctionwillrefuse
clientrequestsorconnections(1shouldbepickedifthelimitisnotset)

Adminstatesetto
UP
state

Press
Add
buttontocontinue.

AnewvirtualIPforthe10.10.10.0/24subnetiscreated.Youwillseeitinthe
VIP
columninthetable.

YoucanclicktheVIPnametoseemoredetails.

14Createarouter
WeneedtocreatearoutertoallowIPtraffictoaccessournetwork.
Wewillcreateagatewayport,associateitwiththeIPfromexternalnetwork(whichwillbeprovidedautomatically),andthencreateanadditional
interfaceandassociateitwiththegatewayIP(10.10.10.254)forourinternalnetwork.

Intheleftsidemenu,under
Project
optionclick
Network.
Select
Routers
option.Press
CreateRouter
button.
In
CreateRouter
window,specify
RouterName
.Click
CreateRouter
buttontofinish.

Therouterwillappearin
Routers
menu.

In
Routers
menu,selecttherequiredrouter(inourcase,thisistheonewevejustcreated).In
Action
column,clickthedropdownmenuandselect
SetGateway
option.


In
SetGateway
window,fillinthefollowingfields:

ExternalNetworkselectyourpublicfacingexternalnetworkhere

RouterNamedefinedautomatically

RouterIDassignedautomatically

Press
SetGateway
button(anIPaddresswillbeallocatedautomatically).
Amessagewillappearinthe
Routers
menu.

14.2Editrouterports
Clickthenameoftherouter.


Click
AddInterface
button.

Inthe
AddInterface
window,specify
Subnet
(createdatstep
11
)and
IPAddress
(willturnintoagatewayIpaddressfortheselectedsubnet)
information.Ifwehaventpickedtheaddress,itwouldbetakenfromtherangeautomatically.

Press
AddInterface
buttontocontinue.

14.3Checkyournetworktopology.
Intheleftsidemenu,under
Project
optionclick
Network.
Select
Networktopology
option.

15Intheleftsidemenu,under
Project
optionclick
Compute.
Select
Access&Security
option.
15.1Addkeypair

In
CreateKeyPair
window,specifythenameandclick
CreateKeyPair
button.Itwillbeuploadedtoyourmachine.


Thekeypairwillappearinthe
KeyPairs
tab.

Copythedownloadedkeypairintoyour
~/.ssh/
directoryandchangepermissionsto600:

# cd ~/.ssh
# chmod 600 KEY_NAME.pem

Thenyoucanuseittoconnecttotheinstancesthatwerecreatedorwillbecreatedusingthiskeypair:

# ssh -i ~/.ssh/KEY_NAME.pem USER@SERVER_IP

15.2AddfloatingIPtoyourLBaaSproject.
Intheleftsidemenu,under
Project
optionclick
Compute.
Select
Access&Security
option.Click
FloatingIPs
tab.
Press
AllocateIPtoproject
button.

In
AllocateFloatingIP
window,enterthepoolcreatedatstep
14
.


Press
AllocateIP
buttontofinish.
Youwillsee
FloatingIP
in
Access&Security
menu.

15.3NowyouneedtoassociateittofloatingIPfromstep
13
In
Access&Security

menu,selecttherequiredFloatingIppool(inourcase,thisistheonewevejustcreated).In
Actions
column,clickthe
dropdownmenuandselect
Associate
option.

In
ManageFloatingIPAssociations
window,enter
IPAddress
and
Port
.

In
Access&Security
menu,youwillseethat
FloatingIP
nowhas
MappedFixedIPAddress
and
FloatingIPPool
.

Nowournetworktopologylookslikethis:

16Create4instances
Intheleftsidemenu,under
Project
optionclick
Compute
.Inthe
Instances
menu,click
LaunchInstances
button.
In
LaunchInstance
window,provideinformationin
Details
tab(availabilityzone,flavor,bootsource,bootimage,enterinstancenameandcountof
instancestocreate).


Press
Launch
buttontocontinue.
Waituntilinstancesarecreated.Theirstatuswillchangefrom
Build
to
Active
.

17Addtheinstancesintoloadbalancermembers

Intheleftsidemenu,under
Project
optionclick
Network.
Inthe
Networkm
enu,select
LoadBalancers
option.

Select
Members
tab.

Press
AddMember
button.

In
AddMember
window,selectthepoolcreatedatstep12,selectmembers(instances),createdonstep
16
,setweight(1allinstancesareequal),set
porttheonecreatedatstep13,andselectUPforthestate.

Press
Addbutton
tocontinue.NowwecanseeMembersofthePoolwiththeirProtocolPort,WeightandthePoolinActivestatus.

Nowyouarereadytotestyourloadbalancer.

18Simpletestoftheloadbalancer

Logintoallyourinstancesviavncconsole

Runthefollowingcommandtocreateaverysimplewebserverthatsimplyrespondstorequestswiththespecifiednumber.

# while true; do echo -e 'HTTP/1.0 200 OK\r\n\r\n<SERVER_NUMBER>' | sudo nc -l -p 80 ; done

replace
<SERVER_NUMBER>
for
server1
,
server2,
etc.ofanother,butdifferentfromservertoserver.

TesttheLBaaSitselfwiththefollowingcommand:

# while true; do wget -O - http://172.16.0.131 && sleep 0.5 ; done

Youwillseethateachsubsequentaccesstoport80onyourpublicIPfortheLBaaSwillbehandledbythenextserver
accordingtothe
RoundRobin
algorithm
.

InVNCconsolesoftheinstances,youwillseethefollowing:

Congratulations!
Youhavesuccessfullyinstalled,configuredtheLBaaSpluginforFuelandcheckedthatitisworkingproperly.Youvealsoimprovedyourskillsof
creatingtenants,networksandconfiguringLBaaSfunctionalitygreatjob!Hopeyouenjoyedourplugin.

Anda mungkin juga menyukai