
ClusteringQuickInstallationGuide forPacketFenceversion6.0.0 ClusteringQuickInstallationGuide byInverseInc. Version6.0.0-Apr2016 Copyright©2015Inverseinc. Permissionisgrantedtocopy,distributeand/ormodifythisdocumentunderthetermsoftheGNUFreeDocumentationLicense,Version 1.2oranylaterversionpublishedbytheFreeSoftwareFoundation;withnoInvariantSections,noFront-CoverTexts,andnoBack-Cover Texts.Acopyofthelicenseisincludedinthesectionentitled"GNUFreeDocumentationLicense". ThefontsusedinthisguidearelicensedundertheSILOpenFontLicense,Version1.1.ThislicenseisavailablewithaFAQat:http:// scripts.sil.org/OFL Copyright©ŁukaszDziedzic,http://www.latofonts.com,withReservedFontName:"Lato". Copyright©RaphLevien,http://levien.com/,withReservedFontName:"Inconsolata". TableofContents AboutthisGuide.............................................................................................................. 1 Assumptions.....................................................................................................................2 InstallationonCentOS6................................................................................................... 3 Step1:Installthereplicateddatabase........................................................................ 3 Step2:Serverconfiguration..................................................................................... 9 InstallationonCentOS7................................................................................................. 11 Step1:Installthereplicateddatabase.......................................................................11 Step2:Serverconfiguration................................................................................... 17 Step3:Createanewcluster.................................................................................. 20 Step4:Connectaslavepacketfenceserver..............................................................22 Advancedconfiguration................................................................................................... 24 Removingaserverfromthecluster.......................................................................... 24 Resynchronizingtheconfigurationmanually.............................................................. 24 Addingfilestothesynchronization...........................................................................25 haproxydashboard..................................................................................................25 Unsupportedfeaturesinactive/active.......................................................................26 Appendix....................................................................................................................... 27 SettingtheinterfacesnameonCentOS7................................................................. 27 Copyright©2015Inverseinc. iii Chapter1 AboutthisGuide Thisguidehasbeencreatedtogiveaquickstarttoinstallactive/activeclusteringinPacketFence 5+.Thisguidedoesnotincludeadvancedtroubleshootingoftheactive/activeclustering.Referto thedocumentationofHAProxyandKeepaliveforadvancedfeatures. Copyright©2015Inverseinc. AboutthisGuide 1 Chapter2 Assumptions ▪ YouhaveatleasttwoserverswithafreshinstallofPacketFence5+ ▪ Bothserversareidenticalcopiesforthenetworkinterfaces ▪ BothserversarerunningCentOS6or7 ▪ Bothservershaveaccesstothesamelayer2networkonalltheirnetworkinterfaces ▪ Bothservershaveanempty,unformattedpartitionforthedatabase ▪ BothservershostnamemustberesolvableviaaDNSresolution Copyright©2015Inverseinc. Assumptions 2 Chapter3 InstallationonCentOS6 Step1:Installthereplicateddatabase Note Inthisexample,thedatabaseisreplicatedinactive/passiveacrosstwoserversthatare partofthePacketFencecluster.Active/activereplicationisalsopossibleusingMariaDB Galeraclusterbutthissubjectisnotcoveredinthisguide. InstallingDRBD CreationoftheDRBDpartition DuringtheOSinstallation,reducethesizeofthemainpartitionandcreateanewone(thatwill beusedforthereplicatedMySQLdatabase)of30G.Donotcreatethatpartitionduringtheinstall process,wewilldoitlater. Partitioning Aftertheinstallation,youneedtocreatetheextrapartitionforDRBD.Usingfdisk,createyournew partitionandsavethetable.Youwillprobablyneedtorebootyourserverafterthisstep. DRBDandLinux-HAInstallation AddtherepositoryELRepo. # yum localinstall http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm EdittherepofiletodisableELRepobydefault: /etc/yum.repos.d/elrepo.repo Copyright©2015Inverseinc. InstallationonCentOS6 3 Chapter3 [elrepo] name=ELRepo.org Community Enterprise Linux Repository - el6 baseurl=http://elrepo.org/linux/elrepo/el6/$basearch/ mirrorlist=http://elrepo.org/mirrors-elrepo.el6 enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org protect=0 InstallnowthepackageDRBDv8.4enabling. yum install kmod-drbd84 --enablerepo=elrepo DRBDConfigurationandsetup Caution Initializing,configuringandtroubleshootingDRBDisnotstraightforward!Westrongly recommendthatyoureadtheonlinedocumentationavailablefromtheDRBDwebsite soyouhaveabetterideaabouthowitworks. Hereweassumethenameofthepartitionismysql. LoadtheDRBDkernelmodule: modprobe drbd Edit/etc/drbd.d/global_common.confwiththefollowingcontent: global { usage-count yes; } common { protocol C; startup { degr-wfc-timeout 120; } syncer { rate 100M; al-extents 257; } disk { on-io-error detach; } } Copyright©2015Inverseinc. InstallationonCentOS6 4 Chapter3 Createthefile/etc/drbd.d/mysql.reswiththefollowingcontent: resource mysql { on <pf1_server_name> { device /dev/drbd0; disk <storage_device>; meta-disk internal; address <ha_interface_ip_address_1>:7788; } on <pf2_server_name> { device /dev/drbd0; disk <storage_device>; meta-disk internal; address <ha_interface_ip_address_2>:7788; } handlers { split-brain "/usr/lib/drbd/notify-split-brain.sh [email protected]"; } } where: ▪ mysqlisthenameofthepartitionyoucreatedwheninstallingtheOS ▪ pf1_server_nameandpf2_server_namebytherealservernames(FQDN) ▪ ha_interface_ip_address_1 and ha_interface_ip_address_2 by the IP addresses of the managementinterfaceonbothservers. ▪ storage_deviceisthedevicetousefortheMySQLpartition(ie./dev/sda2) Theninitializethepartition: [root@pf1 ~]# drbdadm create-md mysql Writing meta data... initializing activity log NOT initialized bitmap New drbd meta data block successfully created. success StartDRBDonbothservers: # /etc/init.d/drbd start Youshouldseesomethingsimilartothiswhentypingcat/proc/drbd: ... 0: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent C r---- ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:30702640 Note Ifyougetconnectivityissuesmakesureyouriptablesaredisabled. Copyright©2015Inverseinc. InstallationonCentOS6 5 Chapter3 Synchronizetheserversbyforcingonetobecometheprimary.Soonpf1do: # drbdadm primary --force mysql Afterissuingthiscommand,theinitialfullsynchronizationwillstart.Youwillbeabletomonitorits progressvia/proc/drbd.Itmaytakesometimedependingonthesizeofthedevice.Waituntil itcompletes. Whenthesynciscomplete,createthefilesystemontheprimarynodeonly: # mkfs.ext4 /dev/drbd0 MakesureDRBDisstartedatboottime: # chkconfig --level 2345 drbd on Restartbothservers. Whendone,lookin/proc/drbdandmakesureyousee: ... 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r--- ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0 MySQLConfiguration Firstyouneedtoensureitwillnotstartonboot: ```chkconfigmysqloff``` Note BydefaultMySQLputsitsdatain/var/lib/mysql.Inordertoreplicatedatabetween thetwoservers,wemounttheDRBDpartitionunder/var/lib/mysql. WhenfirststartingMySQL,thepartitionmustbemounted. Inordertodoso: Onthemasterserver(theserveryouareworkingon),tellDRBDtobecometheprimarynodewith: # drbdadm primary mysql mysqlbeingthenameoftheDRBDpartition. Thecommandcat /proc/drbdshoulddisplaysomethinglike: ... 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r---- ns:145068 nr:4448 dw:149516 dr:10490 al:31 bm:14 lo:0 pe:0 ua:0 ap:0 ep:1 wo:d oos:0 Copyright©2015Inverseinc. InstallationonCentOS6 6 Chapter3 StopandbackuppreviousMySQLdata # service mysqld stop # mkdir /var/lib/mysql.bak # mv /var/lib/mysql/* /var/lib/mysql.bak/ Mountthepartitionwith: # mount /dev/drbd0 /var/lib/mysql StartMySQL # service mysqld start Executethesecureinstallationscriptinordertosettherootpassword,removethetestdatabases andanonymoususercreatedbydefault: # /usr/bin/mysql_secure_installation MakesureMySQLdoesnotstartatboottime: # chkconfig --level 2345 mysqld off Heartbeatconfiguration InstalltheEPELrepository # yum localinstall http://dl.fedoraproject.org/pub/epel/6/x86_64/epel- release-6-8.noarch.rpm In/etc/yum.repos.d/epel.repo,disabletherepository [epel] name=Extra Packages for Enterprise Linux 6 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch failovermethod=priority enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 NowinstallHeartbeat # yum install heartbeat --enablerepo=epel Create/etc/ha.d/ha.cfwiththefollowingcontent: Copyright©2015Inverseinc. InstallationonCentOS6 7 Chapter3 bcast eth0 keepalive 2 warntime 30 deadtime 60 auto_failback off initdead 120 node pf1.example.com node pf2.example.com use_logd yes logfile /var/log/ha-log HereweassumethattheconnectionfortheHeartbeatbetweenthe2serversisoneth0.Make sureyouchangepf1.example.comandpf2.example.comtothehostnamesofyourservers. Create/etc/ha.d/haresourceswiththefollowingcontent: pf1.example.com drbddisk::mysql Filesystem::/dev/drbd0::/var/lib/mysql::ext4 \ mysqld Asforthepreviousfile,makesuretoadjusthostname,inthiscasepf1.example.com,accordingly
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages30 Page
-
File Size-