AFS (Andrew File System) là gì?
Hệ thống file phân tán (Distributed File System) do Carnegie Mellon University (CMU) phát triển. Cho phép truy cập file không gian tên (namespace) thống nhất, minh bạch từ bất kỳ client nào trong mạng, độc lập vị trí vật lý (Location Independence) và nền tảng (Platform Independence).
AFS vs NFS (Network File System) - So sánh chi tiết
| Đặc điểm | AFS (Andrew File System) | NFS (Network File System - Sun 1984) |
|---|---|---|
| Server State | Stateful (Lưu trạng thái client, callback) | Stateless (Không lưu trạng thái) |
| Callback Mechanism | CÓ - Server thông báo client khi file thay đổi (Cache consistency mạnh) | KHÔNG - Client phải poll hoặc timeout |
| Location Independence | Mạnh - Di chuyển file vật lý không đổi path (/afs/cell/...) | Yếu - Path gắn liền server/export path |
| Authentication | Kerberos tích hợp (Mutual Auth, Ticket-based) | AUTH_SYS (UID/GID - yếu), Kerberos (RPCSEC_GSS - thêm sau) |
| Access Control | ACL trên thư mục (Directory-level ACL) - Đơn giản, mạnh | Unix Mode Bits (rwx) + NFSv4 ACL (phức tạp) |
| Caching | Client-side caching tích cực (Venus Cache Manager), Write-back | Attribute cache, Data cache (Write-through/async) |
| Scalability | Rất tốt (Cells, Volumes, Replication) | Tốt (NFSv4.1+ pNFS), nhưng phức tạp hơn |
| Single Namespace | /afs/cellname/... Toàn cầu thống nhất | Mount point tùy client/server |
Đặc điểm bảo mật AFS (Security Characteristics)
- Backup hàng ngày (Daily Backup) - Snapshot/Clone volume.
- Kerberos Authentication: Xác thực lẫn nhau (Mutual), Single Sign-On, Ticket-Granting-Ticket (TGT), Service Tickets. Bảo vệ credential không đi qua mạng dạng rõ.
- ACL dựa trên thư mục: Quyền: r (read), l (lookup), i (insert), d (delete), w (write), k (lock), a (admin). Dễ quản trị nhóm.
- Lưu trữ an toàn: UCSC Data Center / Enterprise Data Center - vật lý an toàn, redundant hardware.
- Mã hóa truyền tải: Rx protocol (RPC-based) có hỗ trợ encryption (krb5 privacy service).
Ai đang dùng AFS?
- Hơn 25 năm triển khai.
- Đại học, Viện nghiên cứu (CMU, Stanford, MIT, CERN...).
- Siêu máy tính (Supercomputer Centers), Phòng thí nghiệm quốc gia.
- Tài chính: Goldman Sachs, Morgan Stanley (lịch sử).
- IBM (OpenAFS contributor), Red Hat, SUSE.
AFS Authentication (Xác thực AFS)
Sử dụng Token (Token = Kerberos Service Ticket + AFS-specific data). Cách lấy Token:
- Đăng nhập hệ thống (Login) → PAM/Kerberos tự động lấy Token (aklog).
- Chạy lệnh
kinit(Kerberos init) →aklog(AFS Kerberos Login). - Token dùng để xác thực với Server AFS (File Server, Volume Server, VLDB).
AFS có mã hóa (Encrypted) không?
CÓ. Giao thức Rx hỗ trợ mã hóa (krb5 privacy service - DES/3DES/AES tùy Kerberos config). Thông tin nhạy cảm được mã hóa trước khi gửi về client/server. Tuy nhiên, mặc định nhiều triển khai cũ không bật encryption (performance) - cần cấu hình bật.
AFS Storage (Lưu trữ AFS)
Hệ thống file phân tán, mạng. Client/Server chia sẻ file hiệu quả. Truy cập qua: Web (WebDAV/HTTP), File Transfer (Fetch, OpenAFS Client, SecureFX - Mac/Win), Native Client (Kernel module / User-space).
AFS trong Networking (Mạng)
Kết nối thiết bị phân tán trong doanh nghiệp. Truy cập file server từ xa như local. Môi trường phân tán, độc lập platform (Unix, Linux, Windows, macOS via OpenAFS/krb5).
AFS trong Cloud (Azure File Sync - AFS)
Lưu ý: Trong Azure, AFS = Azure File Sync (Khác hoàn toàn Andrew File System).
- Dịch vụ đồng bộ file (File Synchronization Service).
- Tiering: Hot data trên Azure Files, Cold data trên Server on-prem.
- Backup/Recovery: Azure Backup tích hợp, Snapshot 120 ngày.
- Multi-server sync, Cloud tiering, Fast disaster recovery.
AFS Cell (Tế bào AFS) - Đơn vị quản trị
- AFS = Tập hợp nhiều Cell (Cell = Administrative Domain).
- Mỗi Cell: Quản trị riêng (Admin group, User group, VLDB, Root Volume).
- Cell chứa nhiều Volume (Đơn vị lưu trữ/quản trị logic).
- Volume chứa file/thư mục. Home directory của user = 1 Volume.
- Volume có thể di chuyển giữa Server không gián đoạn người dùng (Location Independence).
- Replication: Read-only Volume Replica (Backup, Load Balancing, Geo-distribution).
NFS trong Hệ điều hành
Sun Microsystems 1984. Giao thức file hệ thống phân tán. User mount chia sẻ mạng như ổ đĩa cục bộ. Phiên bản: NFSv2, v3 (Stateless, UDP/TCP), NFSv4 (Stateful, Compound Ops, Delegation, Kerberos, ACL, idmap).
Đặc điểm File System & Distributed File System (DFS)
- File System: Truy cập nội dung & Metadata. Thiết kế phụ thuộc Storage/Medium.
- DFS: Transparent Local Access (Truy cập như local). Location Independence (Không biết dữ liệu ở đâu vật lý). DFS quản trị vị trí dữ liệu, không phải Host.
Tính năng nổi bật của AFS (Key Features)
- Kerberos Authentication tích hợp sẵn.
- Directory ACL đơn giản, mạnh mẽ.
- Callback Cache Consistency (Cache coherency mạnh).
- Location Independence (Di chuyển Volume không đổi Path).
- Single Global Namespace (/afs/cell/...).
- Volume Management (Backup, Move, Replicate, Quota online).
- Read-only Replication cho HA/DR.
- Cross-platform (OpenAFS: Linux, Windows, macOS, FreeBSD, AIX...).
- Redundant Hardware cho Server/Storage HA.