0% found this document useful (0 votes)
131 views96 pages

Zfs Tech Talk

OpenZFS is software defined storage that uses the ZFS file system. ZFS uses a cache called the adjustable replacement cache (ARC) that caches both frequently and recently accessed data in memory to improve performance. The ARC combines aspects of least recently used (LRU) and least frequently used (LFU) caching algorithms. It consists of most recently used (MRU) and most frequently used (MFU) caches, as well as ghost caches for evicted data.

Uploaded by

Trần Xuân
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views96 pages

Zfs Tech Talk

OpenZFS is software defined storage that uses the ZFS file system. ZFS uses a cache called the adjustable replacement cache (ARC) that caches both frequently and recently accessed data in memory to improve performance. The ARC combines aspects of least recently used (LRU) and least frequently used (LFU) caching algorithms. It consists of most recently used (MRU) and most frequently used (MFU) caches, as well as ghost caches for evicted data.

Uploaded by

Trần Xuân
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 96

OpenZFS

Software defind storage


Mục Lục

 Lịch sử ra đời ZFS


 ZFS Cache - Data in memory
 Kiến trúc phần cứng triển khai ZFS SDS
 Kiến trúc pool disk trên ZFS Storage
 ZFS trên các hệ điều hành phổ biến A - Z
 Tunning & Test Perfromance
 Troubleshooting
Mục Lục

 Lịch sử ra đời ZFS


 ZFS Cache - Data in memory
 Kiến trúc phần cứng triển khai ZFS SDS
 Kiến trúc pool disk trên ZFS Storage
 ZFS trên các hệ điều hành phổ biến A - Z
 Tunning & Test Perfromance
 Troubleshooting
Lịch sử ra đời ZFS
• 2001 – Development of ZFS started with two engineers at Sun Microsystems.
• 2005 – Source code was released as part of OpenSolaris.
• 2006 – Development of FUSE port for Linux started.
• 2007 – Apple started porting ZFS to Mac OS X.
• 2008 – A port to FreeBSD was released as part of FreeBSD 7.0.
• 2008 – Development of a native Linux port started.
• 2009 – Apple's ZFS project closed. The MacZFS project continued to develop the code.
• 2010 – OpenSolaris was discontinued, the last release was forked. Further development
of ZFS on Solaris was no longer open source.
• 2010 – illumos was founded as the truly open source successor to OpenSolaris.
Development of ZFS continued in the open. Ports of ZFS to other platforms continued
porting upstream changes from illumos.
• 2012 – Feature flags were introduced to replace legacy on-disk version numbers,
enabling easier distributed evolution of the ZFS on-disk format to support new features.
• 2013 – OpenZFS on OS X ports ZFS on Linux to OS X.
• 2013 – The first stable release of ZFS on Linux.
• 2013 – Official announcement of the OpenZFS project. http://open-zfs.org/wiki/History
Lịch sử ra đời ZFS
• ZFS is a combined file system and logical volume manager( LVM ) designed by Sun
Microsystems and now owned by Oracle Corporation.
• The source code for ZFS was released under the CDDL as part of the OpenSolaris
operating system, and was subsequently ported to other platforms.
• The illumos project was founded as an open source fork of OpenSolaris.
• OpenZFS is the truly open source successor to the ZFS project. Development thrives as
a part of illumos, which has added many features and performance improvements. New
OpenZFS features and fixes are regularly pulled in from illumos, to all ports to other
platforms, and vice versa.
• ZFS is scalable, and includes extensive protection against data corruption, support for
high storage capacities, efficient data compression, integration of the concepts of
filesystem and volume management, snapshots and copy-on-write clones, continuous
integrity checking and automatic repair, RAID-Z, native NFSv4 ACLs, and can be very
precisely configured.
• The two main implementations, by Oracle and by the OpenZFS project, are extremely
similar, making ZFS widely available within Unix-like systems.

https://en.wikipedia.org/wiki/ZFS http://open-zfs.org/wiki/History
Mục Lục

 Lịch sử ra đời ZFS


 ZFS Cache - Data in memory
 Kiến trúc phần cứng triển khai ZFS SDS
 Kiến trúc pool disk trên ZFS Storage
 ZFS trên các hệ điều hành phổ biến A - Z
 Tunning & Test Perfromance
 Troubleshooting
ZFS Storage Data in memory
Traditional Caches

Caching mechanisms on Linux and other


operating systems use what is called a Least
Recently Used(LRU) caching algorithm..

https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
Traditional Caches
• The way the LRU algorithm works, is when an application reads data blocks,
they are put into the cache. The cache will fill as more and more data is read,
and put into the cache.
• However, the cache is a FIFO (first in, first out) algorithm. Thus, when the
cache is full, the older pages will be pushed out of the cache. Even if those
older pages are accessed more frequently. Think of the whole process as a
conveyor belt. Blocks are put into most recently used portion of the cache.
• As more blocks are read, the push the older blocks toward the least recently
used portion of the cache, until they fall off the conveyor belt, or in other
words are evicted.

