*New 11.3 series Release:
2019-10-05: XigmaNAS 11.3.0.4.6928 - released, 11.2 series are soon unsupported!

*New 12.0 series Release:
2019-10-05: XigmaNAS 12.0.0.4.6928 - released!

*New 11.2 series Release:
2019-09-23: XigmaNAS 11.2.0.4.6881 - released!

We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

Step by step CARP/HAST nas4free webui Doc/howto ?

Highly Available Storage.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
hidan
NewUser
NewUser
Posts: 1
Joined: 04 Feb 2013 04:49
Status: Offline

Step by step CARP/HAST nas4free webui Doc/howto ?

#1

Post by hidan » 04 Feb 2013 05:17

Is there docs or howto for this features for current nas4free version ?

al562
Advanced User
Advanced User
Posts: 221
Joined: 12 Dec 2012 08:02
Location: New Jersey, U.S.A.
Contact:
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#2

Post by al562 » 05 Feb 2013 04:19

Hi Hidan,

No there are not.
But we are always looking for volunteers to write it :) .

Regards,
Al

discostur
Starter
Starter
Posts: 17
Joined: 10 Jan 2013 16:24
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#3

Post by discostur » 06 Feb 2013 17:12

The short version is:

1. enable on both nodes CARP-Interfaces (one primary, one secondary)
2. enable HAST on both nodes and set the same configuration (disks) on both nodes
3. make your ZFS pool on top of the HAST devices

SBTech
NewUser
NewUser
Posts: 6
Joined: 19 Feb 2013 00:24
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#4

Post by SBTech » 19 Feb 2013 00:32

discostur wrote:The short version is:

1. enable on both nodes CARP-Interfaces (one primary, one secondary)
2. enable HAST on both nodes and set the same configuration (disks) on both nodes
3. make your ZFS pool on top of the HAST devices
Tried the short version, would really love a whole paragraph or two :)

Node 1
hast0 primary degraded

Node 2
hast0 secondary unknown

Can't seem to figure out what I have to do?

SBTech
NewUser
NewUser
Posts: 6
Joined: 19 Feb 2013 00:24
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#5

Post by SBTech » 19 Feb 2013 17:23

Like usually, I fight something for days and post to a forum and then figure it out.

Here are some steps for someone to move to the Wiki

1. Install Nas4Free (at least version 636?)
2. Configure CARP (Network->Interface Management)
a. Same Virtual Host ID on both Nodes
b. Same Virtual IP on both nodes
c. Same Password
d. Advertisement Skew should be lower on the primary node!
e. Link up action = /usr/local/sbin/carp-hast-switch master
f. Link down action = /usr/local/sbin/carp-hast-switch slave
3. Configure HAST (Services->HAST)
a. Create a resource on both nodes (system specific)
4. Create Filesystem

this is were it ends for my steps, I setup UFS, seems like everthing is geared to ZFS.

I would like to understand how to add my UFS hast drive to the Disks->Mounts so that the script auto mounts it?
Image

al562
Advanced User
Advanced User
Posts: 221
Joined: 12 Dec 2012 08:02
Location: New Jersey, U.S.A.
Contact:
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#6

Post by al562 » 20 Feb 2013 04:30

Hi SBTech,

Thanks for the high level procedure. Wish I had more help for you but I have not yet set this up on any of my systems (waiting for the right hardware to come along).
SBTech wrote:I would like to understand how to add my UFS hast drive to the Disks->Mounts so that the script auto mounts it?
That error looks awfully familiar and usually means one of 2 things, corrupt partition or no partition. Might be a dumb question, but it looks like the HAST device was successfully created, did you try to format the device as UFS/GPT before trying to mount it?

Regards,
Al

SBTech
NewUser
NewUser
Posts: 6
Joined: 19 Feb 2013 00:24
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#7

Post by SBTech » 20 Feb 2013 16:47

I'm pretty sure its a bug in the UI, my HAST0 device is up and running with UFS.

the dev name is /dev/hast/hast0 the mount script wants to append p1 to the end.

although my quick hack of /usr/local/sbin/carp-hast-switch is not working when switching nodes

master

Code: Select all

 mkdir /mnt/${disk}
 mount /dev/hast/${disk} /mnt/${disk}
slave

Code: Select all

unmount /mnt/${resources}
it looks like /usr/local/sbin/hastswitch is meant to mount UFS partitions that are setup in the disks->Mount point?

