Unit Goal

1. 瞭解Clusters分類;

2. 根據專案情況選擇不同種類的Cluster;

3. 熟悉課程實驗環境

Unit Sections

1. Cluster的定義

2. 儲存裝置

3. 紅帽儲存架構

4. 熟悉課程實驗環境

Hands-On Activities

None

Unit Test

配置你的實驗環境

What is a Cluster

所謂的Cluster指的是計算機群(多臺計算機)共同服務於同一個任務;根據對Cluster的需求不同,將Cluster分為以下三類 :

1> 負載均衡叢集(load-balanling):Cluster中的所有節點執行同一個程式,來自客戶端的請求將被隨機的分配到某個節點之中。例如Web服務,為了保證Web訪問的低延遲,使用多臺計算機同時相應客戶端的Web訪問。而且Load-balanling不但對此Web服務有加強整個應用效能的效果,還附帶一些冗餘效果,當其中一臺節點當機的情況下,其他節點仍然可以正常執行。而來自客戶端請求是否會繼續派送到這臺出問題的節點,需要負載均衡硬體或者負載均衡軟體進行調配。

2. 計算機叢集(computer cluster):HPC(High Performance Computing)高效能運算。Computer Cluster是真正的將計算叢集中的每個節點的效能累計當做一臺大型機來使用。其原理是將叢集收到的任務分為幾個大塊,根據演算法分發給不同的節點進行處理再做統一的返回,從而形成同一個任務擁有大量的系統資源使用。這種叢集往往應用於大型的科學計算之中。

3. 高可用叢集(HA cluster,failover cluster):高可用叢集用於保證服務的可靠性,也被稱為故障轉移Cluster。從另一方面講高可用叢集為當前執行的服務新增了一臺或多臺冗餘裝置。HA與load-balanling相似,有時候也被歸為一類,區別是load-balanling更好的利用了系統資源,而HA的Passtive(備用)裝置只有當執行(Acvive)裝置當機了之後才會啟用。

大部分開發公司所產品承載在client端或者web端,使用tomcat,Webphere 作為中介軟體,使用負載均衡叢集;如果單node的模式可以承載業務,也可以使用高可用cluster;只有需要大量計算時,例如科學研究等方面,會用到計算機叢集。

When to use HA Clustering

在選擇cluster型別的時候,先確定自己的需求,需要高效能,failover,還是負載均衡。某些service不需要叢集的支援,例如 dns ldap,因為使用主備的環境,在client端直接配置多個伺服器也可以達到HA的效果;

例如nfs samba這樣的服務沒有內建的故障轉移功能,則需要使用HA cluster。

what is a Cluster?

Please answer the following questions:

1. The major goal of a compute cluster is (C)

a. To equally distribute load between nodes

b. To keep services as available as can be

c. To perform large amounts of calculations

2. The major goal of a load balancing cluster is (A)

a. To equall distribute load between nodes

b. To keep services as available as can be

c. To perform large amounts of calculations

3. The major goal of a high availability cluster is (B)

a. To equally distribute load between nodes

b. To keep services as available as can be

c. To perform large amounts of calculations

4. Which of these service would be a candidate for inclusion in a HA cluster? (B,C)

a. DNS

b. NFS

C. FTP

D. Kerberos KDC

Storage Technologies

Different Types of Data

如果你仔細觀察,可以將資料型別分為以下幾類:

1. System Data versus User Data 系統資料 vs 使用者資料

2. Static Data versus Dynamic Data 靜態資料 vs 動態資料

3. Current Data versus Archived Data 近期資料 vs 歸檔資料

4. Easy-To-Replace Data versus Hard-To-Replace Data 容易移動替換的資料 vs 難以移動替換的資料

5. Often Accessed Data versus Hard-To-Replace Data 經常訪問的資料 vs 不經常訪問的資料

6. System Specific Data versus Common Data 系統特殊資料 vs 普通資料

7. etc 配置資料