https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
Traditional Caches
• When large sequential reads are read from disk, and placed into the cache, it
has a tendency to evict more frequently requested pages from the cache. Even
if this data was only needed once. Thus, from the cache perspective, it ends up
with a lot of worthless, useless data that is no longer needed. Of course, it's
eventually replaced as newer data blocks are requested.
• There do also exist least frequently used (LFU) caches. However, they suffer
from the problem that newer data could be evicted from the cache if it's not
read frequently enough. Thus, there are a great amount of disk requests, which
kind of defeats the purpose of a cache to begin with. So, it would seem that the
obvious approach would be to somehow combine the two- have an LRU and
an LFU simultaneously.
https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ZFS ARC
• The ZFS adjustable replacement cache (ARC) is one such caching
mechanism that caches both recent block requests as well as frequent
block requests. It is an implementation of the patented IBM adaptive
replacement cache, with some modifications and extensions.
• Adjustable Replacement Cache, or ARC - A cache residing in physical
RAM. It is built using two caches - the most frequently used(MFU)
cached and the most recently used(MRU) cache. A cache directory
indexes pointers to the caches, including pointers to disk called the
ghost frequently used cache, and the ghost most recently used cache.

https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ZFS ARC
• Cache Directory - An indexed directory of pointers making up the MRU, MFU,
ghost MRU and ghost MFU caches.
• MRU Cache - The most recently used cache of the ARC. The most recently
requested blocks from the filesystem are cached here.
• MFU Cache - The most frequently used cache of the ARC. The most frequently
requested blocks from the filesystem are cached here.

https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ZFS ARC
• Ghost MRU- Evicted pages from the MRU cache back to disk to save space in
the MRU. Pointers still track the location of the evicted pages on disk.
• Ghost MFU- Evicted pages from the MFU cache back to disk to save space in
the MFU. Pointers still track the location of the evicted pages on disk.
• Level 2 Adjustable Replacement Cache, or L2ARC- A cache residing outside of
physical memory, typically on a fast SSD. It is a literal, physical extension of the
RAM ARC.

https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ARC Algorithm

• This is a simplified version of how the IBM ARC works, but it should help you
understand how priority is placed both on the MRU and the MFU. First, let's
assume that you have eight pages in your cache. Four pages in your cache will
be used for the MRU and four pages for the MFU. Further, there will also be four
pointers for the ghost MRU and four pointers for the ghost MFU. As such, the
cache directory will reference 16 pages of live or evicted cache.

https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ARC Algorithm

1. As would be expected, when block A is read from the filesystem, it will be cached
in the MRU. An index pointer in the cache directory will reference the the MRU
page.

https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ARC Algorithm

2. Suppose now a different block (block B) is read from the filesystem. It too will be
cached in the MRU, and an index pointer in the cache directory will reference the
second MRU page. Because block B was read more recently than block A, it gets
higher preference in the MRU cache than block A. There are now two pages in the
MRU cache.

https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ARC Algorithm

3. Now suppose block A is read again from the filesystem. This would be two reads
for block A. As a result, it has been read frequently, so it will be store in the MFU. A
block must be read at least twice to be stored here. Further, it is also a recent
request. So, not only is the block cached in the MFU, it is also referenced in the
MRU of the cache directory. As a result, although two pages reside in cache, there
are three pointers in the cache directory pointing to two blocks in the cache.
https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ARC Algorithm

4. Eventually, the cache is filled with the above steps, and we have pointers in the
MRU and the MFU of the cache directory.

https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ARC Algorithm

5. Here's where things get interesting. Suppose we now need to read a new block
from the filesystem that is not cached. Because of the pigeon hole principle, we
have more pages to cache than we can store. As such, we will need to evict a page
from the cache. The oldest page in the MRU (referred to as the Least Recently
Used- LRU) gets the eviction notice, and is referenced by the ghost MRU. A new
page will now be available in the MRU for the newly read block.
https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ARC Algorithm

6. After the newly read block is read from the filesystem, as expected, it is stored in
the MRU and referenced accordingly. Thus, we have a ghost MRU page reference,
and a filled cache.

https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ARC Algorithm

7. Just to throw a monkey wrench into the whole process, let us suppose that the
recently evicted page is re-read from the filesystem. Because the ghost MRU
knows it was recently evicted from the cache, we refer to this as "a phantom cache
hit". Because ZFS knows it was recently cached, we need to bring it back into the
MRU cache; not the MFU cache, because it was not referenced by the MFU ghost.
https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The ARC Algorithm