al562
Advanced User
Advanced User
Posts: 221
Joined: 12 Dec 2012 08:02
Location: New Jersey, U.S.A.
Contact:
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#8

Post by al562 » 20 Feb 2013 19:27

Hi SBTech,

FreeBSD normally assigns a partition number to a device, so as far as I can tell /dev/hast/hast0p1 should be created/exist.
For the WebGUI to be able to manage mounted partitions they need to show up in Disks > Mount Point Tab. If they don't then they can only be managed manually at a command line.
I am not a HAST/CARP expert so am unsure why you are seeing this behavior, I also do not have the necessary hardware to properly try and recreate this issue, sorry. You may want to file an official bug report, perhaps someone else can confirm the problem and the developers will then investigate.

Regards,
Al

discostur
Starter
Starter
Posts: 17
Joined: 10 Jan 2013 16:24
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#9

Post by discostur » 22 Feb 2013 11:43

after enabling & saving your HAST configuration, you have to manually restart your hast services. after that, you need to "hastctl create device1" and "hastctl role init device1" for every device you configured in your web-GUI. then you can assign primary and secondary status. have you done this before?

Kompaan
NewUser
NewUser
Posts: 1
Joined: 16 Mar 2013 20:25
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#10

Post by Kompaan » 16 Mar 2013 20:48

Hi everyone, new here on the forum, using freenas/nas4free for a while at home, but testing a few interesting features now, seeing if I can use this in a more professional manner.

I think I will do up a doc after setting this up in a VirtualBox lab today, can somebody proof read (especially the SSH bits) my notes and see if I'm making any stupid mistakes or missing anything? I'm going to try this again from scratch with my notes next weekend probably. Some steps are specific to ZFS, but I can make different version UFS if people would like that.

-----

VirtualBox
-----------
create 2 machines
2 NICs each
promiscuos mode on nics
one boot disk (ada0)
3 same size data disks on each (ada1-3)

initial setup on console on both:
-------------------------------------
Setup IPs on LAN, static, different

webinterface on both:
-----------
add CARP IP: exactly the same on both
Command for LINK_UP:
/usr/local/sbin/carp-hast-switch master
Command for LINK_DOWN
/usr/local/sbin/carp-hast-switch slave

add OPT1, static IP for HAST

create HAST config:
exactly the same

SSH:
----
on both:
hastctl create disk ada1
hastctl create disk ada2
hastctl create disk ada3

on slave:
hastctl role secondary ada1
hastctl role secondary ada2
hastctl role secondary ada3

on master:
hastctl role primary ada1
hastctl role primary ada2
hastctl role primary ada3

check HAST status on both: complete

webinterface:
----------------
add disks and format as zfs on master:
/dev/hast/ada1
/dev/hast/ada2
/dev/hast/ada3

create vdev on master
create pool on master

create samba config on master

add user on master

add PostInit script on both (seems to be needed to get drives out of init state):
/usr/local/sbin/carp-hast-switch slave

power off master

on slave:
import zfs pool, sync
create samba config on slave
add user on slave

power on master
check HAST status on both: complete

to check failover, with both devices on:
----------------------------------------------
power off slave
power on slave, wait for boot
check HAST status on both: complete

power off master
power on master
check HAST status on both: complete

slimkinny
NewUser
NewUser
Posts: 1
Joined: 18 Mar 2013 18:34
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#11

Post by slimkinny » 18 Mar 2013 18:40

Hi Kompaan,
thanks very much for your post. adding an entry for the hast script in postinit resolved my issue. I now feel comfortable that when I have one node that is not online for whatever reason, it will now come back in secondary mode.

I don't think this bug or feature is widely documented...well done :D

Jtcdesigns
Starter
Starter
Posts: 28
Joined: 05 Apr 2013 02:04
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#12

Post by Jtcdesigns » 05 Apr 2013 15:32

I'm not sure if I should add to this or start my own thread.... eitherway..

I have two nas4free boxes on the same build 9.1.0.1 rev 573 and they are on completely different hardware. For testing reasons I'll probably whip up another to test two of them on since the primary one is actually live and would be in a huge panic if I lost that data.

My question is... Do both servers have to have the same drives or capacity? The main one has two striped 3TB drives and the other will have 3 striped 2TB drives. Should give it relatively similar capacity. I'm new to this as I just switched over to Nas4free from freenas.

