Trien Khai Failover Mail Server

  • Upload
    nam1504

  • View
    232

  • Download
    1

Embed Size (px)

Citation preview

  • 8/3/2019 Trien Khai Failover Mail Server

    1/70

    Exchange Database - Cluster Continuous Replication

    I- M HNH

    Cluster Continuous Replication

    My Domain(SERVER2k8)

    My Cluster CCRNode1 My Cluster CCRNode2

    Internal Public(Internal)

    Private(Cluster)

    Private(Cluster)

    Public(Internal)

    IP: 172.16.1.1/24 IP: 172.16.1.2 /24 IP: 192.168.1.10 /24 IP: 192.168.1.20 /24 IP: 172.16.1.3 /24

    P.DNS: 172.16.1.1 P.DNS: 172.16.1.1 P.DNS: 172.16.1.1

    My SERVER2k8 : nng cp domain v ci IIS 7 hon chnhMy CCRNode1 : join vo domain ca SERVER2k8My CCRNode2 : join vo domain ca SERVER2k8

  • 8/3/2019 Trien Khai Failover Mail Server

    2/70

    C 2 my CCRNode1 vCCRNode2 c ci gi lp a SCSI vi phn mm StarWind & Microsoft iSCSI SoftwareInitiator tham kho tihttp://nhatnghe.com/forum/showthread.php?t=41343

    II- GII THIU

    CCR (Cluster Continuous Replication): l c ch ng b d liu thng qua mt cluster gm 2 NodeServer chy lin tc vi nhau. y l mt c ch mi caExchange Server2007 c nhiu ngi s dng. N to ra 2 bn copy trn 2 server chy active v passive. D liu c ng b lin tc trong 2 con server chycluster vi nhau.CCR yu cu h thng a lu tr SCSI, iSCSI, SAS hoc SAN

    Trong phn II bi vit ny ti s gii thiu tnh nng CCR (Cluster ContinuousReplication) trong Exchage cch ci t v kim th tnh nng Cluster Failover Databases.

    III- CC BC TRIN KHAI

    1. Ci t Hub Server Role va Client Access trn my Domain 2. Ci t v cu hnh Failover Cluster Server

    3. Ci t Cluster Continuous Replication Databases

    4. Kim tra qu Failover Cluster Continuous Replication Databases

    IV- TRIN KHAI CHI TIT

    1. Ci t Hub Server Role va Client Access trn my Domain

    - Ci Power Shell cho my Domain. G lnh Servermanager I powershell

    - Ci t IIS7 Server Role v cc Role Services tng ng. Vo CMD g nhng lnh sau :

  • 8/3/2019 Trien Khai Failover Mail Server

    3/70

    ServerManagerCmd -i Web-Server

    ServerManagerCmd -i Web-ISAPI-Ext

    ServerManagerCmd -i Web-Metabase

    ServerManagerCmd -i Web-Lgcy-Mgmt-Console

    ServerManagerCmd -i Web-Basic-Auth

    ServerManagerCmd -i Web-Windows-Auth

    - Ci t Hub Server Role v Client Access Server Role. Phin bn ci t l Exchange2007 SP1. Chy file Setup.exe

  • 8/3/2019 Trien Khai Failover Mail Server

    4/70

    - Chn Install Microsoft Exchange Server 2007

  • 8/3/2019 Trien Khai Failover Mail Server

    5/70

    - Chn I accept Next

  • 8/3/2019 Trien Khai Failover Mail Server

    6/70

    - Chn Custom Exchange ServerInstallation Next

  • 8/3/2019 Trien Khai Failover Mail Server

    7/70

    - Chn Client Access Role v Hub Transport Role NextFinish

    Hon tt phn ci Hub v Client Access Role.

    2. Ci t v cu hnh Failover Cluster Server cho c 2 my CCRNode1 v CCRNode2

    - gi lp a SCSI cho a E nhm cha Database vF cha Log bng phn mmphn mm StarWind & Microsoft iSCSI SoftwareInitiator tham khoti http://nhatnghe.com/forum/showthread.php?t=41343

  • 8/3/2019 Trien Khai Failover Mail Server

    8/70

    - Ci Web Server (IIS) ,PowerShell , Fail-Over Clustering. Vo CMD ln lt g cc lnh

    ServerManagerCmd -i PowerShell

    ServerManagerCmd -i Failover-Clustering

    ServerManagerCmd -i Web-Server

    ServerManagerCmd -i Web-ISAPI-Ext

    ServerManagerCmd -i Web-Metabase

    ServerManagerCmd -i Web-Lgcy-Mgmt-Console

    ServerManagerCmd -i Web-Basic-Auth

    ServerManagerCmd -i Web-Windows-Auth

  • 8/3/2019 Trien Khai Failover Mail Server

    9/70

    - t IP v xc nh interface Public ni vi Network Domain v interfacePrivate ni ring 2 my Cluster Server vi nhau. B checkIPv6.

  • 8/3/2019 Trien Khai Failover Mail Server

    10/70

    - B chn Append parent suffixes of the primary DNS suffixes v Register thisconnections addresses in DNS

  • 8/3/2019 Trien Khai Failover Mail Server

    11/70

    - Chn tab WINS v hy chn Enable LMHOSTS lookup, chn Disable NetBIOS overTCP/IP

  • 8/3/2019 Trien Khai Failover Mail Server

    12/70

    - M chng trnh Failover Cluster Manager trong Administrator Tools. Chn Create aCluster

  • 8/3/2019 Trien Khai Failover Mail Server

    13/70

    - Chn Next

  • 8/3/2019 Trien Khai Failover Mail Server

    14/70

    - Chn Browse chn 2 my CCRNode1 vCCRNode2 cu hnh 2 my ny chy Failover Cluster. Chn Next

  • 8/3/2019 Trien Khai Failover Mail Server

    15/70

    - Chn Yes Next

  • 8/3/2019 Trien Khai Failover Mail Server

    16/70

    - Chn tn Server Cluster: CCRCluster v check chn Net 172.16.1.0/24 t Virtual IP:172.16.1.100 Next

  • 8/3/2019 Trien Khai Failover Mail Server

    17/70

    - Chn Next

  • 8/3/2019 Trien Khai Failover Mail Server

    18/70

    - Chn Finish hon thnh vic cu hnh Failover Cluster Server.

  • 8/3/2019 Trien Khai Failover Mail Server

    19/70

    - Chn Network kim tra 2 Network Cluster xem Status Up thnh cng cha.

  • 8/3/2019 Trien Khai Failover Mail Server

    20/70

    - Xem Network 2 (Private) Status cng Up

  • 8/3/2019 Trien Khai Failover Mail Server

    21/70

    - Cu hnh Cluster Qourum Settings Failover ClusterManager. To mt file chia s trn my ch ring bit (tt nht l s dng my ch HubTransport trong cngAD vi cc nt failovercluster). Vo my Domain Controler g lnh theo mn hnh sau

  • 8/3/2019 Trien Khai Failover Mail Server

    22/70

    - M Failover Cluster Management trn my CCRNode1 kch vo More Actions trong ActionPane, chn Configure Cluster Quorum Settings

    - Chn Next

  • 8/3/2019 Trien Khai Failover Mail Server

    23/70

    - Chn Quorum Configuration, chn Node and File Share Majority (for clusters with specialconfigurations) sau kch Next

  • 8/3/2019 Trien Khai Failover Mail Server

    24/70

    - G vo th mc Share trn my DC trn

  • 8/3/2019 Trien Khai Failover Mail Server

    25/70

    - Chn Next

  • 8/3/2019 Trien Khai Failover Mail Server

    26/70

    - Chn Finish hon tt cu hnh Cluster Quorum

  • 8/3/2019 Trien Khai Failover Mail Server

    27/70

    3. Ci t Cluster Continuous Replication Databases

    - Ci t Active Clustered Mailbox Role trn my CCRNode1.B a ci t Exchange chy file Setup.exe.

  • 8/3/2019 Trien Khai Failover Mail Server

    28/70

    - Chn Custom Exchange ServerInstallation

  • 8/3/2019 Trien Khai Failover Mail Server

    29/70

    - Chn Active Clustered Mailbox Role

  • 8/3/2019 Trien Khai Failover Mail Server

    30/70

    - Chn Next Finish hon tt vic ci Active Clustered Mailbox Role

  • 8/3/2019 Trien Khai Failover Mail Server

    31/70

    - Tng t ci t Passive Clustered MailBox Role vo my CCRNode2

  • 8/3/2019 Trien Khai Failover Mail Server

    32/70

    - Chn Next Finish hon tt Passive Clustered MailBox Role

  • 8/3/2019 Trien Khai Failover Mail Server

    33/70

    5. Kim tra qu Failover Cluster Continuous Replication Databases

    - M Exchange Manager Console kim tra tnh trng Failover Cluster ContinuousReplication Databases. To ra mt Mailbox Database kim tra.

  • 8/3/2019 Trien Khai Failover Mail Server

    34/70

    - t tn Database

  • 8/3/2019 Trien Khai Failover Mail Server

    35/70

    - Vo Server Configuration Mailbox Xem thng tin ca Mailbox Group

  • 8/3/2019 Trien Khai Failover Mail Server

    36/70

    - Qua tab Clustered Mailbox Server s thy tnh trng Online v CCNode1 Active vCCRNode2 Passive.

  • 8/3/2019 Trien Khai Failover Mail Server

    37/70

    - To ra 2 user mailbox trn Database Nhatnghe mi to ra v gi mail qua li kimtra tnh trng hot ng ca Replication

  • 8/3/2019 Trien Khai Failover Mail Server

    38/70

    - Kim tra d liu trn 2 Server CCRNode1 v CCRNode2. Ta nhn thy rng cc filelog v file edb c ng b mt cch lin tc vi cc gi tr size ging nhau. M c2 th mc cha Database Nhatnghe s thy d liu t ng Replication c 2 ServerCCRNode1 v CCRNode2.

  • 8/3/2019 Trien Khai Failover Mail Server

    39/70

    - Gi nh Shutdown my CCRNode1 xem nh DatabaseActive khng hot ng na. M Exchange vo Server

    Configuration

    Mailbox

    Xem thng tinca Mailbox Groups thy CCRNode2 t ng Failover chuyn thnh Active Database

  • 8/3/2019 Trien Khai Failover Mail Server

    40/70

    - M mail ca cc User vn hot ng bnh thng

  • 8/3/2019 Trien Khai Failover Mail Server

    41/70

    - M Server CCRNode1 tr li bnh thng. Vo kim tra tnh trng Failover Cluster

    Continuous ReplicationDatabases vn tip tc hot ng bnh thng vchuyn CCRNode2 sang Active vCCRNode1 Passive

  • 8/3/2019 Trien Khai Failover Mail Server

    42/70

    Ht.

    Trn Trng Tun Ging vin Nht Ngh

    Exchange Database - Local Continuous Replication

    I- M HNH

  • 8/3/2019 Trien Khai Failover Mail Server

    43/70

    Figure 1 - Single Copy Clusters Figure 2 - Cluster Continuous Replication

    II- GII THIU

    Nh ban bit trong san phm Exchange Server 2007 cung cp kha nng chiu li v nh snsng cao vi cc c ch ng b d liu gia cc Database Mailbox hay cc Server chay Clustering vi

    nhau gm c cc giai php sau :

    + LCR (Local Connuous Replicaon) : l c ch ng b d liu mailbox database cua Exchangenm cng trn mt Server. Cc Storage Group Database se t sinh ra 2 ban ng b d liu lin tuc chonhau theo c ch Acve v Passive. Moi thay i d liu t DB acve se u c t ng ng bsang DB passive

    + CCR (Cluster Connuous Replicaon) : l c ch ng b d liu thng qua mt cluster gm 2Node Server chay lin tuc vi nhau. y l mt c ch mi cua Exchange Server 2007 c nhiu

  • 8/3/2019 Trien Khai Failover Mail Server

    44/70

    ngi s dung. N tao ra 2 ban copy trn 2 server chay acve v passive. D liu c ng b lin tuctrong 2 con server chay cluster vi nhau. CCR yu cu h thng a lu tr SCSI, iSCSI, SAS hoc SAN

    + SCC (Single Copy Cluster) : y l c ch cluster 2 server Exchange cng chay v chia se trncng mt h thng lu tr databases. SCC cng yu cu v h thng a lu tr ging CCR nh SCSI,iSCSI, SAS hoc SAN. Nhng trng hp ny nu Database bi hong m khng c Backup d liu th

    khng th phuc hi c.

    Trong phn I bi vit ny ti se gii thiu nh nng LCR (Local Continuous Replication) trongExchage vi c ch a iSCSI ao bng phn mm StarWind vMicroso iSCSI Soware Iniator . Trongloat bi vit k p ti se gii thiu v nh nng CCR v SCC.

    III- CC BC TRIN KHAI

    Gia inh ci t hon chinh phin ban Exchange Server 2007 trn h iu hnh Windows Server2003 SP2. Ban c th tham khao thm cc bc ci t Exchange tai ia

    chihttp://msopenlab.com/index.php?article=89

    1. Ci t v cu hnh StarWind

    2. Ci t v cu hnh Microsoft iSCSI Software Initiator

    3. Cu hnh LCR trn Storage Group Databases

    4. Gia lp hong Database Acve v khi phuc lai t Database Passive

    IV- TRIN KHAI CHI TIT

    1. Cu hnh Starwind tai 1 my workgroup.

    Mc ch: Gia lp to ra 1 hoc nhiu a dynamic dng chung cho cluster Server

    Sau khi ci t Starwind. cc bn tin hnh to Image file nh sau:

    - Start->All Programs->Rocket Division Soware->StarWind->StarWind. StarWind icon se xut hin

    traybar. Double-click vo biu tng cu hnh chon Start Management menu option.

  • 8/3/2019 Trien Khai Failover Mail Server

    45/70

    - Click Connect vo Localhost:

    Nhp username v pass connect. Mc nh username v pass u l test

    - Sau khi connect thnh cng, chng ta to a o bng cch: Add Device.

  • 8/3/2019 Trien Khai Failover Mail Server

    46/70

    - Chn:Image File device.

  • 8/3/2019 Trien Khai Failover Mail Server

    47/70

    - Cc bn chn Create new image

    - Bn cung cp ng dn/tn_file.img to mi. Ch cung cp thng tin v dung lng a cho

    phn mm.

  • 8/3/2019 Trien Khai Failover Mail Server

    48/70

    - Tip theo, cc bn ch phi check vo : Allow multiple connections

  • 8/3/2019 Trien Khai Failover Mail Server

    49/70

    - Cung cp thng tin cho a o - Khng quan trng lm:

    - Click Next, chn Finish l xong.

    Tng t cho vic gn thm mt Disk 2 vo trong mt Cluster. Kt qua nh sau

  • 8/3/2019 Trien Khai Failover Mail Server

    50/70

    2. Ci t Microsoft iSCSI Software Initiator

    Muc ch nhm kt ni n my ci StartWind inh ngha c ch a iSCSI.

    Sau khi ci t iSCSI, cc bn lm nh sau h iu hnh tm thy a to bc trc:

    - Start->All Programs->Microsoft iSCSIInitiator-> Microsoft iSCSIInitiator.

    - Chn Discovery tab. Chng ta s add computer ci t StarWind. Click the Add

  • 8/3/2019 Trien Khai Failover Mail Server

    51/70

    - G vo IP address ca my ci Starwind v port. Mc nh l 3260

    - Sau chuyn ti Targets tab. Chng ta s thy hin ra cc image to my Starwind lc trc.

  • 8/3/2019 Trien Khai Failover Mail Server

    52/70

    - Bn chn image cn thit, ri nhn vo Logon. Ch check vo option:

    Automatically restore this connection when the system boots

    - Cc bn s thy a image c connect

  • 8/3/2019 Trien Khai Failover Mail Server

    53/70

    - Cui cng, cc bn hy vo Disk Manager Create Partion, Format cng nh bnhthng Basic Disk

  • 8/3/2019 Trien Khai Failover Mail Server

    54/70

    Download phn mm Starwind t trang

    web: http://www.rocketdivision.com/download_starwind.html hoc link sau:

    (Cc bn hy down bn Pro, dng th 30 ngy u ban Test Lab ri)

    V download Microsoft iSCSI Software Initiator t website ca

    Microsoft: http://www.microsoft.com/downloads/d...DisplayLang=en

    3. Cu hnh LCR trn Storage Group Databases

    - Chun b 2 th mc NhatNghe Storage Group trn a E:\ (y s l DatabaseActive chnh hot ng) v th mc NhatNghe Storage Group LCR trn a F:\ (y

    s l ni ch Database Passive c ng b d liu vo)

    - M chng trnh qun l Exchange Managerment Console ServerConfiguration Mailbox Click phi chut to mt Storage Group mi

  • 8/3/2019 Trien Khai Failover Mail Server

    55/70

    - Chn New Storage Group

  • 8/3/2019 Trien Khai Failover Mail Server

    56/70

    - Check vo Enable local continuous replication sau nht nt Browse chn theohnh trn. Nhn Next

    - Finish hon tt vic to NhatNghe Storage bt chc nng LCR

  • 8/3/2019 Trien Khai Failover Mail Server

    57/70

    - Nhn phi chut vo Nhatnghe SG chn New Mailbox Database

  • 8/3/2019 Trien Khai Failover Mail Server

    58/70

    - t tn Mailbox Database ri nhn Browse tr v Database Active v Database LCR(Passive) New Finish

    - Kim tra tnh trng ca NhatNghe Storage Group trong ct Copy Status l Healthyth h thng kch hot thnh cng c ch LCR

    4. Gia lp hong Database Acve v khi phuc lai t Database Passive

    - To ra 2 user mailbox trn Database Nhatnghe mi to ra v gi mail qua li kimtra tnh trng hot ng ca Replication

  • 8/3/2019 Trien Khai Failover Mail Server

    59/70

    - Kim tra d liu trn 2 a cu hnh Database Replication. Ta nhn thy rng ccfile log v file edb c ng b mt cch lin tc vi cc gi tr size ging nhau.

  • 8/3/2019 Trien Khai Failover Mail Server

    60/70

    - Stop Services MS Exchange Information Store can thip ph hu Database bngcch m file EDB ln g thm vi ni dung vo.

  • 8/3/2019 Trien Khai Failover Mail Server

    61/70

    - Sau Start li Services MS Exchange Information Store xong vo phn qun lMailbox Database ca Exchange ta nhn thy tnh trng b Dismout Database b li.

    - V d bn c Mount li cng s nhn c thng bo li.

  • 8/3/2019 Trien Khai Failover Mail Server

    62/70

    - By gi ta chuyn vo a F:\ ang cha nhng file Database Passvise ang cng b ri copy vo ton b vo Database Active ang b hng

    - Sau Mount li Database li th s thy hot ng bnh thng

  • 8/3/2019 Trien Khai Failover Mail Server

    63/70

    - M mail kim tra thy d liu vn y .

    Ht.

    Trn Trng Tun Ging vin Nht Ngh

    \

  • 8/3/2019 Trien Khai Failover Mail Server

    64/70

    Installing the Database on the Mirrored Server

    Start at this step for a normal database.

    In order to get the database onto the mirrored server, we do a full backup of the ASPState(or the database you are mirroring) on the Principal server, followed by a backup of theTransaction Log.

    y Perform a full backup of the database on the Principal server.y Perform a Transaction Log backup on the Principal server.y Copy the backup file to the Mirror.y Important: Do a restore of the full backup into a new step, but before doing the

    restore, go to Options, then ensure you check the No Recovery option! This isvital!

    y Perform another restore of the Transaction Log, also with the NoRecovery option. (This is important, otherwise you'll get an error when starting themirror - See Gotchas section for explanation).

    You'll notice that the database on the Mirror server now is marked as "Restoring..." andcan't be accessed. This is normal and expected! This confused me for quite some time,thinking that it was incorrect.

  • 8/3/2019 Trien Khai Failover Mail Server

    65/70

    The Mirror is always in a permanent Restoring state to prevent users accessing thedatabase, but will be receiving synchronization data. If the database fails over to the Mirror,then it will become an active database and the old Principal will go into the Recoveringstate.

    Step 3 - Setting the SQL Server Service Impersonation

    By default, and in most installations, the SQL Server Service in the Services applet runs asthe Local System account. However, for mirroring to work, this needs to be changed to alocal user. The Local System account does not have access to the network resources, so isunable to communicate with the mirrored server through the endpoint. It's vital thatthis step is completed, since I spent many an hour wondering why the mirroring wasn't

    working.

    y Create a local user on both the Principal and the Mirror server with the sameusername and password. For example, "sqluser".

    y Edit the SQL Server Service and change the Logon to this user.y Do the same for the SQL Server Agent service.y Change the SQL Server Agent service to be Automatic.y Re-start the SQL Server Service and then the SQL Agent service.y Do this on both the Principal and the Mirror!

    It's important that the SQL Agent is also running. Because:

    a. it runs automated backup jobs andb. it expires the sessions in ASP

    If you find that ASP.NET sessions are not being expired in the ASPState database, thenit's because the SQLAgent service is not running.

    Sometimes, you may find that the SQL Agent does not start. This can be resolved by re-starting the SQL Server Service and then the SQL Agent again.

  • 8/3/2019 Trien Khai Failover Mail Server

    66/70

    Create a SQL Login on both SQL Servers for this user you created.

    Step 4 - Setting Up the Mirror

    Now, it's time to actually setup the mirror! Go to the Database Properties on the ASPStatedatabase (or your database), and choose the Mirroring tab.

    Ifthe Mirror tab does not appear in SQL Server 2008, then re-run the setup and ensureyou've ticked the Complete SQL Tools options.

  • 8/3/2019 Trien Khai Failover Mail Server

    67/70

    y Click "Configure Security"y Click Next on the wizardy Choose whether you want a Witness server or not, (this article does not cover

    Witness servers) and click Nexty In the Principal Server Instance stage, leave everything as its default (you can't

    change anything anyway)

    In the Mirror Server Instance stage, choose your Mirror server from the dropdown and clickConnect to provide the credentials. Click Next.

  • 8/3/2019 Trien Khai Failover Mail Server

    68/70

    y In the next dialog about Service Accounts, leave these blank (you only need to fillthem in if the servers are in a domain or in trusted domains)

    y Click Next and Finishy Click "Do not start mirroring"y Enter in the FQDN of the servers if you want, but this is not necessary (as long as it

    will resolve)y Click Start Mirroring (if you do not have a FQDN entered, then a warning will

    appear, but you can ignore it)y The mirror should then start, and within moments, the Status should be

    "synchronized: the databases are fully synchronized"

  • 8/3/2019 Trien Khai Failover Mail Server

    69/70

    So, you should now have a working mirror! Perform a manual failover to test it. Follow the

    instructions below in "Doing a manual failover".

    Here's what a working mirror setup looks like on the Principal:

    And, here's what it looks like on the Mirror:

  • 8/3/2019 Trien Khai Failover Mail Server

    70/70