Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_storage_zfs [2020/02/06 17:44] – [Manage a Pool] andonovjlinux_storage_zfs [2020/02/13 18:26] (current) – external edit 127.0.0.1
Line 1: Line 1:
 =====Overview===== =====Overview=====
 +ZFS stands for Zettabyte File system and to save you a lot of boring reading it is a file system which protects agains data corruption provide high redundancy and high availability. It was designed by Sun Microsystems and there are two implementations in nutshell:
 +
 +  * Oracle ZFS 
 +  * OpenProject ZFS
 +
 +Both implementations are pretty close to each other and both are widely used in the IT world to provide availability FS with high protection and performance.
 ZFS is native to Oracle NAS Storage Appliance. With ZFS you can create a pool which you can share with out appliances through either NFS or Samba.  ZFS is native to Oracle NAS Storage Appliance. With ZFS you can create a pool which you can share with out appliances through either NFS or Samba. 
  
Line 15: Line 21:
 </code> </code>
  
-The following command, will create you a pool comprised by 10 disks in raid-5 configuration with double parity. The pool name is called: "tank".+The following command, will create you a pool comprised by 10 disks in raid-5 configuration with double parity. The pool name is called: "tank" and with compression lz4You can choose one of these compression algorithms by the way :) 
 + 
 +  * On 
 +  * Off 
 +  * lzjb 
 +  * gzip 
 +  * gzip[1-9] 
 +  * zle 
 +  * lz4 <- The one used here and it is pretty good
  
 You can also list the status of the created pool as follows: You can also list the status of the created pool as follows:
  
-<code:none|Pool status>+<code:none| Pool status>
 [root@hostname ~]# zpool list -v [root@hostname ~]# zpool list -v
 NAME   SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT NAME   SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
Line 38: Line 52:
 If you are worried about the integrity of the pool, you can of course perform integrity check and verify the data corruption as follows: If you are worried about the integrity of the pool, you can of course perform integrity check and verify the data corruption as follows:
  
-<code:none|Check Integrity> +<code:none| Check Integrity> 
-[root@hostname ~]# zpool status -v tank+[root@hostname ~]# zpool scrub tank 
 +[root@hostname ~]# zpool status
   pool: tank   pool: tank
  state: ONLINE  state: ONLINE
- scrub: scrub completed after 0h7m with 0 errors on Tue Tue Feb  2 12:54:00 2010+  scan: scrub repaired 0B in 0h56m with 0 errors on Mon Aug 12 12:40:46 2019
 config: config:
 +
         NAME        STATE     READ WRITE CKSUM         NAME        STATE     READ WRITE CKSUM
         tank        ONLINE               0         tank        ONLINE               0
-         raidz2: +          raidz2-0  ONLINE               0 
- disk1      ONLINE  0 0 0 +            disk1   ONLINE               
- disk2      ONLINE  0 0 0 +            disk2   ONLINE               
- disk3      ONLINE  0 0 0 +            disk3   ONLINE               
- disk4      ONLINE  0 0 0 +            disk4   ONLINE               
- disk5      ONLINE  0 0 0 +            disk5   ONLINE               
- disk6      ONLINE  0 0 0 +            disk6   ONLINE               
- disk7      ONLINE  0 0 0 +            disk7   ONLINE               
- disk8      ONLINE  0 0 0 +            disk8   ONLINE               
- disk9      ONLINE  0 0 0 +            disk9   ONLINE               
- disk10     ONLINE  0 0 0+            disk10  ONLINE               0
  
 errors: No known data errors errors: No known data errors
Line 62: Line 78:
  
 P.S. you can stop the scrubbing with: zpool scrub -s tank P.S. you can stop the scrubbing with: zpool scrub -s tank
 +[root@hostname ~]# zpool scrub -s tank
 </code> </code>
  
Line 67: Line 84:
  
 ====Create file system==== ====Create file system====
-The ZFS will be shared either over SMB (Samba) or NFS(Network File system) to other machines. NFS is create way to setup Oracle RAC (with Direct NFS of course) and Samba is great way for a backup solution.+The ZFS will be shared either over SMB (Samba) or NFS(Network File system) to other machines. NFS is great way to setup Oracle RAC (with Direct NFS of course) and Samba is great way for a backup solution.
  
 So let's create NFS :) So let's create NFS :)
Line 73: Line 90:
 The command is fairly simple: The command is fairly simple:
  
-<code:none|Create ZFS File system>+<code:none| Create ZFS File system>
 [root@hostname ~]# zfs create tank/backup [root@hostname ~]# zfs create tank/backup
 </code> </code>
Line 79: Line 96:
 We can create also multiple aggregation of that file system, for example: We can create also multiple aggregation of that file system, for example:
  
-<code:none|Create ZFS File system>+<code:none| Create Accumulative ZFS File system>
 [root@hostname ~]# zfs create tank/backup/servers/server_name [root@hostname ~]# zfs create tank/backup/servers/server_name
 </code> </code>
Line 85: Line 102:
 You can check the status of the file systems as well, very easy, as follows: You can check the status of the file systems as well, very easy, as follows:
  
-<code:none|List ZFS File Systems>+<code:none| List ZFS File Systems>
 [root@hostname ~]# zfs list [root@hostname ~]# zfs list
 NAME                          USED  AVAIL  REFER  MOUNTPOINT NAME                          USED  AVAIL  REFER  MOUNTPOINT
Line 102: Line 119:
 In the past, sharing of the NFS was done via the following commands: In the past, sharing of the NFS was done via the following commands:
  
-<code:none|Old way of sharing ZFS as NFS>+<code:none| Old way of sharing ZFS as NFS>
 [root@hostname ~]# share -F nfs /tank [root@hostname ~]# share -F nfs /tank
 [root@hostname ~]# cat /etc/dfs/sharetab [root@hostname ~]# cat /etc/dfs/sharetab
Line 121: Line 138:
  
 It is uselessly to say that the NFS port (111) should be allowed both ways :)  It is uselessly to say that the NFS port (111) should be allowed both ways :) 
 +
 +
 For example: server_one (111) <-> (111) Oracle_NAS_Server (111) <-> (111) server_two For example: server_one (111) <-> (111) Oracle_NAS_Server (111) <-> (111) server_two
 +
 +
 Of course, such configuration (with READ-ONLY) isn't suitable for RAC, if you don't want to hit your head in the wall long time. If you wish, to do so, please go ahead and try to install RAC on that :) Of course, such configuration (with READ-ONLY) isn't suitable for RAC, if you don't want to hit your head in the wall long time. If you wish, to do so, please go ahead and try to install RAC on that :)
  
 That command will update also the sharetab file of course: That command will update also the sharetab file of course:
  
-<code:none|Check the sharing settings>+<code:none| Check the sharing settings>
 [root@tbp-slm-zfs01 ~]# cat /etc/dfs/sharetab [root@tbp-slm-zfs01 ~]# cat /etc/dfs/sharetab
 /tank/backup/zfsForServerOne    -       nfs     rw=@serverOne/16,ro=@serverTwo/28 /tank/backup/zfsForServerOne    -       nfs     rw=@serverOne/16,ro=@serverTwo/28
Line 133: Line 154:
 After you start the NFS server on the Oracle NAS, you can try to mount it on serverOne and serverTwo. I will not cover this as I have done in other section, but it will look like a normal NFS: After you start the NFS server on the Oracle NAS, you can try to mount it on serverOne and serverTwo. I will not cover this as I have done in other section, but it will look like a normal NFS:
  
-<code:none|NFS on serverOne>+<code:none| NFS on serverOne>
 [root@serverOne]# df [root@serverOne]# df
 Filesystem                                 1K-blocks       Used  Available Use% Mounted on Filesystem                                 1K-blocks       Used  Available Use% Mounted on
Line 148: Line 169:
  
 Cheers and enjoy :) Cheers and enjoy :)
 +
 +=====Compression Options=====
 +For more info you can check here :) [[https://www.servethehome.com/the-case-for-using-zfs-compression/ | Compression Algorithms]]
  • linux_storage_zfs.1581011052.txt.gz
  • Last modified: 2020/02/07 01:44
  • (external edit)