分析你的資料型別,從而通過分析結果選擇合適的Storage Technologies。For example,現在有幾百後者幾千G的archived Data,內容基本上都是使用者的歷史資料,這些資料一年可能就被訪問1,2次。並且在訪問之前你有充分的時間做準備,訪問可預知。那可以選擇magnetic tape(磁帶)或者a slower filer,這樣做的意義要大於將這些Data 放入state-of-the-art,high throughput,low latency SSD。

另一個例子,你有一個database,訪問量很大,每秒都有成千上萬的交易記錄,那麼你需要使用raid array,需要使用 fast disks,而不能將data放在a single old ATA hard drive。

Storage Technologies

現在有很多型別的storage technologies可選擇,有些速度比較快,有些則更可靠,安全或者便宜,有些目前流行或者已經被淘汰的:

% Paper 紙

% Flash-based storage 基於快閃記憶體式的

USB sticks

Flash card: compactFlash(CF),secure Digital(SD),etc

CF卡(Compact Flash)是1994年由SanDisk最先推出的。CF卡具有PCMCIA-ATA功能,並與之相容;CF卡重量只有14g,僅紙板火柴般大小(43mm x 36m x m3.3mm),是一種固態產品

Secure Digital通常縮寫為SD,作為一種記憶卡,全名應該是Secure Digital Memory Card,中文翻譯為安全數碼卡或直接稱為SD卡,是一種記憶卡的標準

Solid-state drives(SSD) 固態硬碟

% Magnetic Tape 磁帶

9-track reel tapes

DDS (Digital Data Storage on DAT)

DLT (DIgital Linear Tape)

LTO (Linear Tape-Open)

% Rotating Magnetic Platters 旋轉磁碟

Hard disks (using various interconnects)

% Optical Storage 光碟機

CD-ROM ,CD –R , CD-RW

DVD-ROM,DVD-R(W),DVD+R(W)

Blu-Ray discs:BD-ROM,BD-R,DB-RE 藍光磁碟

當將資料承載介質連線cpmputer時,有多個選項,包括物理連線,使用的協議和儲存硬體。實質上,這些特性大多都是繫結在一起的。某一介質所使用的協議和儲存硬體連線方式都是固定的。

有很多種區分儲存的方法,首先我們可以將儲存區分為 Direct Attached Storage (開放式系統直連式儲存)簡稱DAS,和Shared Storage。DAS上的塊直連到computer上,所以DAS只能連線一臺computer。常見的DAS如SCSI,IDE/ATA,SATA和SAS。這些DAS裝置的最大吞吐量有很大的差異,for example:SAS drive的最大吞吐量要高於SATA裝置。

當storage是用來連線cluster的時候,往往需要shared storage;Shared Storage可以分為兩種:Network Attached Storage(NAS) (網路附屬儲存)和Storage Area Network(SAN),兩種storage最大的區別是訪問data的方式,NAS使用network來訪問(例如 NFS or CIFS),而SAN是storage和client建立area network。

訪問SAN有多種方式,一些SAN使用Fibre Channel(光纖通道),使用Host Bus Adapters(HBA 主機匯流排介面卡)和 Fibre switches(光纖交換機)形成光纖儲存。另外一些SAN使用Ethernet network進行傳輸,使用iSCSI(internet SCSI)或者 FCoE(Fibre Channel over Ethernet 乙太網光纖通道) 通訊協議。

目前large storage arrays or filers通常一部分使用 NAS shared,一部分使用SAN驅動,還同時滿足fibre channel based access,像iSCSI 和 FCoE。

Fibre Channel

Fibre Channel可以使用線速來進行分類,分為1Gbps to 16Gbps,20Gbps已經正在發展之中。Fibre Channel裝置的價格要比Ethernet裝置昂貴的多,通常Fibre Channel裝置用於實現低延遲和高吞吐量的需求。

連線Fibre Channel裝置有3種模式:

Point-to-point:使用fibre optic cable(光纜)(or through a Fibre Switch)將兩臺Devices直連。

Arbitrated Loop(仲裁環路):光纖通道網的基本配置模式,形成一個環路,網路資料包從一個裝置傳輸到令一個裝置直到到達目的地,這種配置比較簡單但是單節點的故障會造成整個環路癱瘓。