Currently they are both setup with 3 nic cards in an LACP configuration for a 3Gbit link. Ideally my thoughts were having both connect to the switch with a 2Gbit link and have the third link as a single ethernet cable from one server to the other.. possibly crossover cable. My fear is though they both sync.. how long does it actually take to sync and if it has that option of choosing which port to sync through. Then I'd atleast have a gigabit transfer speed which should suffice.

radek.fischer
NewUser
NewUser
Posts: 1
Joined: 15 May 2013 22:17
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#13

Post by radek.fischer » 15 May 2013 22:35

Kompaan wrote:Hi everyone, new here on the forum, using freenas/nas4free for a while at home, but testing a few interesting features now, seeing if I can use this in a more professional manner.

I think I will do up a doc after setting this up in a VirtualBox lab today, can somebody proof read (especially the SSH bits) my notes and see if I'm making any stupid mistakes or missing anything? I'm going to try this again from scratch with my notes next weekend probably. Some steps are specific to ZFS, but I can make different version UFS if people would like that.

-----

VirtualBox
-----------
create 2 machines
2 NICs each
promiscuos mode on nics
one boot disk (ada0)
3 same size data disks on each (ada1-3)

initial setup on console on both:
-------------------------------------
Setup IPs on LAN, static, different

webinterface on both:
-----------
add CARP IP: exactly the same on both
Command for LINK_UP:
/usr/local/sbin/carp-hast-switch master
Command for LINK_DOWN
/usr/local/sbin/carp-hast-switch slave

add OPT1, static IP for HAST

create HAST config:
exactly the same

SSH:
----
on both:
hastctl create disk ada1
hastctl create disk ada2
hastctl create disk ada3

on slave:
hastctl role secondary ada1
hastctl role secondary ada2
hastctl role secondary ada3

on master:
hastctl role primary ada1
hastctl role primary ada2
hastctl role primary ada3

check HAST status on both: complete

webinterface:
----------------
add disks and format as zfs on master:
/dev/hast/ada1
/dev/hast/ada2
/dev/hast/ada3

create vdev on master
create pool on master

create samba config on master

add user on master

add PostInit script on both (seems to be needed to get drives out of init state):
/usr/local/sbin/carp-hast-switch slave

power off master

on slave:
import zfs pool, sync
create samba config on slave
add user on slave

power on master
check HAST status on both: complete

to check failover, with both devices on:
----------------------------------------------
power off slave
power on slave, wait for boot
check HAST status on both: complete

power off master
power on master
check HAST status on both: complete
Hi Kompan,

thank you for your step-by-step howto. I followed it up to importing the zfs pool on slave where i got stuck with error saying 'No pool was found. Try to force import.'. I'm doing it in webgui by Disks|ZFS|Configuration|Detected and there 'Import on-disk ZFS config' button. And then - error, no pool found. The same when using 'zpool import <my_pool_name_on_master_machine>' shell command in console.

Both nodes were with status: complete.

Am I dooing it wrong way or missed I anything?

Radek

PS: I have an update. I forgot to mention that both machines are Hyper-V VMs. After additional googling I found that Hyper-V virtual switch/NIC can't do Promiscuous Mode which is essential for CARP to work. So the only solution for me now is to move back to VMWare.

danzi
Starter
Starter
Posts: 66
Joined: 11 Nov 2012 23:24
Location: Budapest
Status: Offline

Re: Step by step CARP/HAST nas4free webui Doc/howto ?

#14

Post by danzi » 31 Aug 2016 09:58

Hey guys,

Trying to replicate this with two virtual boxes. Both are bridged to my home router.

I did run into some questions, some of those I managed to get answers to.

/dev/ada1 is my disk in both virtual machines, so that is where I point my config.

I did add the disk as disk1, nodes are configured and the hastctl status command reports that disks are in init status.

Now, I cannot figure why, but the disk management menu reports the HAST disk1 device to be missing.

I will try to get some logs when I am back at my 'test lab'

Any first thoughts?
----------------------------------------------
Dell T130 - 32Gb ECC - ESXi 6.7
VM Full Instal - 11.2.0.4 - Omnius (revision 6005)
HP/LSI 9121-4i SAS2008 Pass Through mode
2 x 2Tb ZFS mirror
1 x 3Tb UFS
----------------------------------------------

Post Reply

Return to “HAST”