{"id":4377,"date":"2017-06-05T08:57:43","date_gmt":"2017-06-05T13:57:43","guid":{"rendered":"http:\/\/icesquare.com\/wordpress\/?p=4377"},"modified":"2021-06-03T16:47:12","modified_gmt":"2021-06-03T21:47:12","slug":"zfs-cluster-a-network-based-zfs-implementation","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/zfs-cluster-a-network-based-zfs-implementation\/","title":{"rendered":"ZFS Cluster: A Network-Based ZFS Implementation"},"content":{"rendered":"<p>I always like to experimenting the idea of building a ZFS cluster, i.e., it has the robust of the ZFS with the cluster capacity. So I came up a test environment with this prototype. Keep in mind that this is just a proof of concept rather than a production-ready solution. I mainly want to test the idea of ZFS cluster.<\/p>\n<p>The idea is pretty simple. Typically when we build the ZFS server, the members of the RAID are the hard drives. In my experiment, I use files instead of hard drives, where the corresponding files live in a network share (mounted via NFS). Since the bottle neck of the I\/O will be limited by the network, I include a network bonding to increase the overall bandwidth.<\/p>\n<p>The yellow servers are simply regular servers running ZFS with NFS service. I use the following command to generate a simple file \/ place holder for ZFS mounting:<\/p>\n<pre>\r\n#This will create an empty 1TB file, you can think of it as a 1TB hard drive \/ place holder.\r\ntruncate -s 1000G file.img\r\n<\/pre>\n<p>Make sure that the corresponding NFS service is serving the file.img to the client (the blue server).<\/p>\n<hr \/>\n<p>The blue server will be the NFS client of the yellow servers, where I will use it to serve the data to other computers. It has the following features:<\/p>\n<p>It has a network bonding based on three Ethernet adapter:<\/p>\n<pre>\r\n#cat \/proc\/net\/bonding\/bond0\r\n\r\n\r\nEthernet Channel Bonding Driver: v3.7.1 (April 27, 2011)\r\n\r\nBonding Mode: adaptive load balancing\r\nPrimary Slave: None\r\nCurrently Active Slave: enp0s25\r\nMII Status: up\r\nMII Polling Interval (ms): 1\r\nUp Delay (ms): 0\r\nDown Delay (ms): 0\r\n\r\nSlave Interface: enp0s25\r\nMII Status: up\r\nSpeed: 1000 Mbps\r\nDuplex: full\r\nLink Failure Count: 0\r\nPermanent HW addr: 00:19:d1:b2:1e:0d\r\nSlave queue ID: 0\r\n\r\nSlave Interface: enp6s0\r\nMII Status: up\r\nSpeed: 1000 Mbps\r\nDuplex: full\r\nLink Failure Count: 0\r\nPermanent HW addr: 00:18:4d:f0:12:7b\r\nSlave queue ID: 0\r\n\r\nSlave Interface: enp6s1\r\nMII Status: up\r\nSpeed: 1000 Mbps\r\nDuplex: full\r\nLink Failure Count: 0\r\nPermanent HW addr: 00:22:3f:f6:98:03\r\nSlave queue ID: 0\r\n<\/pre>\n<p>It mounts the yellow servers via NFS<\/p>\n<pre>\r\n#df\r\n192.168.1.101:\/storage\/share   25T  3.9T   21T  16%  \/nfs\/192-168-1-101\r\n192.168.1.102:\/storage\/share   8.1T  205G  7.9T   3% \/nfs\/192-168-1-102\r\n192.168.1.103:\/storage\/share   8.3T  4.4T  4.0T  52% \/nfs\/192-168-1-103\r\n<\/pre>\n<p>The ZFS has the following structure:<\/p>\n<pre>\r\n#sudo zpool status\r\n        NAME                                  STATE     READ WRITE CKSUM\r\n        storage                               ONLINE       0     0     0\r\n          raidz1-0                            ONLINE       0     0     0\r\n            \/nfs\/192-168-1-101\/file.img       ONLINE       0     0     0\r\n            \/nfs\/192-168-1-102\/file.img       ONLINE       0     0     0\r\n            \/nfs\/192-168-1-103\/file.img       ONLINE       0     0     0\r\n\r\nor:\r\n\r\nzpool create -f storage raidz \/nfs\/192-168-1-101\/file.img \\\r\n                              \/nfs\/192-168-1-102\/file.img \\\r\n                              \/nfs\/192-168-1-103\/file.img\r\n<\/pre>\n<hr \/>\n<p>The speed of the network will be the limitation of the system, I don&#8217;t expect the I\/O speed goes beyond 375MB\/s (125MB\/s x 3). Also since it is a file-based ZFS (the ZFS on the blue server is based on files, not disks), so the overall performance will be discounted.<\/p>\n<pre>\r\n#Write speed\r\ntime dd if=\/dev\/zero of=\/storage\/data\/file.out bs=1M count=1000\r\n1000+0 records in\r\n1000+0 records out\r\n1048576000 bytes (1.0 GB) copied, 3.6717 s, 285 MB\/s\r\n<\/pre>\n<pre>\r\n#Read speed\r\ntime dd if=\/storage\/data\/file.out of=\/dev\/null\r\n1000+0 records in\r\n1000+0 records out\r\n1048576000 bytes (1.0 GB) copied, 3.9618 s, 265 MB\/s\r\n<\/pre>\n<p>Both read and the write speed are roughly around 75% of the maximum bandwidth, which is not bad at all.<\/p>\n<p>So I decide to make one of the yellow servers offline, let&#8217;s see what&#8217;s going on:<\/p>\n<pre>\r\n#sudo zpool status\r\n        NAME                                  STATE     READ WRITE CKSUM\r\n        storage                               ONLINE       0     0     0\r\n          raidz1-0                            ONLINE       0     0     0\r\n            \/nfs\/192-168-1-101\/file.img       ONLINE       0     0     0\r\n            \/nfs\/192-168-1-102\/file.img       ONLINE       0     0     0\r\n            \/nfs\/192-168-1-103\/file.img       UNAVAIL      0     0     0 cannot open\r\n<\/pre>\n<p>And the pool is still functioning, that&#8217;s pretty cool!<\/p>\n<hr \/>\n<p>Here are some notes that will affect the overall performance:<\/p>\n<ul>\n<li>The quality of the Ethernet card matters, which includes PCIe or PCI, 1 lane or 16 lane, total throughput etc.<\/li>\n<li>The network traffic. Is the switch busy?<\/li>\n<li>How are you connect these servers together? One big switch or multiple switches that are bridged together. If they are bridged, the limitation will be the cable of the bridge, which is 125MB\/s for gigabit network.<\/li>\n<\/ul>\n<p>Again, this idea is just a proof of concept rather than for production purpose. If you decide to put this in a production environment, you may want to extend this idea further, such as:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4934\" data-permalink=\"https:\/\/icesquare.com\/wordpress\/zfs-cluster-a-network-based-zfs-implementation\/zfs-based-network2\/#main\" data-orig-file=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2017\/06\/ZFS-Based-Network2.jpg\" data-orig-size=\"2000,926\" data-comments-opened=\"1\" data-image-title=\"ZFS-Based-Network2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2017\/06\/ZFS-Based-Network2-1024x474.jpg\" src=\"http:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2017\/06\/ZFS-Based-Network2.jpg\" alt=\"\" width=\"2000\" height=\"926\" class=\"aligncenter size-full wp-image-4934\" srcset=\"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2017\/06\/ZFS-Based-Network2.jpg 2000w, https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2017\/06\/ZFS-Based-Network2-300x139.jpg 300w, https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2017\/06\/ZFS-Based-Network2-1024x474.jpg 1024w, https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2017\/06\/ZFS-Based-Network2-768x356.jpg 768w, https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2017\/06\/ZFS-Based-Network2-1536x711.jpg 1536w\" sizes=\"auto, (max-width: 2000px) 100vw, 2000px\" \/><\/p>\n<p>Have fun!<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I always like to experimenting the idea of building a ZFS cluster, i.e., it has the robust of the ZFS with the cluster capacity. So I came up a test <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/zfs-cluster-a-network-based-zfs-implementation\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":4378,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[146,144,6,109],"tags":[177],"class_list":["post-4377","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-everyday-computer-problem","category-sever-problem","category-technology","category-zfs","tag-zfs"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-18B","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1380,"url":"https:\/\/icesquare.com\/wordpress\/how-to-improve-zfs-performance\/","url_meta":{"origin":4377,"position":0},"title":"How to Improve ZFS performance","author":"Derrick","date":"August 24, 2014","format":false,"excerpt":"First Edition: March 14, 2010 Last Edited: January 10, 2026 \u00a0 In this tutorial, I will show you how to improve the performance of your ZFS using the affordable consumer-grade hardware (e.g., Gigabit network card, standard SATA non-SSD hard drives, consumer-grade motherboard etc.). Many people found a problem on their\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2011\/01\/zfs_logo.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":3914,"url":"https:\/\/icesquare.com\/wordpress\/zfs-linux-vs-freebsd\/","url_meta":{"origin":4377,"position":1},"title":"Running ZFS on Linux: Things you should know and be aware of","author":"Derrick","date":"February 29, 2016","format":false,"excerpt":"First Published: Feb 29, 2016 Last Revised: January 10, 2026 ZFS is a next-generation file system renowned for its reliability and advanced features. However, due to legal and licensing issues, it is not included by default in most Linux distributions. Fortunately, you can still install (ZFS on Linux) with just\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3447,"url":"https:\/\/icesquare.com\/wordpress\/zfs-compression-lz4-vs-lzjb\/","url_meta":{"origin":4377,"position":2},"title":"ZFS Compression: lz4 VS lzjb","author":"Derrick","date":"January 26, 2014","format":false,"excerpt":"ZFS offers a new compression method in the latest version: lz4. It claims to be better than lzjb. Since lzjb is pretty good already, I am curious to find out how good will lz4 be comparing to lzjb. According to my tests, lz4 is performing better than lzjb in terms\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3438,"url":"https:\/\/icesquare.com\/wordpress\/zfs-performance-boostimprovement-how-i-push-the-io-speed-to-126mbps\/","url_meta":{"origin":4377,"position":3},"title":"ZFS Performance Boost\/Improvement: How I push the I\/O speed to 126MBps","author":"Derrick","date":"January 25, 2014","format":false,"excerpt":"This article is part of my main ZFS tutorial: How to improve ZFS performance. That article covers everything you need. If you already have the basic knowledge, or you just want to know how I push the I\/O speed to 120+ MBps, you can skip that article and read this\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2014\/02\/speedometer.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2014\/02\/speedometer.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2014\/02\/speedometer.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2014\/02\/speedometer.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/icesquare.com\/wordpress\/wp-content\/uploads\/2014\/02\/speedometer.jpg?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":4436,"url":"https:\/\/icesquare.com\/wordpress\/how-to-fix-the-mess-created-by-zfs-on-linux-after-update\/","url_meta":{"origin":4377,"position":4},"title":"&#8220;ZFS on Linux&#8221;: The ZFS modules are not loaded. Try running &#8216;\/sbin\/modprobe zfs&#8217; as root to load them.","author":"Derrick","date":"April 10, 2018","format":false,"excerpt":"Last Updated: Oct 10, 2021 This article is based on my experience with CentOS 7. If you are running other Linux distributions, please adjust the commands and package names accordingly (e.g., yum --> apt-get). As of Oct 3, 2019, I cannot get ZFS on Linux running on CentOS 8. ZFS\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1214,"url":"https:\/\/icesquare.com\/wordpress\/building-a-super-large-and-reliable-file-server-with-mixed-size-of-harddisks\/","url_meta":{"origin":4377,"position":5},"title":"Building a Super Large and Reliable File Server with Mixed Size of Harddisks","author":"Derrick","date":"January 17, 2011","format":false,"excerpt":"In this article, I am going to show you how to build a super large, ultra reliable, expandable file server with mixed size of hard drives. Here is my criteria: Large Storage Capacity. At this moment, the largest hard drive is 2TB. I am looking for at least 10TB. Great\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"\/wordpress\/wp-content\/uploads\/2011\/01\/zfs_logo-150x150.jpg","width":350,"height":200},"classes":[]}],"jetpack_featured_media_url":"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2017\/06\/ZFS-Based-Network.jpg","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/4377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=4377"}],"version-history":[{"count":21,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/4377\/revisions"}],"predecessor-version":[{"id":4937,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/4377\/revisions\/4937"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media\/4378"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=4377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=4377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=4377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}