8. Unfortunately, our cache is too small to store the page. So, we must grow the
MRU by one page to store the new phantom hit. However, our cache is only so
large, so we must adjust the size of the MFU by one to make space for the MRU.
Of course, the algorithm works in a similar manner on the MFU and ghost MFU.
Phantom hits for the ghost MFU will enlarge the MFU, and shrink the MRU to make
room for the new page.https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
ZFS Storage Data in memory
The L2ARC

The level 2 ARC, or L2ARC should be fast disk. As mentioned in my previous post
about the ZIL, this should be DRAM DIMMs (not necessarily battery-backed), a fast
SSD, or 10k+ enterprise SAS or FC disk. If you decide to use the same device for
both your ZIL and your L2ARC, which is certainly acceptable, you should partition it
such that the ZIL takes up very little space, like 512 MB or 1 GB, and give the rest
to the pool as a striped (RAID-0) L2ARC. Persistence in the L2ARC is not needed,
as the cache will be wiped on boo.
https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/
Mục Lục

 Lịch sử ra đời ZFS


 ZFS Storage Data in memory
 Kiến trúc phần cứng triển khai ZFS SDS
 Kiến trúc pool disk trên ZFS Storage
 ZFS trên các hệ điều hành phổ biến A - Z
 Tunning & Test Perfromance
 Troubleshooting
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

SAS HBA
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

SAS HBA PCIex 2.0 x8 LSI SAS2 9207-8i


https://www.broadcom.com/products/storage/host-bus-adapters/sas-9207-8i#downloads
ZFS Storage Data in memory
Hardware

SAS HBA PCIex 2.0 x8 LSI SAS2 9207-8i

https://www.broadcom.com/products/storage/host-bus-adapters/sas-9207-8i#downloads
ZFS Storage Data in memory
Hardware

SAS HBA PCIex 2.0 x8 LSI SAS2 9201-16e

https://www.broadcom.com/products/storage/host-bus-adapters/sas-9201-16e#downloads
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

SAS HBA PCIex 3.0 16x

LSI SAS2 9202-16e

https://www.broadcom.com/products/storage/host-bus-adapters/sas-9202-16e
Kiến trúc phần cứng triển khai ZFS SDS
Hardware Models: 9400-16i | 9400-8i | 9400-16e | 9400-8e

HBAs 9400-16e

HBA 9405W-16E
HBAs with Tri-Mode SerDes SAS3 12Gbps PCIex 3.0
https://www.broadcom.com/products/storage/host-bus-adapters/sas-nvme-9405w-16e
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

Aeon J470 M3 JBOD

https://www.broadcom.com/products/storage/host-bus-adapters/sas-nvme-9405w-16e
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

Aeon J470 M3 JBOD


https://netbergtw.com/products/aeon-j470-m3/
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

Aeon J470 M3 JBOD


https://netbergtw.com/products/aeon-j470-m3/
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

Aeon J470 M3 JBOD

https://netbergtw.com/products/aeon-j470-m3/
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

SAS cable ext 2m mini2im sff-8088 to sff-8088


Dell.com
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

DELL G1WM3 mini-sas-hd cable sff-8644 to sff-8644


Dell.com
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

FC HBA
Fibre chanel Host bus adapter

https://www.broadcom.com/products/storage/host-bus-adapters/sas-nvme-9405w-16e
Kiến trúc phần cứng triển khai ZFS SDS
Hardware FC HBA 4Gbps

QLogic SANblade QLE2464 HBA PCIe 1.1 x8 Quad-Port PCIe-to-4Gbps Card


https://www.qlogic.com/
Kiến trúc phần cứng triển khai ZFS SDS
Hardware FC HBA 8Gbps

QLogic QLE2564 HBA PCIe 2.0 x8 Quad-Port FC 8Gbps


https://www.cavium.com/fc-adapters-products.html
Kiến trúc phần cứng triển khai ZFS SDS
Hardware FC HBA 16/32Gbps #QLE2764-SR-CK

QLogic QLE2764 HBA PCIe 3.0 x16 FC port 16/32Gbps QLE2694U


https://www.cavium.com/fc-adapters-products.html
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

NETWORK I/O
Fibre chanel Host bus adapter

https://www.broadcom.com/products/storage/host-bus-adapters/sas-nvme-9405w-16e
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

Dell Intel X520-DA2 10Gb SFP+ Dual Port Full Height Network Card - XYT17
Kiến trúc phần cứng triển khai ZFS SDS
Hardware

Intel Ethernet Converged Network Adapter X710-DA4 FH


Kiến trúc phần cứng triển khai ZFS SDS Hardware
Kiến trúc phần cứng triển khai ZFS SDS Hardware
Kiến trúc phần cứng triển khai ZFS SDS Hardware

Hardware

Dell PowerVault MD1200


Kiến trúc phần cứng triển khai ZFS SDS Hardware

Hardware

Dell PowerVault MD1200


