+ All Categories
Home > Documents > ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes...

ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes...

Date post: 29-Apr-2018
Category:
Upload: dodang
View: 222 times
Download: 3 times
Share this document with a friend
24
ECS with Nginx load Balancer and CloudArray Vasily Pantyukhin http://oldhenhut.com ECS preparation Create Replication Group Replication Group combines two ECSs U300. Add new Base URL Domain suffix ecspoc.local should be used as the Base URL Use Base URL without Namespace option checked Create S3 user Create Object user Generate S3 password
Transcript
Page 1: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

ECS with Nginx load Balancer and CloudArray VasilyPantyukhin

http://oldhenhut.com

ECSpreparation

CreateReplicationGroup

• ReplicationGroupcombinestwoECSsU300.

AddnewBaseURL

• Domainsuffixecspoc.localshouldbeusedastheBaseURL

• UseBaseURLwithoutNamespaceoptionchecked

CreateS3user

• CreateObjectuser

• GenerateS3password

Page 2: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

4

CreateBucketandmodifyDNS

• CreateBucketwiththenamecabucket

• AddwildcardDNSrecord*.ecspoc.local

• Pingthebucket’sFQDN

Page 3: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

5

ConfigureCloudArraypart1

UpgradeCloudArraytothelatestversion

• NavigatetoAdministration>CheckForUpgrade

• Upgradetoanewversion.

• Ittakesseveralminutes.

Page 4: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

6

CheckCloudProviderwithoutaloadbalancer

• NavigatetoCloudArray>CloudProviders

• CloudProvidertype=ViPR

• EnableEncryption

• FortestpurposesCompressionshouldbedisabled(enabledonthescreenshot)

• Key=S3userconfiguredonECS

• Secret=S3passwordconfiguredonECSforthespecificuser

• Node=DNDsuffixecspoc.local

• BucketName=cabucket

• DisableSSL(canbeenabledinproduction)

• Port=9020(noSSL)

Page 5: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

7

• Configureperformanceoptimizer

• CloudProviderisconfigured

Page 6: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

8

DeleteCloudProvider

WecheckedthatCloudProvidercanbeconfiguredwithoutloadbalancer.Nowwecandeletethis

CloudProvider,configureNginxandconfigureanewCloudProvidervialoadbalancer.

• DeleteCloudProvider

Page 7: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

9

ConfigureNginx

CheckNginxinstallation

• CheckNginxversionsandinstalledmodules

$/usr/local/nginx/sbin/nginx-Vnginxversion:nginx/1.9.2builtbygcc4.8.2(Ubuntu4.8.2-19ubuntu1)configurearguments:--with-http_ssl_module--with-http_spdy_module--with-http_realip_module--with-http_stub_status_module

• Usingcurl,youshouldseesomeHTMLoutputifyoutrytoaccessport80onnginxLinux

host.

$curl127.0.0.1<!DOCTYPEhtml><html><head><title>Welcometonginx!</title>

• Modifynginxconfig

$vi/etc/nginx/nginx.confhttp{server{listen*:9020;server_name*.ecs-poc-lb1.ecspoc.local;}}

• Reloadnginxconfig

$servicenginxrestartor

$kill-HUP`cat/var/run/nginx.pid`or

$nginx–sreload

• Inawebbrowser,gotoyourserver'sdomainnameorIPaddress:

http://ecs-poc-lb1.ecspoc.local:9020

Page 8: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

10

Configureloadbalancing

InthattestSSLterminationwasnotused.IncaseifSSLisneeded,checktheAppendix.

• Modifyconfig

• ECS1nodesconfiguredastheupstreamservers

• DefaultloadbalancingmethodisRoundRobin

• Anylisteningportcanbespecified.Inthetest9020wasusedasforupstreamserversaccess.

• Bucketnamewillbeaddedtothebeginningofdomainprefixecspoc.localasservername.

ThatoptionisspecifiedasanobjectbaseURLinECS.

• Theoptionproxy_set_headerHost$hostisveryimportant.Bydefaultthe"Host"headeris

re-writtentotheIPaddressornameandportnumberoftheupstream(definedby

proxy_pass).When$hostvariableissetasaHostheader,hostnamefromtherequestwillbe

returnedback.