Switched Fabric(交換結構):這種架構需要Fibre Switch。就如同Ethernet switch一樣,Switch連線兩個不同的裝置進行packets的傳輸,這種結構非常高效。Switched Fabric只有這種方式,它允許不同的速率的裝置連線Fibre Switch,也可以配置規則限制每個裝置之前的通訊。

iSCSI and FCoE

iSCSI 和 FCoE 是最近比較流行的協議,都是使用 normal Ethernet based IP networks 進行通訊, 通常使用它們來替代Fibre Channel,因為它們是低成本實現高吞吐量(跟fibre channel還是有一些差距)。

使用iSCSI或者FCoE時,通常配置一個獨立的儲存網路,採用巨型幀和硬體流控制。來應對大規模,大資料背景下的裝置之前的通訊。這些不僅僅是一個packet level(VLANs),還基於physical level之上(switches,NICs 網路卡)

使用iSCSI比FC更有優勢的一點就是使用iSCSI不用太過於考慮基礎裝置之前的地理位置,不用付出昂貴的光纜線連線,只要讓基礎裝置連入fast network即可。

Storage Technologies

1. The most flexible Fibre Channel topology is (B)

a. Point-to-Point

b. Switched Fabric

c. Arbitrated Loop

2. iSCSI tends to be faster than Fibre Channel (B)

a. True

b. False

3. Fibre Channel over Ethernet (FCoE) is normally cheaper than regular Fibre Channel (A)

a. True

b. False

4. Which of the following components do you need for a Switched Fabric Fibre Channel topology? (A,B,D)

a. Fibre optic cables

b. HBAs(Host Bus Adapters)

c. Ethernet Switch

d. Fibre Switch

e. 802.1Q VLAN Tagging

The Red Hat Storage Model

The Virtual File System

當application訪問linux系統中的file時,會發出一個系統呼叫,通常使用的是標準的C library(libc.so)

這種系統呼叫由系統核心進行處理,轉入Virtual File System(VFS),在VFS層經過不同的方式形成處理檔案。

VFS的作用就是採用標準的Unix系統呼叫讀寫位於不同物理介質上的不同檔案系統。VFS是一個可以讓open()、read()、write()等系統呼叫不用關心底層的儲存介質和檔案系統型別就可以工作的粘合層。

VFS在形成不同的hadling file,在內哼將它轉發到適當的device driver進行處理。

從device driver出來後就直接請求底層storage了,可以是直接的塊裝置,也可能是LVM,iSCSI,fibre channel。

Application—— VFS —— Device Driver —— Volume;

The Virtual File System and Network File System

Application——LibC——System Call——VFS——ext4——Block I/O

Application——LibC——System Call——VFS——xfs——Block I/O

Application——LibC——System Call——VFS——NFS——Network

Application——LibC——System Call——VFS——CIFS——Network

根據上面的圖片,可以看到 Virtual File System 和 Network File System 的區別;VFS通過device dirver將相關資料傳送到不同的物理戒指,而Network File System通過網路協議進行相關資料的讀寫,例如NFS,CIFS。Block-I/O 到 ext4,xfs 的部分就像fibre channel drivers, 而 NFS,CIFS到network 就如 iSCSI和FCoE。

The Virtual File System

1. Normally all file system access is routed through the Virtual File System layer in the kernel. (A)

a. True

b. False

2. The Virtual File System layer in the Linux kernel is bypassed for network based file system such as NFS and CIFS (B)

a. True

b. False

3. File systems like ext4 and xfs must always be kept on local storage, since the Linux kernel block I/O layer can not handle network based protocols such’ as iSCSI and FCoE. (B)

a. True

b. False

Unit Summary

what is a Cluster?

瞭解clusters的分類

識別cluster元件

Storage Technologies

識別不同的檔案型別

瞭解SAN和NAS的區別

識別不同的儲存裝置

The Red Hat Storage Model

理解linux系統如何訪問storage