Kiến trúc phần cứng triển khai ZFS SDS Hardware

Hardware

Tham khảo thêm tại


http://www.qdpma.com/storage/directattach.html
Hiểu rõ các thuật ngữ DAS, NAS, SAN, Storage
SAS, NL-SAS, FC HBA, SAS HBA, SAS Expander
Kiến trúc phần cứng triển khai ZFS SDS Hardware

Hardware

Dell PowerVault MD1200

https://www.broadcom.com/products/storage/host-bus-adapters/sas-nvme-9405w-16e
Mục Lục

 Lịch sử ra đời ZFS


 ZFS Cache - Data in memory
 Kiến trúc phần cứng triển khai ZFS SDS
 Kiến trúc pool disk trên ZFS Storage
 ZFS trên các hệ điều hành phổ biến A - Z
 Tunning & Test Perfromance
 Troubleshooting
Kiến trúc pool disk trên ZFS Storage

Raid0 tác dụng tăng tốc và tăng dung lượng lưu


trữ của hệ thống đĩa, Raid0 với 2 ổ đĩa có thể
tăng lên khoảng 150% so với ổ đơng
Chỉ dùng cho mục đích riêng, không dùng cho
production
Có khả năng mất dữ liệu bất cứ lúc nào khi có 1
đĩa fail, performance giảm khi có 1 ổ chạy chậm
Kiến trúc pool disk trên ZFS Storage

Raid1 tăng tính dự phòng, cân bằng đọc ghi, số


lượng ổ fail cho phép 01 HDD
Với hệ thống soft raid cho phép raid 1 với 3 ổ
cứng gọi là raid 1 3 way, cho phép fail 2 ổ mà
không ảnh hưởng đến hệ thống, nhược điểm
hiệu suất lưu trữ 33%
Kiến trúc pool disk trên ZFS Storage

Raid1+0 kết hợp 2 loại raid 1 và raid


0, tăng performance và tính dự phòng
Với hệ thống softraid có hỗ trợ raid 10
3way
Kiến trúc pool disk trên ZFS Storage

Raid 5 được tính toán parity trước khi lưu dữ liệu lên ổ cứng, dữ liệu và parity
được phân bố đều trên tất cả các ổ. Tối thiểu 03 ổ khởi tạo raid5, cho fail 1 ổ
Kiến trúc pool disk trên ZFS Storage

Raid 50 có các đặc điểm của raid5 và tăng performance


Kiến trúc pool disk trên ZFS Storage

Raid 6 có 02 parity được tính toán cho mõi lần ghi, và được chia đều parity và
dữ liệu trên các ổ, cho phép chết 2 ổ bất kỳ, an toàn dữ liệu hơn raid5
Kiến trúc pool disk trên ZFS Storage

Raid 60 có đặc điểm của raid 6 và tăng tốc, mở rộng nhờ raid0. Cho phép chết
02 ổ
Kiến trúc pool disk trên ZFS Storage

Với hệ thống ZFS có thể mở


rộng cache đến vài TB bằng
các card SSD NVMe.
Với những thao tác đọc ghi
dữ liệu nhỏ hơn cache hầu
hết được thực hiện trên
cache( RAM, SSD)
Kiến trúc pool disk trên ZFS Storage

Disk pool cho phép quản lý linh hoạt tầng đĩa ở bên dưới trên cùng 1 hệ thống
có thể có nhiều loại đĩa SSD Cache, SSD pool, FC SAS pool, NL-SAS pool
Với hệ thống ZFS quản lý đĩa dạng hybrid-pool: tăng cache Level 1 RAM, Cache
Level 2 ZIL là SSD write intensive, Cache L2 read SSD read intensive
Mục Lục

 Lịch sử ra đời ZFS


 ZFS Cache - Data in memory
 Kiến trúc phần cứng triển khai ZFS SDS
 Kiến trúc pool trên ZFS Storage
 ZFS trên các hệ điều hành phổ biến A - Z
 Tunning & Test Perfromance
 Troubleshooting
ZFS trên các hệ điều hành phổ biến A - Z
ZFS trên các hệ điều hành phổ biến A - Z
ZFS on Oracle Solaris
ZFS trên các hệ điều hành phổ biến A - Z
Hardware Storage ZFS

Phần cứng cơ bản đáp ứng cài đặt hệ điều hành Oracle Solaris( xem HCL)
CPU intel xeon x86_64 từ E5-2600 v1, v2, v3, v4, scaleable…
RAM tối thiểu 16GB
Card SAS HBA đồng bộ với SAS Expander và HDD SAS: SAS2, SAS3
Card Dual/Quad FC HBA nếu muốn kết nối storage bằng FC(emulex/qlogic)
Card Intel Dual/Quad port 10Gbps kết nối bằng iSCSI
Backplane hoặc disk enclosure hỗ trợ ổ cứng SAS2, SAS3 hot swap / hot plug
Ổ cứng có firmware hỗ trợ tính năng S.M.A.R.T(Self-Monitoring, Analysis and
Reporting Technology; often written as SMART)
HĐH đã hỗ trợ SAS2/SAS3 SSD và NVMe PCIex SSD
ZFS trên các hệ điều hành phổ biến A - Z
Install Oracle Solaris 11.3 x86_64

