BQ GLAD DVC VA DAO T$0<br />
TRUONGDS1 HQC MANG LONG<br />
<br />
KHOA LUAN TOT NGHIEP<br />
<br />
DE TAI: TIM HIEU HE THONG MAY CHU CAN<br />
BANG TAI<br />
<br />
Ciao vien hirfrng gin<br />
Sinh vien thyc hien<br />
Ma sinh vien<br />
Chuyen ngInh<br />
<br />
Ts.Pham Thanh Giang<br />
DO Van Thinh<br />
A13439<br />
CONG NGHt THONG TIN<br />
<br />
HA NQI — 2013<br />
2<br />
<br />
MAY CHU CAN BANG TAI<br />
CHUONG 1: GICII THIEU<br />
t<br />
1.1. Su can thiet cita can bang tai<br />
1.1.1. Mei trubng may chit<br />
1.1.2. Mei truong mung<br />
1.2. Can bang tai: dinh nshia vi img dung<br />
13. Cac san pharn can bang tai<br />
CHUONG 2: MAY CHU CAN BANG TM<br />
2.1. Tong quan<br />
2.2. Luan chuyen yang DNS ,<br />
2.3. Cum may chit yeti be can bang tii<br />
2.4. Lueng WA tin ca ban trong can bang tii<br />
2.5. Kiem tra tinh tang sire khoe<br />
2.5.1. Clic quit trinh Idem tra ca ban<br />
2.5.2. Clic cuec kiem tra tren the img dung cu the<br />
2.5.3. Su php thueac via img dung<br />
2.5.4. Kjch Bin<br />
2.5.5. Kat Luon<br />
2.6. Djch dja chi mpg (NAT)<br />
2.6.1. NAT dfch<br />
2.6.2. NAT ngwin<br />
2.6.3. NAT nguqc<br />
2.6.4. NAT nang cao (Enhanced NAT)<br />
2.6.5. Djch dja chi ding (PAT)<br />
2.7. Tritiai tir may chit trvt tiep (Direct Server Return - DSR)<br />
CHUONG 3: THUAT TOAN CAN BANG TM<br />
3.1. Nei dung Ichai quit<br />
3.2. Geri thieu met se thuot man can bang tai<br />
3.2.1. Thuat town Round Robin<br />
3.2.2. Thuat toin Weighted Round Robin<br />
3.2.3. Thuat toan Least Connection<br />
3.2.4. Thuet town Weighted Least Connection<br />
CHUONG 4: THIET ICE MANG yen Bo CAN BANG TM<br />
tuyen<br />
4.1. BO canI bit, tai Whir la met be chuyen mach so yeti met be dinh<br />
4.2. Cac thiet ke don gian<br />
4.3. Thiet ke cho tinh sin sing cao<br />
4.3.1. Active - Standby<br />
4.3.2. Active - Active<br />
4.3.3. Chuyen dei du phi:mg co tang thai<br />
4.3.4. Da dja chi VIP<br />
4.3.5. Quit trinh khei phuc b0 can bang tai<br />
4.3.6. Toy chip thiet ke tinh sin sang cao<br />
4.3.7. Su ciao tiep gill, ate b0 can brill tii<br />
CHUONG 5: CAU HINH CAI EMT VA THU. NGHIEM<br />
5.1. Gi6i thieu<br />
5.2. Tong quan HAProxy<br />
5.3. Cid dirt gilt phip HAProxy cho may chit Web tren CentOS<br />
<br />
6<br />
6<br />
7<br />
7<br />
8<br />
9<br />
11<br />
11<br />
11<br />
15<br />
19<br />
22<br />
22<br />
23<br />
23<br />
24<br />
24<br />
25<br />
25<br />
25<br />
28<br />
28<br />
29<br />
30<br />
32<br />
32<br />
33<br />
33<br />
34<br />
34<br />
35<br />
35<br />
38<br />
39<br />
40<br />
42<br />
45<br />
46<br />
47<br />
47<br />
56<br />
58<br />
58<br />
58<br />
59<br />
3<br />
<br />
5.3.1. Thiet ice h" tilting<br />
5.3.2. Hoat dOng<br />
5.4. CM dat eau hinh<br />
5.4.1. CM dat du hinh HAProxy<br />
5.4.2. Cal dat dich vn WebServer tren Server 1 va Server 2<br />
5.4.3. CM dat vit c.4u hinh KeepAlived tren Haproxy, Server 1, Server 2<br />
5.5. Kiem tra & Danh gia ket quit<br />
TONG !CET<br />
DANH MVC TAI Lieu THAM MAO<br />
<br />
59<br />
60<br />
60<br />
60<br />
61<br />
62<br />
65<br />
70<br />
71<br />
<br />
4<br />
<br />
Tir vih tat "lir Day dii<br />
<br />
OSI<br />
MAC<br />
ISP<br />
HTTP<br />
FTP<br />
SMTP<br />
DNS<br />
NFS<br />
URL<br />
TCP<br />
UDP<br />
IP<br />
VIP<br />
ARP<br />
RTSP<br />
STP<br />
VRRP<br />
SSL<br />
NAT<br />
PAT<br />
DSR<br />
CPU<br />
VLAN<br />
RS<br />
<br />
Open Systems Interconnection<br />
Media Access Control<br />
Internet Service Provider<br />
Hypertext Transfer Protocol<br />
File Transfer Protocol<br />
Simple Mail Transfer Protocol<br />
Domain Name System<br />
Network File System<br />
Uniform Resource Locator<br />
Transmission Control Protocol<br />
User Datagram Protocol<br />
Internet Protocol<br />
Virtual Internet Protocol<br />
Address Resolution Protocol<br />
Real Time Streaming Protocol<br />
Spanning Tree Protocol<br />
Virtual Router Redundancy Protocol<br />
Secure Sockets Layer<br />
Network Address Translation<br />
Port Address Translation<br />
Direct Server Return<br />
Central Processing Unit<br />
Virtual Local Area Network<br />
Real Server<br />
<br />
Giai ngltia<br />
MO hinh ket not cac he thong ma<br />
Kiem soat truy cop phuang tien<br />
Nha cung cap dich vp Internet<br />
Giao that truyen tai sieu van ban<br />
Giao thin truyen tai teP tin<br />
Giao thin truyen tai thu don gian<br />
He thOng phan giii ten mien<br />
He thOng tep tin mang<br />
Dinh vi thong nhat tai nguyen<br />
Giao thirc dieu khien truyen Van<br />
Giao thin gai tin ngtroi dimg<br />
Dia chi giao thin mang<br />
Dia chi giao thirc mang ao<br />
Giao thirc phan giai dia chi<br />
Giao that trvc tuyen then gian thvc<br />
Giao thin ma rOng cay<br />
Giao thin du phong dinh tuyen ao<br />
Giao thirc lap mot ma<br />
Dich dia chi mpg<br />
Dich dia chi ding<br />
Quay troy bye tiep may chit<br />
Don vi xir 19 trung tarn<br />
Mang cvc bt) ao<br />
May chit thvc<br />
<br />
5<br />
<br />
Chuang 1: GU% thieu<br />
<br />
DO Van Minh - A13439<br />
<br />
CHUONG 1: GIOI THItU<br />
<br />
Ngay nay can bang tai khong con la met khai niem meri trong khong gian mang va may<br />
chit. Moi loai san phim thuong thgc hien cac cons viec lchac nhau trong qua trinh can<br />
ban! tai. Vi du, cac 110 djnh tuyen do the phan phoi luu lucmg truy cap th8ng qua Mien<br />
tuyen duerng de den cling met dia chi dich vi can bang tai ten cac tai nguyen mang khac<br />
nhau. Trong khi di met may chi can bang tai phan phoi luu 'wing giera cac tai nguyen<br />
may chi chi khong phai la cac tai nguyen mang. Ban dAu be can bang tai bit du veri qua<br />
With can bing tai don gian, chimg nhanh chOng duqc phat trien de thgc hien met bat cac<br />
chic nang: can . bAng tai, Icy thu#t phan ph& luu Itrqngt chuyen mash lugng thong<br />
minh. Be can bang tai cling c6 the thuc hien cac cuOc kiem tra sic khoe met cach tinh vi<br />
ten cac may chii, cac ing dung, va ca nOi dung de cai thien firth sin sang va Ich# Wing<br />
quan IS,. Bei vi b0 can bang tai dugc trien khai nhu met may chit tiep nh#n you cau cult<br />
met nhim cac may chii, chting cling bao ve cac may chi ti ngueri ding dec hai, va tang<br />
cuang kha nang an ninh bao mat. Dtra‘ tren th8ng tin trong cac g6i tin IP hoac nei dung<br />
trong cac you cau ing dung, be can bang tai Qua ra cac quyet dinh thong minh de dinh<br />
huang cac luu Wang thich hqp den ding trung tam de lieu, may chi, tiring lira, b0 nher<br />
cache, hoac img dung.<br />
De tai nay se tap trung nghien ciru tong quan ve may chi can bing tai, cach thic hot<br />
dOng cia be can bang tai trong Wan be he thong mang, tir d6 img dung tren dux to trien<br />
Mud be, can bang tai tren toan b0 he thOng met cach hieu qua va (tat dugc hieu suit tot<br />
nhat. De tai se dtra ra met m8 hinh cu the, ap dung thu#t toan di chqn Itra de dtra ra cach<br />
nhin re hon ve yin de thing to dang Wang teri.<br />
<br />
1.1. Sr can fillet cia can bing tai<br />
CO hai xu huortg clan den sy can thiet cia can bang di lit may chi va mang. Veri st ir vtrgt<br />
trei dm Internet va Intranet, ket not mang giita may chi va may tinh ca nhan cia !than<br />
vien, khach hang hoac nha cung img di trer titbit 'diem vu quan trong. se khong the chap<br />
flan dirge khi mang bi sap hay the hien kha nang lam viec yeu kern, khi d6 no hau nhu se<br />
tri tre moi host &Ong kinh doanh trong nen kinh to dua nhieu vkInternet. MOt vi du nhu<br />
xay dtmg met website thuong mai Bien tir, c6 rat nhieu be phan can dugc xem xet nhu la:<br />
b0 djnh tuyen, be chuyen mach, Wang lia , be the dem, may chi web, may chit ca ser cla<br />
lieu. Hon Ilea viec gia tang nhanh cia ck may chi cho hang lost cac img dung di kW&<br />
cho trung tan.' dit lieu day ip cac cum may chi. Su r6i ram va thach thirc trong khit nang<br />
nier rOng, kha nang quart ly va khit tiling sin sang cia cia cac nhim may chi la met nhin<br />
to dimg ding sau den hei can ci met su thay doi thong minh. Met thir ma .n8 phai chic<br />
chin ve kha nang mer reng va firth sin sang cao cho mgi thanh phan, bat dau tir be dirt<br />
tuyen ket not voi Internet, cho to; tat ca cac con dutng teri may chi de lieu ben trong. Tir<br />
di thiet bi can bang tai St hien nhu la met vu khi mang me de xi ly nheng van de tren.<br />
6<br />
<br />