You are on page 1of 47

Exchange Database - Cluster Continuous Replication

I- M HNH

Figure 1 - Cluster Continuous Replication
Domain
(SERVER2k8)
Cluster CCRNode1


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

May SERVER2k8 : D nng cp domain va cai IIS 7 hon chnh
May CCRNode1 : D join vao domain cua SERVER2k8
May CCRNode2 : D join vao domain cua SERVER2k8
Ca 2 may CCRNode1 va CCRNode2 d duoc cai gia lp dia SCSI voi phn mm StarWind &
Microsoft iSCSI Software Initiator.
II- GII THIU
CCR (Cluster Continuous Replication): la co ch dng b du liu thng qua mt cluster gm
2 Node Server chay lin tuc voi nhau. Dy la mt co ch moi cua Exchange Server 2007 duoc
nhiu nguoi su dung. No tao ra 2 ban copy trn 2 server chay active va passive. Du liu duoc
dng b lin tuc trong 2 con server chay cluster voi nhau. CCR yu cu h thng dia luu tru
SCSI, iSCSI, SAS hoc SAN.
Trong bai vit nay ti s gioi thiu tinh nng CCR (Cluster Continuous Replication) trong
Exchage cach cai dt va kim thu tinh nng Cluster Failover Databases.
III- CC BC TRIN KHAI
1. C H R C A Domain
2. C Failover Cluster Server
3. C Cluster Continuous Replication Databases
4. K C C R D
IV- TRIN KHAI CHI TIT

1. C H R C A Domain
- Cai Power Shell cho may Domain. G lnh Servermanager I powershell

- Cai dt IIS7 Server Role va cac Role Services tuong ung. Vao CMD
g nhung lnh sau :
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

- Cai dt Hub Server Role va Client Access Server Role. Phin ban cai dt la
Exchange 2007 SP1. Chay file Setup.exe

- Chon Install Microsoft Exchange Server 2007

- Chon I accept Next

- Chon Custom Exchange Server Installation Next

- Chon Client Access Role va Hub Transport Role Next Finish
Hoan tt phn cai Hub va Client Access Role.
2. C C CCRN
CCRNode2
- D gia lp dia SCSI cho dia E nhm chua Database va F chua Log bng phn mm
phn mm StarWind & MicrosoIt iSCSI SoItware Initiator.
- Cai Web Server (IIS), PowerShell, Fail-Over
Clustering.Vao CMD ln luot g cac 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


- Dt IP va xac dinh interIace Public d ni voi Network Domain va interIace
Private ni ring 2 may Cluster Server voi nhau. Bo check IPv6.

- Bo chon Append parent suffixes of the primary DNS suffixes v Register this
DN

- Chon tab WINS v huy chon Enable LMHOSTS lookup, chon Disable NetBIOS
over TCP/IP

- Mo chuong trinh Failover Cluster Manager trong Administrator
Tools. Chon Create a Cluster

- Chon Next

- Chon Browse chon 2 may CCRNode1 va
CCRNode2 d cu hinh 2 may nay chay Failover Cluster. Chon Next

- Chon Yes Next

- Chon tn Server Cluster : CCRCluster va check chon Net 172.16.1.0/24 dt Virtual
IP : 172.16.1.100 Next

- Chon Next

- Chon Finish d hoan thanh vic cu hinh Failover Cluster Server.


- Chon Network kim tra 2 Network Cluster xem Status d Up thanh cng chua.

- Xem Network 2 (Private) Status cung d Up

- Cu hinh Cluster Qourum Settings Failover Cluster Manager. Tao mt Iile chia s
trn may chu ring bit (tt nht la su dung may chu Hub Transport trong cungAD voi
cac nut Iailover cluster).Vao may Domain Controler g lnh theo man hinh sau:

- Mo Failover Cluster Management trn may CCRNode1 kch vo More Actions
trong Action Pane, chon Configure Cluster Quorum Settings

- Chon Next

- Chon Quorum Configuration, chon Node and File Share Majority (for clusters with
special configurations) sau do kch Next

- G vao thu muc Share trn may DC o trn

- Chon Next

- Chon Finish d hoan tt cu hinh Cluster Quorum

3. C Cluster Continuous Replication Databases
- Cai dt Active Clustered Mailbox Role trn may CCRNode1.
Bo dia cai dt Exchange chay file Setup.exe.

- Chon Custom Exchange Server Installation

- Chon Active Clustered Mailbox Role


- Chon Next Finish d hoan tt vic cai Active Clustered Mailbox Role

- Tuong tu cai dt Passive Clustered MailBox Role vao may CCRNode2

- Chon Next Finish d hoan tt Passive Clustered MailBox Role

5. K C C R D
- Mo Exchange Manager Console d kim tra tinh trang Failover Cluster Continuous
Replication Databases. Tao ra mt Mailbox Database d kim tra.

- Dt tn Database

- Vao Server ConIiguration Mailbox Xem thng tin cua Mailbox Group

- Qua tab Clustered Mailbox Server s thy tinh trang Online va CCNode1 Active va
CCRNode2 Passive.