Cài đặt hệ điều hành Oracle Solaris 11.3 Text or GUI


Cấu hình thông mạng cho máy chủ. Static IP, DNS
Cài đặt group storage server để hỗ trợ FC Target driver và stmfadm
# pkg update
# pkg install storage-server
Mặc định hỗ trợ mpt2sas driver gồm các card HBA LSI 92xxx
Có hỗ trợ mpt3sas cho các card HBA LSI 93xxx
Có hỗ trợ FC Target bằng driver qlt và emlxs
Với card intel x520-da2 được hỗ trợ Oracle Solaris 11.3
ZFS trên các hệ điều hành phổ biến A - Z
Config Oracle Solaris 11.3 x86_64

Cấu hình FC Target Với card Emulex Cấu hình FC Target Với card qlogic
# vim +/target-mode /kernel/drv/emlxs.conf # vim +/qlc /etc/driver_aliases
Chuyển từ Chuyển từ
target-mode=0; qlc "pciex1077,2432“
Thành Thành
target-mode=1; qlt "pciex1077,2432"
ZFS trên các hệ điều hành phổ biến A - Z
Config Oracle Solaris 11.3 x86_64
Với các hệ thống sử dụng ổ cứng SSD hoặc ổ cứng hỗ trợ Advance format
4kn kiểm tra bằng
# devprop -n /dev/rdsk/c1t0d0s0 device-blksize device-pblksize
Khai báo các thông số ổ cứng trong
# vim /kernel/drv/sd.conf ( cho cuối file)

https://docs.oracle.com/cd/E36784_01/html/E36834/gizbc.html
http://www.oracle.com/technetwork/articles/servers-storage-admin/solaris-advanced-format-disks-2344966.html
update_drv -vf sd
echo ::sd_state | mdb -k | egrep '(^un|_blocksize)'
ZFS trên các hệ điều hành phổ biến A - Z
Config Oracle Solaris 11.3 x86_64
Điều chỉnh các tham số cho hệ thống và zfs được khai báo trong
# vim /etc/system
set zfs:zfs_default_bs=0xc >> ashift = 12( 4kn, 2^12)
set zfs:zfs_write_limit_override=0x30000000 >> tăng theo RAM
set zfs:zfs_write_limit_max=0x200000000 >> tăng theo RAM
set zfs:arc_reduce_dnlc_percent=0x2 >> giảm theo RAM 2 với 192GB
set zfs:zfs_no_write_throttle=0x1 >> on/off
set zfs:zfs_nocacheflush=0x1 >> không xóa cache
set zfs:zfs_vdev_cache_bshift=0xd >> 2^13 = 16k
set zfs:zfs_vdev_cache_size=0x1000000 >> 10MB
set zfs:zfs_vdev_aggregation_limit=0x20000 >> mặc định 32k
set zfs:zfs_unmap_ignore_size=0 >> disable unmap

https://docs.oracle.com/cd/E36784_01/html/E36834/gizbc.html
ZFS trên các hệ điều hành phổ biến A - Z
Config Oracle Solaris 11.3 x86_64

Sau khi reboot xong hệ điều hành kiểm tra mode của card FC xem là target chưa
# prtconf -D | grep qlt
# stmfadm list-target -v
# stmfadm list-state
Một số lệnh kiểm tra hệ thống trước khi cấu hình server làm storage(SAN)
# echo | format
# diskinfo -o Dn
# fmadm –faulty
# dmesg
# tail -500f /var/adm/messages
…….
ZFS trên các hệ điều hành phổ biến A - Z
Config Oracle Solaris 11.3 x86_64

# zpool create pool0 raidz2 c2t0d0 c2t0d1 c2t0d2 c2t0d3 c2t0d4 \


c2t0d5 c2t0d6 c2t0d7 c2t0d8 c2t0d9
# zpool export pool0
# zpool import pool0
# zfs set atime=off pool0
# zfs set compression=on pool0
# zfs set xattr=off pool0
# zfs get all pool0
# zpool status pool0
ZFS trên các hệ điều hành phổ biến A - Z
Config Oracle Solaris 11.3 x86_64

# zfs create -o compression=on -b 32k -s -V 2048G rpool/vvol0