$vi/etc/nginx/nginx.confworker_processesauto;events{worker_connections512;}http{upstreamECS{serverECS-POC-NODE1.ecspoc.local:9020;serverECS-POC-NODE2.ecspoc.local:9020;serverECS-POC-NODE3.ecspoc.local:9020;serverECS-POC-NODE4.ecspoc.local:9020;}server{listen*:9020;server_name*.ecspoc.local;location/{proxy_passhttp://ECS;proxy_set_headerHost$host;}}}

• Checkifconfigurationfileisvalid.$/usr/sbin/nginx-tnginx:theconfigurationfile/etc/nginx/nginx.confsyntaxisoknginx:configurationfile/etc/nginx/nginx.conftestissuccessful

• Reloadnginxconfig

$servicenginxrestart

MoreaboutnginxDirectives:http://wiki.nginx.org/Modules

Page 9: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

11

CheckaccesstoECSvialoadbalancer

• Inabrowsertypeloadbalancernamewith9020port.

• Checkthe“NoNamespaceForAnanymousRequest”errormessage.Thatiscorrectbehavior.

• AccessviaS3browsercanbecheckedaswell.

ConfigureCloudArraypart2

CreateCloudProvider

• Configurenewbucket.cabucket4.ecspoc.localshouldhaveIPaddressogtheloadbalancer.

• ConfigureCloudProviderthesamewayasitwasontheprevioustest.cabucket4shouldbe

specifiedastheBucket.

• FortestpurposesCompressionshouldbedisabled(enabledonscreenshots).

Page 10: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

12

• ConfigurePerformanceOptimizer

• Checktheresult

• ConfigureaccesstoECSwithS3browser.

• NavigatetoAccount>EditAccount

• StorageType=S3CompatibleStorage.

• RESTEndpoint=cabucket4.ecspoc.local

• AccessKeyID=S3userconfiguredonECS

• SecretAccessKey=S3userpasswordgeneratedforS3user

Page 11: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

13

• NavigatetoTools>Options>Connection.

• Uncheckusesecuretransfer(HTTPS).SSLwasnotusedinourtests.

• CheckifsomeobjectswerecreatedontheBucketusedbytheCloudArray.

ConfigureCache

• AddasecondHardDisktotheCloudArrayvirtualmachine

• 50Gbdiskinourcase

Page 12: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

14

• NavigatetoCacheManagement>CacheSources

• Scanforadditionalcachesources

• 49GBPool_1wasdiscovered

• Addcache

Page 13: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

15

• SelectPool_1asasource

• ChangeCachePageSizeto256KB.

Important,1MBdefaultPageSize(presentedonthescreenshot)canleadtoproblemswith

cachedraininginVMwareenvironment.AccordingtotheClouArraybestpracticedoc:“Cache

pagesgreaterthan1MBrequireaninternalsectorsizeof4KBratherthanthetypical512bytes.

Thelargersectorsizeisnotrecommendedfortransactionalworkloadssuchasdatabaseor

typicalfilesystemapplications.”But4Ksectorsizesaren’tcurrentlysupportedonESXi5.

• CheckSelectOneBigCacheUsingAllAvailableCapacity

• Bytheway,cacheisexpandableifothercachesourcesareavailable(notinourcase).

Page 14: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

16

ConfigurePolicy

• NavigatetoProvisioningPolicies

• SelectCacheandCloudProvider

Page 15: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

17

CloudArraylogs

• Incaseofanytroubles,pleasenavigatetoAdministration>SupportCaptureUtility>

GenerateSupportCapture

• Checkca_support.tgz>log>CloudArray.log

ConfigureNFS

• NavigatetoShares>Settings

• EnableNFS

Page 16: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

18

• CreatenewShare

• SelectPolicy

• SpecifyCapacity

Page 17: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

19

• AddClients

Page 18: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

20

• Makeavailable

• LoginwithsshtoaLinuxmachine.

• CheckthatNFSexportisaccessible.

$showmount-e10.10.201.63Exportlistfor10.10.201.63:/export*/export/1TBNFS

Page 19: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

21

• MountandcheckNFSexport.

$mkdir/NFSmnt$mount-tnfs10.10.201.63/export/backup/NFSmnt$df-hFilesystemSizeUsedAvailUse%Mountedon/dev/sda20G948M19G5%/udev119M4.0K119M1%/devtmpfs49M208K49M1%/runnone5.0M05.0M0%/run/locknone122M0122M0%/run/shm172.20.8.169/export/1TBNFS1024G70M492G0.01%/NFSmnt

• WritedatatoNFSexport.$cptest.txt/NFSmnt$ls/NFSmnttest.txt

ConfigureCIFS

• NavigatetoShares>Settings

• EnableCIFS

• SpecifyNameandDescription

• CheckAllowGuestAccessForCIFSShare

Page 20: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

22

• CreatenewCIFSShare

• SelectPolicy

• SpecifyCapacity

• MakeAvailable

• ReadOnly=No

• Browseable=Yes

• CheckRead-WriteGuest

Page 21: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

23

• LogintoWindowshost

• CheckCIFSShareavailability

• Checkreadandwrite

TestCloudArraybehavior

• Startwritingbigfiles

• NavigatetoDashboard

• CheckUsedandDirtycachecharacteristics(smoothlittlebitwavyincreasewithlater

decreaseareexpected).

Page 22: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

24

• CheckCloudTransferRate(saw-toothcurveisexpected)

TestreplicationbetweenECSs

• LoginwithS3browsertoECS1

• Checkthenumberofobject

• Checkthesizeofthebucket

• LoginwithS3browsertoECS2

• Checkthenumberofobjectinthesamebucket(shouldbethesamenumberasforECS1)

• Checkthesizeofthesamebucket(shouldbethesamesizeasforECS1)

Page 23: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

25

• ComparecapacityonECS1andECS2

• CurveonECS2shouldbemoresmoothcauseofECS1toECS2replicationnature

Page 24: ECS and Nginx LB and CloudArray - WordPress.com€¢ Check traffic distribution between ECS nodes • Traffic should be roughly similar (other load balancing technics should give better

26

CheckRoundrobinloadbalancing

• ChecktrafficdistributionbetweenECSnodes

• Trafficshouldberoughlysimilar(otherloadbalancingtechnicsshouldgivebetterbalancing)


Recommended