- Tao ra 2 user mailbox trn Database Nhatnghe moi tao ra va gui mail qua lai d
kim tra tinh trang hoat dng cua Replication



- Kim tra du liu trn 2 Server CCRNode1 va CCRNode2. Ta nhn thy rng cac
Iile log va Iile edb duoc dng b mt cach lin tuc voi cac gia tri size ging nhau. Mo
ca 2 thu muc chua Database Nhatnghe s thy du liu tu dng Replication o ca 2
Server CCRNode1 va CCRNode2.

- Gia dinh Shutdown may CCRNode1 xem nhu Database Active khng hoat dng
nua. Mo Exchange vao Server ConIiguration ~ Mailbox ~ Xem thng tincua
Mailbox Group s thy CCRNode2 tu dng Failover chuyn thanh Active Database.

- Mo mail cua cac User vn hoat dng binh thuong


- Mo Server CCRNode1 tro lai binh thuong. Vao kim tra tinh trang Failover
Cluster Continuous Replication
Databases vn tip tuc hoat dng binh thuong vachuyn CCRNode2 sang Active va
CCRNode1 Passive

Exchange Database - Local Continuous Replication

I- M HNH

Figure 2 - Single Copy Clusters

Figure 3 - Cluster Continuous Replication

II- GII THIU
Nhu ban d bit trong san phm Exchange Server 2007 cung cp kha nng chiu li va
tinh sn sang cao voi cac co ch dng b du liu giua cac Database Mailbox hay cac Server
chay Clustering voi nhau gm co cac giai phap sau :
LCR (Local Continuous Replication) : la co ch dng b du liu mailbox database
cua Exchange nm cung trn mt Server. Cac Storage Group Database s tu sinh ra 2 ban
dng b du liu lin tuc cho nhau theo co ch Active va Passive. Moi thay di du liu tu DB
active s du duoc tu dng dng b sang DB passive
CCR (Cluster Continuous Replication) : la co ch dng b du liu thng qua mt
cluster gm 2 Node Server chay lin tuc voi nhau. Dy la mt co ch moi cua Exchange
Server 2007 duoc nhiu nguoi su dung. No tao ra 2 ban copy trn 2 server chay active va
passive. Du liu duoc dng b lin tuc trong 2 con server chay cluster voi nhau. CCR yu cu
h thng dia luu tru SCSI, iSCSI, SAS hoc SAN
SCC (Single Copy Cluster) : dy la co ch cluster 2 server Exchange cung chay va
chia s trn cung mt h thng luu tru databases. SCC cung yu cu v h thng dia luu tru
ging CCR nhu SCSI, iSCSI, SAS hoc SAN. Nhung o truong hop nay nu Database bi hong
ma khng co Backup du liu thi khng th phuc hi duoc.
Trong phn trn bai vit nay ti s gioi thiu tinh nng LCR (Local Continuous
Replication) trong Exchage voi co ch dia iSCSI ao bng phn mm StarWind vaMicrosoIt
iSCSI Software Initiator . Trong loat bai vit k tip ti s gioi thiu v tinh nng CCR va
SCC.
III- CC BC TRIN KHAI
Gia dinh d cai dt hoan chnh phin ban Exchange Server 2007 trn h diu hanh
Windows Server 2003 SP2. Ban co th tham khao thm cac buoc cai dt Exchange
C
1. C Microsoft iSCSI Software Initiator
2. C CR G D
3. G D A D
IV- TRIN KHAI CHI TIT
C
Muc dich: Gia lp d tao ra 1 hoc nhiu dia dynamic dung chung cho cluster Server
Sau khi cai dt Starwind. cac ban tin hanh tao Image Iile nhu sau:
- Start-~All Programs-~Rocket Division SoItware-~StarWind-~StarWind. StarWind icon s
xut hin o traybar. Double-click vao biu tuong d cu hinh chon Start Management menu
option.

- Click Connect vo Localhost:

Nhp username va pass d connect. Mc dinh username va pass du la test

- Sau khi connect thanh cng, chung ta tao dia ao bng cach: Add Device.

- Chon: Image File device.

- Cac ban chon Create new image

- Ban cung cp duong dn/tnIile.img d tao moi. Chu y cung cp thng tin v dung luong
dia cho phn mm.

- Tip theo, cac ban chu y phai check vao : Allow multiple connections

- Cung cp thng tin cho dia ao - Khng quan trong lm:

- Click Next, chon Finish la xong. Tuong tu cho vic gn thm mt Disk 2 vao trong mt
Cluster. Kt qua nhu sau

C f CI f I
Muc dich nhm kt ni dn may cai StartWind dinh nghia co ch dia iSCSI.
Sau khi cai dt iSCSI, cac ban lam nhu sau d h diu hanh tim thy dia d tao o buoc
truoc:
- Start->All Programs->Microsoft iSCSI Initiator-> Microsoft iSCSI Initiator.
- Chon Discovery tab. Chung ta s add computer d cai dt StarWind. Click the
Add