# stmfadm create-lu --lu-prop blk=4096 /dev/zvol/dsk/pool0/vvol0
Logical unit created: 600144F064DC030000005B2BA81D0001
Retrieve the WWN of the Adapters
# fcinfo hba-port | grep "HBA Port WWN"
HBA Port WWN: 21000024ff309840
HBA Port WWN: 21000024ff309841
Create Target Group
# stmfadm create-tg solaris113target
Add Members to our Target Group
# stmfadm add-tg-member -g solaris113target wwn.21000024ff309840
# stmfadm add-tg-member -g solaris113target wwn.21000024ff309841
# svcadm enable svc:/system/stmf:default

https://www.itfromallangles.com/2011/08/adventures-in-zfs-configuring-fibre-channel-targe
ZFS trên các hệ điều hành phổ biến A - Z
Config Oracle Solaris 11.3 x86_64

Create Host Group


# stmfadm create-hg testhostg
Add Members to the Host Group
Cắm cable quang kết nối host và storage, hoặc kết nối qua SAN Switch
đã được zone host và SAN
# stmfadm list-target –v >> lấy thông tin wwn của host
# stmfadm add-hg-member -g testhostg wwn.2100001b32878b01
Create a View
# sbdadm list-lu
# stmfadm add-view -h testhostg -t solaris113target \
600144F064DC030000005B2BA81D0001
Tùy theo host là Linux, Windows, VMware ESXi kiểm tra LUN được cấp từ
SAN lên

https://www.itfromallangles.com/2011/08/adventures-in-zfs-configuring-fibre-channel-targe
ZFS trên các hệ điều hành phổ biến A - Z
ZFS on Omniosce
ZFS trên các hệ điều hành phổ biến A - Z
Config OmniOS Community Edition r151026

Cấu hình tương tự như oracle solaris 11.3


Phần khác biệt được trình bày ở slide riêng

https://docs.oracle.com/cd/E36784_01/html/E36834/gizbc.html
ZFS trên các hệ điều hành phổ biến A - Z
Config OmniOS Community Edition r151026

Dưới đây là phần khác biệt trong thiết lập zfs


