Mô hình Hybrid On-Premise (Linux + Windows)
Môi trường doanh nghiệp thực tế hiếm khi thuần Linux hoặc thuần Windows. Hybrid on-premise là mô hình kết hợp cả hai, nơi Linux đảm nhiệm workload cloud-native và Windows giữ lại legacy apps, identity, và database enterprise.
Tại sao tồn tại môi trường Hybrid?
Kiến trúc toàn cảnh — Hybrid On-Premise
Tích hợp Linux ↔ Windows
Authentication — Linux join AD
Linux server có thể join Active Directory domain để xác thực user bằng SSSD + Kerberos:
Cấu hình SSSD đơn giản:
# /etc/sssd/sssd.conf
[sssd]
domains = corp.local
[domain/corp.local]
id_provider = ad
auth_provider = ad
access_provider = ad
ad_domain = corp.local
krb5_realm = CORP.LOCAL
realmd_tags = manages-system joined-with-adcli
Shared Storage — Samba / NFS
Monitoring thống nhất
Ma trận tích hợp Linux ↔ Windows
| Nhu cầu | Giải pháp | Ghi chú |
|---|---|---|
| Linux user auth bằng AD | SSSD + realmd + Kerberos | realm join corp.local |
| Linux mount Windows share | mount -t cifs //server/share | Package cifs-utils |
| Windows mount Linux NFS | NFS Client (Windows Feature) | Cần bật NFS client role |
| Samba shared storage | Samba server trên Linux | SMB2/3 — Windows & Linux đọc được |
| Cross-platform automation | Ansible | Module win_* cho Windows, apt/yum cho Linux |
| Centralised log | Winlogbeat → Elasticsearch | Gom Windows Event Log vào ELK |
| Secret management | HashiCorp Vault | Agent injection cho Linux, AppRole cho Windows |
| DNS nội bộ | Windows DNS (AD integrated) | Linux dùng /etc/resolv.conf → AD DNS |
| Time sync | Windows NTP → Linux chrony | Kerberos yêu cầu ≤ 5 phút lệch nhau |
| Monitoring | Prometheus (Linux) + Zabbix (Windows) → Grafana | Unified dashboard |
Ưu điểm & Nhược điểm
Ưu điểm:
- Tận dụng đầu tư cũ: Không cần rewrite toàn bộ app — Linux & Windows cùng tồn tại
- Best of both worlds: Linux cho cloud-native, Windows cho enterprise ecosystem
- Gradual migration: Chuyển dần từng service sang Linux theo thời gian
- Active Directory tập trung: SSO cho cả Linux và Windows user
Nhược điểm:
- Phức tạp vận hành: Đội cần biết cả hai hệ điều hành — tuyển dụng khó hơn
- Monitoring phức tạp: Cần nhiều agent, nhiều tool — dễ "mù" một bên
- Troubleshoot networking khó: SMB, NFS, Kerberos đồng thời trên cùng mạng
- License cost: Windows Server + SQL Server + CAL — tốn kém phần Windows tier
Chiến lược migration thực tế
Không nên migrate toàn bộ cùng lúc. Thứ tự ưu tiên phổ biến:
- Bắt đầu với new services → Viết mới 100% trên Linux + container
- Migrate stateless .NET apps → .NET 8 chạy trên Linux, không cần Windows
- Giữ SQL Server → Migrate cuối cùng sang PostgreSQL (nếu cần), hoặc dùng SQL Server on Linux
- Giữ Active Directory → Đây là component khó thay thế nhất — LDAP/AD sẽ tồn tại lâu nhất