- G vao IP address cua may cai Starwind va port. Mc dinh la 3260

- Sau do chuyn toi Targets tab. Chung ta s thy hin ra cac image d tao o may Starwind luc
truoc.

- Ban chon image cn thit, ri nhn vao Logon. Chu y check vao option: Automatically
restore this connection when the system boots

- Cac ban s thy dia image d duoc connect

- Cui cung, cac ban hy vao Disk Manager d Create Partion, Format cung nhu binh
thuong Basic Disk

Download phn mm Starwind tu trang Web:
http://www.rocketdivision.com/download_starwind.html hoc link sau: (Cac ban hy down
ban Pro, dung thu 30 ngay du d ban Test Lab ri). V download Microsoft iSCSI Software
Initiator tu website cua MicrosoIt: http://www.microsoft.com/downloads/d...DisplayLang=en
3. C CR G D

- Chun bi 2 thu muc NhatNghe Storage Group trn dia E:\ (dy s la Database
Active chinh hoat dng) va thu muc NhatNghe Storage Group LCR trn dia F:\ (dy s
la noi chu Database Passive duoc dng b du liu vao)
- Mo chuong trinh quan ly Exchange Managerment Console Server
Configuration Mailbox Click phai chut tao mt Storage Group moi

- Chon New Storage Group

- Check vao Enable local continuous replication sau do nht nut Browse
chon theo hinh trn. Nhn Next

- Finish d hoan tt vic tao NhatNghe Storage d bt chuc nng LCR

- Nhn phai chut vao Nhatnghe SG chon New Mailbox Database

- Dt tn Mailbox Database ri nhn Browse tro v Database Active va Database
LCR (Passive) New Finish

- Kim tra tinh trang cua NhatNghe Storage Group trong ct Copy Status la Healthy
thi h thng d kich hoat thanh cng co ch LCR

4. G D A D
- Tao ra 2 user mailbox trn Database Nhatnghe moi tao ra va gui mail qua lai d
kim tra tinh trang hoat dng cua Replication



- Kim tra du liu trn 2 dia cu hinh Database Replication. Ta nhn thy rng cac
Iile log va Iile edb duoc dng b mt cach lin tuc voi cac gia tri size ging nhau.


- Stop Services MS Exchange InIormation Store d can thip pha huy Database
bng cach mo Iile EDB ln g thm vai ni dung vao.

- Sau do Start lai Services MS Exchange InIormation Store xong vao phn quan ly
Mailbox Database cua Exchange ta nhn thy tinh trang bi Dismout Database bi li.

- Va du ban co Mount lai cung s nhn duoc thng bao li.

- By gio ta chuyn vao dia F:\ dang chua nhung Iile Database Passvise dang
duoc dng b ri copy de vao toan b vao Database Active dang bi hong

- Sau do Mount lai Database lai thi s thy hoat dng binh thuong

- Mo mail kim tra thy du liu vn dy du.
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 the
Transaction Log.
Perform a full backup of the database on the Principal server.
Perform a Transaction Log backup on the Principal server.
Copy the backup file to the Mirror.
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 is vital!
Perform another restore of the Transaction Log, also with the No Recovery option.
(This is important, otherwise you'll get an error when starting the mirror - See Gotchas
section for explanation).

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

The Mirror is always in a permanent Restoring state to prevent users accessing the database,
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 Recovering state.
Step 3 - Setting the SQL Server Service Impersonation
By default, and in most installations, the SQL Server Service in the Services applet runs as
the Local System account. However, for mirroring to work, this needs to be changed to a
local user. The Local System account does not have access to the network resources, so is
unable to communicate with the mirrored server through the endpoint. It's vital that
this step is completed, since I spent many an hour wondering why the mirroring wasn't
working.
Create a local user on both the Principal and the Mirror server with the same username
and password. For example, "sqluser".
Edit the SQL Server Service and change the Logon to this user.
Do the same for the SQL Server Agent service.
Change the SQL Server Agent service to be Automatic.
Re-start the SQL Server Service and then the SQL Agent service.
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 and
b. it expires the sessions in ASP
If you find that ASP.NET sessions are not being expired in the ASPState database, then it'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.
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 ASPState
database (or your database), and choose the Mirroring tab.
If the Mirror tab does not appear in SQL Server 2008, then re-run the setup and ensure
you've ticked the Complete SQL Tools options.

Click "Configure Security"
Click Next on the wizard
Choose whether you want a Witness server or not, (this article does not cover Witness
servers) and click Next
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 click
Connect to provide the credentials. Click Next.

In the next dialog about Service Accounts, leave these blank (you only need to fill
them in if the servers are in a domain or in trusted domains)
Click Next and Finish
Click "Do not start mirroring"
Enter in the FQDN of the servers if you want, but this is not necessary (as long as it
will resolve)
Click Start Mirroring (if you do not have a FQDN entered, then a warning will
appear, but you can ignore it)
The mirror should then start, and within moments, the Status should be
"synchronized: the databases are fully synchronized"

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: