[InProgress] Configure NAS4Free High Availabilty Storage CARP/HAST/ZFS

This system comprises of:

  • two Sun X4100 M2 servers
  • USB boot drive with Embedded NAS4Free.
  • nfe0 (NET0) is assigned the LAN port, connected to a gigabit switch
  • nfe1 (NET1) is assigned the OPT1 (renamed CARP) port, connected via crossover cable to the other machines nfe1.
  • SATA hard drives: da0 is in slot 0, da1 in slot 1, da2 in slot 3, and nothing in slot 4.

Note: The actual IPs were changed to protect the innocent.

Note: Your device names “/dev/da0” may be different than mine.

Configure SSH (testing only)

On Both:

Enable SSH (Services->SSH)

  • Check enabled
  • Check Permit root login

Hostnames

On Both:

Set Hostnames (Network->Hosts)

  • prolinefs1 = 192.168.1.31
  • prolinefs2 = 192.168.1.32

Configure CARP

On Master:

Configure OPT1 (Network->Opt1)

  • Type= Static
  • Description = CARP
  • IP address = 192.168.23.31 /24

Configure CARP (Network->Interface Management->CARP)

  • Virtual Host ID = 1
  • Virtual IP = 192.168.23.1
  • Password = nunyabeezwax
  • Advertisement Skew = 1
  • Link up action = /usr/local/sbin/carp-hast-switch master
  • Link down action = /usr/local/sbin/carp-hast-switch slave

 

On Slave:

Configure OPT1 (Network->Opt1)

  • Type = Static
  • Description = CARP
  • IP address = 192.168.23.32 /24

Configure CARP (Network->Interface Management->CARP)

  • Virtual Host ID = 1
  • Virtual IP = 192.168.23.1
  • Password = nunyabeezwax
  • Advertisement Skew = 100
  • Link up action = /usr/local/sbin/carp-hast-switch master
  • Link down action = /usr/local/sbin/carp-hast-switch slave

Configure HAST

On Both:

Configure HAST (Services->HAST->Resources)

  • Resource name = da0
  • Node name = prolinefs1
  • Path = /dev/da0
  • Node B IP address = 192.168.1.32
  • Node name = prolinefs2
  • Path = /dev/da0
  • Node A IP address = 192.168.1.31
  • Resource name = da1
  • Node name = prolinefs1
  • Path = /dev/da1
  • Node B IP address = 192.168.1.32
  • Node name = prolinefs2
  • Path = /dev/da1
  • Node A IP address = 192.168.1.31
  • Resource name = da2
  • Node name = prolinefs1
  • Path = /dev/da2
  • Node B IP address = 192.168.1.32
  • Node name = prolinefs2
  • Path = /dev/da2
  • Node A IP address = 192.168.1.31

Now the fun part.

  1. Shut down master, configure slaves disk resources
  2. Shut down slave, boot master, configure master disk resources
  3. Boot slave, play click Services->Hast->Switch VIP to BACKUP on both machines and watch the failovers happen.

 

Configure Disk Resources (SSH to machines)

On Both:

  • hastctl role init da1; hastctl role init da2; hastctl role init da3; hastctl create da1; hastctl create da2; hastctl create da3;

On Slave:

  • hastctl role secondary da1; hastctl role secondary da2; hastctl role secondary da3;

On Master:

  • hastctl role primary da1; hastctl role primary da2; hastctl role primary da3;

On Both:

  • hastctl status (Check for ‘complete’)

 

More fun! Since /dev/hast doesn’t exist until a machine is master. ZFS can only be configured with one machine running.

  1. Shut down the slave and configure the master from Configure ZFS to, including, Add Directories.
  2. Shut down the master, boot the slave, and configure the slave from Configure ZFS, EXCLUDING, Add Directories.
  3. Shut down the slave. Start the master, then start the slave. Give it a few seconds!

 

Configure ZFS

On Both:

Add disks (Disks->Management)

NOTE: NAS4Free 9.2.X, HAST DEVICES NOT LISTED IN MANAGEMENT WINDOW!

  • /dev/hast/da0, /dev/hast/da1 and /dev/hast/da2
  • Advanced Power Management: Level 254
  • Acoustic level: Maximum performance
  • S.M.A.R.T.: Checked
  • Preformatted file system: ZFS storage pool device

Format as zfs (Disks->Format)

Create Virtual Device on master (Disks->ZFS->Virtual device)

  • Name = raidz
  • Type = Single parity ZRaid
  • Devices = /dev/hast/da1   /dev/hast/da2
  • Name = spare
  • Type = Hot Spare
  • Devices = /dev/hast/da3

Add Pools(Disks->ZFS->Pools->Management)

  • Name = pool
  • Virtual Devices = raidz   spare

Add Directories (Advanced->FileManager) MASTER ONLY!!

  • proline
  • apps

 

Tests

Services->HAST->Resources

Master:

Should show all resources as primary and complete

Slave:

Should show all resources as secondary and complete

Disks->ZFS->Pools->Information

Master:

  pool: pool
 state: ONLINE
  scan: none requested
config:

	NAME          STATE     READ WRITE CKSUM
	pool          ONLINE       0     0     0
	  raidz1-0    ONLINE       0     0     0
	    hast/da1  ONLINE       0     0     0
	    hast/da2  ONLINE       0     0     0
	spares
	  hast/da3    AVAIL

errors: No known data errors

Slave:

no pools available

SSH in and run ls /mnt/pool

Master

prolinefs1: ~ # ls /mnt/pool
apps proline
prolinefs1: ~ #

Slave

prolinefs2: ~ # ls /mnt/pool
prolinefs2: ~ #

Click the Services->HAST->Switch VIP to Backup button and recheck all the Tests

 

If you have errors, check /var/log/system.log and both machines configuration.

I had split brain errors when the machines were first brought online.  Since I knew the first machine configured was correct I SSH’d in and reran the Disk Configuration on the slave:

# hastctl role init da1; hastctl role init da2; hastctl role init da3; hastctl create da1; hastctl create da2; hastctl create da3; hastctl role secondary da1; hastctl role secondary da2; hastctl role secondary da3;

 

 

 

 

 

 

 

 

To do & misc scraps to ignore:

  • dynamic ip addresses
  • create samba config
  • add users on master
  • maybe add PostInit script on both if drives get stuck in init :  /usr/local/sbin/carp-hast-switch slave
  • import zfs pool, sync

Post created by: David Gregory Medina

One comment on “[InProgress] Configure NAS4Free High Availabilty Storage CARP/HAST/ZFS
  1. Janketh says:

    Thanks for covering this! I’m going to be attempting to set this up in the near future with 2x HA N4F servers connected to a single JBOD. This will certainly be helpful.

Leave a Reply