Tạo rpool ngay lần cài đặt đầu tiên( raid1,.. Không cần card raid, hay cài OS trên
single disk
Cập nhật code mới nhất của OpenZFS, tối ưu hóa cho nền tảng x86_64
Cập nhật các tính năng mới của OpenZFS
Hệ thống chạy ổn định, performance tốt
Hệ thống mở và có nhiều tài liệu chia sẻ
Sử dụng không mất phí, không vi phạm bản quyền
Có thể hỗ trợ qua kênh Community, hoặc trả phí hỗ trợ
Có thể phát triển, đóng gói thành sản phẩm và bán được
ZFS trên các hệ điều hành phổ biến A - Z
Config OmniOS Community Edition r151026

Điều chỉnh các tham số cho hệ thống và zfs được khai báo trong
# vim /etc/system
set zfs:zfs_default_bs=0xc >> ashift = 12( 4kn, 2^12)
set zfs:zfs zfs_arc_min=738197504 # 1 / 16 of arc max
set zfs:zfs zfs_arc_max=11811160064 # 11G / total 12G mem
set zfs:zfs zfs_immediate_write_sz=402653184
set zfs:zfs zfs_vdev_async_write_max_active=32
set zfs:zfs zfs_vdev_async_write_min_active=10
set zfs:zfs zfs_vdev_async_read_max_active=16
set zfs:zfs zfs_vdev_async_read_min_active=16
ZFS trên các hệ điều hành phổ biến A - Z
Config OmniOS Community Edition r151026

Tài liệu tham khảo


https://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks
https://wiki.illumos.org/display/illumos/List+of+sd-config-
list+entries+for+Advanced-Format+drives
http://www.oracle.com/technetwork/articles/servers-storage-admin/solaris-
advanced-format-disks-2344966.html
http://www.datadisk.co.uk/html_docs/sun/sun_zfs_cs.htm
https://github.com/szaydel/Rigel-Major/blob/master/shell-snippets/zfs-tune-
one-liners
http://dtrace.org/blogs/brendan/2011/05/11/file-system-latency-part-1/ 2 3 4 5
http://www.oracle.com/technetwork/articles/servers-storage-admin/comstar-
zfs-virtualized-storage-2159053.html
https://constantin.glez.de/2010/04/28/ten-ways-to-easily-improve-oracle-
solaris-zfs-filesystem-performance/
https://calomel.org/zfs_raid_speed_capacity.html
ZFS trên các hệ điều hành phổ biến A - Z
ZFS on Linux
ZFS trên các hệ điều hành phổ biến A - Z
Fedoda 28 Storage ZFS

Phần cứng cơ bản đáp ứng cài đặt HĐH RHEL7, Ubuntu 16.0.4.3( xem HCL)
CPU intel xeon x86_64 từ E5-2600 v1, v2, v3, v4, scaleable…
RAM tối thiểu 16GB
Card SAS HBA đồng bộ với SAS Expander và HDD SAS: SAS2, SAS3
Card Dual/Quad FC HBA nếu muốn kết nối storage bằng FC(emulex/qlogic)
Card Intel Dual/Quad port 10Gbps kết nối bằng iSCSI
Backplane hoặc disk enclosure hỗ trợ ổ cứng SAS2, SAS3 hot swap / hot plug
SAS HDD có firmware hỗ trợ tính năng S.M.A.R.T(Self-Monitoring, Analysis and
Reporting Technology; often written as SMART)
OS Linux đã hỗ trợ SAS2/SAS3 SSD TRIM và NVMe PCIex SSD
ZFS trên các hệ điều hành phổ biến A - Z
Fedoda 28 Storage ZFS

Cài đặt hệ điều hành Fedora 28 server x86_64 dạng minimum


Cấu hình mạng và hostname, ntp client cho máy chủ
Thực hiện các lệnh
# cd /etc/yum.repo.d/
# mv fedora-update* /root
# wget http://download.zfsonlinux.org/fedora/zfs-release.fc28.noarch.rpm
# yum install -y targetcl kernel-devel kernel-headers smartmontools.x86_64 wget
# wget http://download.zfsonlinux.org/fedora/zfs-release.fc28.noarch.rpm
# rpm -ivh zfs-release.fc28.noarch.rpm
# yum install -y zfs
ZFS trên các hệ điều hành phổ biến A - Z
Fedoda 28 Storage ZFS

# echo 'options qla2xxx qlini_mode=disabled' > /usr/lib/modprobe.d/qla2xxx.conf


# echo zfs >> /usr/lib/modules-load.d/zfs.conf
# echo qla2xxx >> /usr/lib/modules-load.d/zfs.conf
Kiểm tra lại cấu hình bằng
# cat /usr/lib/modules-load.d/zfs.conf
# cat /usr/lib/modprobe.d/qla2xxx.conf
Kiểm tra hệ thống trước khi cấu hình storage
# dmesg
# tail -500f /var/log/message
# cat /var/log/boot.log
# journalctl
ZFS trên các hệ điều hành phổ biến A - Z
Fedoda 28 Storage ZFS

# vim /etc/modprobe.d/zfs.conf
options zfs zfs_arc_min=738197504 # 1 / 16 of arc maxoptions zfs
zfs_arc_max=11811160064 # 11G / total 12G mem
options zfs zfs_immediate_write_sz=402653184
options zfs zfs_vdev_async_write_max_active=32
options zfs zfs_vdev_async_write_min_active=10
options zfs zfs_vdev_async_read_max_active=16
options zfs zfs_vdev_async_read_min_active=16
# dracut -f -v
ZFS trên các hệ điều hành phổ biến A - Z
Fedoda 28 Storage ZFS

# zpool create -o ashift=12 pool0 raidz2 /dev/sd[b-k]


# zpool export pool0
# zpool import -d /dev/disk/by-id -N pool0
# zpool status pool0
# zfs list
# zdb -C | grep ashift >> ashift = 12
# zfs set recordsize=512k pool0
# zfs set compression=on pool0
# zfs set checksum=on/off pool0
# zfs set logbias=latency/throughput pool0
ZFS trên các hệ điều hành phổ biến A - Z
Fedoda 28 Storage ZFS

# modinfo zfs
# cp /root/fedora-updates.repo /etc/yum.repo.d/
# yum remove targetcli
# yum install targetcli
# systemctl enable target.service
# systemctl start target.service
# systemctl status target.service
# targetcli
ZFS trên các hệ điều hành phổ biến A - Z
Fedoda 28 Storage ZFS

Tài liệu tham khảo thêm


https://homerl.github.io/2015/12/04/Openzfs-tips/
ZFS trên các hệ điều hành phổ biến A - Z
ZFS on FreeBSD / FreeNAS
ZFS trên các hệ điều hành phổ biến A - Z
Hardware

Phần cứng cơ bản đáp ứng cài đặt FreeBSD 11( xem HCL)
CPU intel xeon x86_64 từ E5-2600 v1, v2, v3, v4, scaleable…
RAM tối thiểu 16GB
Card SAS HBA đồng bộ với SAS Expander và HDD SAS: SAS2, SAS3
Card Dual/Quad FC HBA nếu muốn kết nối storage bằng FC(emulex/qlogic)
Card Intel Dual/Quad port 10Gbps kết nối bằng iSCSI
Backplane hoặc disk enclosure hỗ trợ ổ cứng SAS2, SAS3 hot swap / hot plug
SAS HDD có firmware hỗ trợ tính năng S.M.A.R.T(Self-Monitoring, Analysis and
Reporting Technology; often written as SMART)
OS Linux đã hỗ trợ SAS2/SAS3 SSD TRIM và NVMe PCIex SSD
ZFS trên các hệ điều hành phổ biến A - Z
Hardware

Ưu điểm
Performance cực tốt, cài đặt dễ dàng
Quản trị giao diện web
Hỗ trợ replication giữa 2 storage cùng phiên bản
Có hỗ trợ FC Target dạng DAS
Hỗ trợ iSCSI
Hỗ trợ tốt VAAI, làm việc tốt với VMware
Nhược điểm
Thi thoảng lỗi kết nối với host ESXi
ZFS trên các hệ điều hành phổ biến A - Z

http://www.openstoragenas.com/TrueNAS-Z30-HA.asp
Mục Lục

 Lịch sử ra đời ZFS


 ZFS Storage Data in memory
 Kiến trúc phần cứng triển khai ZFS SDS
 ZFS trên các hệ điều hành phổ biến A - Z
 Tunning & Test Perfromance
 Troubleshooting
Mục Lục

 Lịch sử ra đời ZFS


 ZFS Storage Data in memory
 Kiến trúc phần cứng triển khai ZFS SDS
 ZFS trên các hệ điều hành phổ biến A - Z
 Khác nhau giữa OpenZFS và Oracle ZFS
 Tunning & Test Perfromance
 Troubleshooting
Tunning & Test Perfromance
Với hệ thống lưu trữ tập trung là rất quan trọng trong hệ thống Production
Để hệ thống trơn tru và đáp ứng tải trong quá trình hoạt động yêu cầu có thể
tunning hệ thống online ngay khi đang vận hành.
ZFS cho phép điều chỉnh các tham số đang chạy tức thì(online tunning).
Với Oracle Solaris ZFS đôi khi vấn đề giải quyết từ hãng Oracle >> mua
subcription OS Solaris
OpenZFS có thể có những bug phải chờ update code >> update version
Tunning & Test Perfromance
Tunning ZFS theo 1 số tài liệu tham khảo
https://constantin.glez.de/2010/04/28/ten-ways-to-easily-improve-oracle-
solaris-zfs-filesystem-performance/
https://calomel.org/zfs_raid_speed_capacity.html
Thiết kế hệ thống đáp ứng tải theo đầu bài toán đặt ra
+ Tăng số lượng đĩa và dự phòng trong cấu hình raid( raid1 3 way, raidz2,
raidz3)
+ Hệ thống hỗ trợ đĩa 4kn hoặc all flash 8kn >> Tăng perf 1 cách đáng kể
+ SAS3, Disk vendor cũng có ảnh hưởng đến tốc độ đọc ghi
+ Chọn dĩa ưu tiên tốc độ ghi, đọc từ RAM
+ Tối thiểu đủ RAM, thêm ram perf càng tốt
+ Upgrade firmware và driver cho hệ điều hành và phần cứng
+ Thiết kế hệ thống có tính dự phòng cao, tránh single point failure
+ Tối ưu hóa phần cứng theo channel memory,
+ CPU là 1 thành phần trong lưu trữ( compression, ….)
Tunning & Test Perfromance
Tunning ZFS theo 1 số tài liệu tham khảo
https://constantin.glez.de/2010/04/28/ten-ways-to-easily-improve-oracle-
solaris-zfs-filesystem-performance/
https://calomel.org/zfs_raid_speed_capacity.html
Thiết kế hệ thống đáp ứng tải theo đầu bài toán đặt ra
+ Tăng số lượng đĩa và dự phòng trong cấu hình raid( raid1 3 way, raidz2,
raidz3)
+ Hệ thống hỗ trợ đĩa 4kn hoặc all flash 8kn >> Tăng perf 1 cách đáng kể
+ SAS3, Disk vendor cũng có ảnh hưởng đến tốc độ đọc ghi
+ Chọn dĩa ưu tiên tốc độ ghi, đọc từ RAM
+ Tối thiểu đủ RAM, thêm ram perf càng tốt
+ Upgrade firmware và driver cho hệ điều hành và phần cứng
+ Thiết kế hệ thống có tính dự phòng cao, tránh single point failure
+ Tối ưu hóa phần cứng theo channel memory,
+ CPU là 1 thành phần trong lưu trữ( compression, ….)
+ Điều chỉnh tham số trong /etc/system hoặc /etc/modprobe.d/zfs.conf
Mục Lục

 Lịch sử ra đời ZFS


 ZFS Storage Data in memory
 Kiến trúc phần cứng triển khai ZFS SDS
 ZFS trên các hệ điều hành phổ biến A - Z
 Khác nhau giữa OpenZFS và Oracle ZFS
 Tunning & Test Perfromance
 Troubleshooting
Troubleshooting
# zpool status pool0
# zpool iostat pool0 1 10000
# iostat –En
# dmesg
# zpool import
Các phần mềm, dịch vụ tích hợp với OpenStack
Lab Demo

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy