鏡像檔案系統 mirror file system : mfs

32
Page 1 of Twin Peaks Software Inc. 鏡鏡鏡鏡鏡鏡 Mirror File System 鏡鏡鏡鏡鏡鏡鏡鏡鏡

Upload: mark-ting

Post on 06-Aug-2015

2.094 views

Category:

Technology


8 download

TRANSCRIPT

Page 1: 鏡像檔案系統 Mirror File System : MFS

Page 1 of

Twin Peaks Software Inc.

鏡像檔案系統Mirror File System

多重伺服器檔案系統

Page 2: 鏡像檔案系統 Mirror File System : MFS

Page 2 of

多重伺服器檔案系統• 傳統的檔案系統 – EXT3/UFS 和 NFS

– 管理單一伺服器的儲存設備上的檔案

• 多重伺服器檔案系統– 管理多個伺服器的儲存設備上的檔案

Page 3: 鏡像檔案系統 Mirror File System : MFS

Page 3 of

問題• 單一資源是脆弱的• 多重系統提供安全網

硬碟層 Disk level => RAID

儲存層 Storage level => Storage Replication

網路層 TCP/IP level => SNDR

檔案系統層 File System level => CFS, MFS

系統層 System level => Clustering system

應用層 Application => Database

Page 4: 鏡像檔案系統 Mirror File System : MFS

Page 4 of

為什麼選擇 MFS?

• 比現有的科技擁有更多的優點

Page 5: 鏡像檔案系統 Mirror File System : MFS

Page 5 of

本機檔案系統 Local File System

Data

EXT3

Application 1

Application 2

Kernel Space

User Space

Disk Driver

EXT3 管理本機伺服器儲存設備上的檔案

Page 6: 鏡像檔案系統 Mirror File System : MFS

Page 6 of

Application Application

NFS (Client mount)

Application Application

Data

EXT3/UFS

NFSD

網路檔案系統 Network File SystemClient Server

NFS 管理遠端伺服器儲存設備上的檔案

Page 7: 鏡像檔案系統 Mirror File System : MFS

Page 7 of

rsync, tar

NFS (Client mount)

Application Application

Data B

EXT3/UFS

NFSD

EXT3 | NFS

EXT3/UFS

Data B

Client Server

Application

應用程式只能用在一端,不能同時用在兩端

Page 8: 鏡像檔案系統 Mirror File System : MFS

Page 8 of

• 結合這兩種檔案系統,來管理本機與遠端的伺服器儲存設備上的檔案-- 在同一時間

-- 即時的

EXT3 + NFS ??

Page 9: 鏡像檔案系統 Mirror File System : MFS

Page 9 of

Application Application

Data

EXT3/UFS

Application Application

Data

EXT3/UFS

Passive MFS Server

MFS = EXT3 + NFSActive MFS Server

MFS

NFS

User Space

Kernel Space

Page 10: 鏡像檔案系統 Mirror File System : MFS

Page 10 of

• MFS 是一個系統核心可加載模組 kernel loadable module

- 加載在 EXT3/UFS 和 NFS 的上面• 標準 VFS 介面• 提供完全的通透性

- 對使用者和應用程式 - 對底層檔案系統 underlying file

systems

建構方法

Page 11: 鏡像檔案系統 Mirror File System : MFS

Page 11 of

檔案系統架構

SOLARIS Internal, Core Kernel Architecture, Jim Mauro. Richard McDougall, PRENTICE HALL

Optical drive

Network

File System Operation calls

User Applications

System Call Interface

File Operation System Calls Other System calls

read

()

wri

te (

)

op

en (

)

clo

se (

)

mkd

ir (

)

rmd

ir (

)

link

()

ioct

l ()

crea

t ()

lsee

k ()

mo

un

t ()

um

ou

nt

()

Sta

tfs(

)

syn

c ()

Vnode interfaces VFS interfaces

UF

S (

2)

NF

S (

2)

VxF

S

HS

FS

QF

S

UF

S (

1)

NF

S (

1)

PC

FS P

CF

S

Data Data Data Data

File System Operation calls

Page 12: 鏡像檔案系統 Mirror File System : MFS

Page 12 of

MFS 架構User Applications

System Call Interface

File Operation System Calls File System Operation callsOther System calls

read

()

wri

te (

)

op

en (

)

clo

se (

)

mkd

ir (

)

rmd

ir (

)

link

()

ioct

l ()

crea

t ()

lsee

k ()

mo

un

t ()

um

ou

nt

()

Sta

tfs(

)

syn

c ()

Vnode interfaces VFS interfaces

UF

S

(2)

NF

S

(2)V

xFS

HS

FS

QF

S

UF

S(1

)

NF

S (

1)

PC

FS

PC

FS

Network Optical driveData Data Data Data

MFS

Vnode VFS interface

Page 13: 鏡像檔案系統 Mirror File System : MFS

Page 13 of

• 對使用者和應用程式的通透性

- 不用重新編譯或重新連結• 對原來的檔案結構的通透性

- 同樣的存取路徑名稱• 對底層檔案系統 (underlying file systems) 的通透性

- UFS, NFS

通透性

Page 14: 鏡像檔案系統 Mirror File System : MFS

Page 14 of

• 傳統的掛載機制- 一個目錄,一個檔案系統

• MFS 的掛載機制- 一個目錄,兩個或多個檔案系統

掛載機制 Mount Mechanism

Page 15: 鏡像檔案系統 Mirror File System : MFS

Page 15 of

# mount –F mfs host:/ndir1/ndir2 /udir1/udir2

- 首先將 NFS 掛載到一個 UFS 目錄- 然後將 MFS 掛載到 UFS 和 NFS 的上面- 現有的 UFS 樹狀結構 /udir1/udir2 變成 MFS

的一個本機複本- 新掛載的 host:/ndir1/ndir2 變成 MFS 的一個遠

端複本- 跟 NFS 一樣的掛載選項,除了沒有 ‘ -o hard’ 選

掛載機制

Page 16: 鏡像檔案系統 Mirror File System : MFS

Page 16 of

# /usr/lib/fs/mfs/mfsck mfs_dir

- 在 MFS 掛載成功之後,本機複本的內容可能跟遠端複本不同

- 使用 mfsck 指令 (the MFS fsck) 同步兩者- 這個 mfs_dir 可以是任何 MFS 掛載點下的任何目

錄- 同一時間可以執行多個 mfsck 指令

MFS mfsck 指令

Page 17: 鏡像檔案系統 Mirror File System : MFS

Page 17 of

READ/WRITE Vnode Operation

• 所有 VFS/vnode 的動作會被 MFS 收聽到

• READ 相關的動作 : read, getattr,…. 等動作只需要到達本機複本 (UFS)

• WRITE 相關的動作 : write, setattr,…. 等動作會同時到達本機端 (UFS) 與遠端 (NFS) 複本 ( 利用執行緒 )

Page 18: 鏡像檔案系統 Mirror File System : MFS

Page 18 of

• 目錄層 Directory Level

- 只需 mirror 任何一個 UFS 的目錄而不用 mirror 整個 UFS 檔案系統

- 目錄 A 鏡像到伺服器 A

- 目錄 B 鏡像到伺服器 B

• 區塊層更新 Block Level Update

- 只有變更過的區塊需要被 mirror

鏡像粒度 Mirroring Granularity

Page 19: 鏡像檔案系統 Mirror File System : MFS

Page 19 of

# /usr/lib/fs/mfs/msync mfs_root_dir

- msync 指令是一個 daemon ,負責斷線續傳- 當一個寫入的動作失敗, MFS 會 :

․ 紀錄這個寫入失敗的檔名

․ 啟動一個 heartbeat 執行緒去驗證遠端 MFS 伺服 器是否重新上線

- 一旦遠端 MFS 伺服器重新連線, msync 指令利用這個紀錄檔來同步這些遺缺的檔案到遠端的伺服器

MFS msync 指令

Page 20: 鏡像檔案系統 Mirror File System : MFS

Page 20 of

Active/Active 架構Server Server

Application Application

Data A

UFS

Application Application

Data B

UFS

Active MFS Server

MFS MFS

Active MFS Server

NFS NFS

Page 21: 鏡像檔案系統 Mirror File System : MFS

Page 21 of

MFS 使用 UFS, NFS 檔案紀錄鎖 (file record lock)

Active - Active 架構需要 鎖定機制Locking enables write-related vnode operations as atomic operations.

鎖定 是預設選項

鎖定 在 Active - Passive 架構中是不需要的

MFS Locking Mechanism 鎖定機制

Page 22: 鏡像檔案系統 Mirror File System : MFS

Page 22 of

• 即時 Real-time

-- 即時的複製檔案文件

• 排程 Scheduled

-- 紀錄檔案路徑,偏移和大小 (file path, offset and size)

-- 僅複製檔案文件變更的部分

即時與排程

Page 23: 鏡像檔案系統 Mirror File System : MFS

Page 23 of

• 線上檔案備份• 伺服器檔案備份 , active passive

• 伺服器 /NAS 叢集 , active Active

應用

Page 24: 鏡像檔案系統 Mirror File System : MFS

Page 24 of

Application Application

Data

NTFS

Application Application

Data

NTFS

Remote Server

MFS = NTFS + CIFS

Window Desktop/Laptop

MFS

CIFS

Page 25: 鏡像檔案系統 Mirror File System : MFS

Page 25 of

MFS

User Desktop/Laptop

線上檔案備份即時或排程

Folder

ISP Server

MFS

Folder

MFS

Folder

LAN or WanLAN or Wan

Page 26: 鏡像檔案系統 Mirror File System : MFS

Page 26 of

Secondary

伺服器複製

Mirror FileSystem

Mirror FileSystem

App

Primary

Email

Mirror FileSystem

Mirroring Path : /home

: /var/spool/mail

Heartbeat

Page 27: 鏡像檔案系統 Mirror File System : MFS

Page 27 of

企業叢集

Mirror FileSystem

Mirror FileSystem

Mirroring PathAppApp App App App

Mirror FileSystem

Mirror FileSystem

Central

Mirror File System

App App

Page 28: 鏡像檔案系統 Mirror File System : MFS

Page 28 of

• 建構方法 - 建構在已有的 EXT3, NFS, NTFS, CIFS 的基礎上

• 不需要複製索引資料 (metadata)

- 不需要複製 Superblock, Cylinder group, file allocation map

• 每一個檔案的抄寫動作必須通過檔案系統的檢查- 檔案的一致性,完整性

• Live file, 非原始數據 (raw data) 複製

- 主要和備份的檔案複本都是立即可讀取的

優勢

Page 29: 鏡像檔案系統 Mirror File System : MFS

Page 29 of

• 互通性 -- 兩個節點可以是不相同的系統

-- 儲存設備可以是不相同的系統

• 較小的粒度 Small granularity

-- 目錄層,非整個檔案系統

• 一對多 或 多對一 複製

優勢

Page 30: 鏡像檔案系統 Mirror File System : MFS

Page 30 of

• 快速複製-- 在檔案系統層複製

• 即時故障切換-- 不需要做 fsck 和 mount 動作

• 地理上分散的叢集 -- 兩個節點之間可以相隔千百哩

• 容易部署和管理-- 只有主機需要安裝 MFS

優勢

Page 31: 鏡像檔案系統 Mirror File System : MFS

Page 31 of

為什麼選擇 MFS ?

• 更好的資料保護 • 更好的災難復原• 更好的 RAS

(Reliability, Availability, Serviceability 穩定性、可靠性和適用性 )

• 更好的彈性• 更好的效能• 更好的資源利用

Page 32: 鏡像檔案系統 Mirror File System : MFS

Page 32 of

Q & A

Application Application

Data A

Application Application

Data B

MFS MFS