Storage Clustering via HAST Framework in FreeBSD 12.0

Assistanz Networks

Highly Available Storage (HAST) framework, allows transparent storage of the same data across several physically separated machines connected by a TCP/IP network. High availability is one of the main requirements in serious business applications and highly-available storage is a key component in such environments.

 

The following are the main features of HAST:

  • Can be used to mask I/O errors on local hard drives.
  • File system agnostic as it works with any file system supported by FreeBSD.
  • Efficient and quick resynchronization as only the blocks that were modified during the downtime of a node is synchronized.
  • Can be used in an already deployed environment to add additional redundancy.
  • Together with CARP, Heartbeat, or other tools, it can be used to build a robust and durable storage system.

HAST Configuration

In this document, we are going to see on how to replicate the zfs volume (zvol) of same size using HAST. Main source is from https://www.freebsd.org/doc/handbook/disks-hast.html . Configuring HAST is very simple process which involves a configuration file (hast.conf), hast utility tool (hastctl) and a hastd daemon process which provides data synchronization between ‘Master’ and ‘Secondary’ node.

 

Configuration is done using /etc/hast.conf file and this file should be identical on both the nodes. I have written a shell script which will automatically configure the hast in master and secondary nodes according to the provided values. Also make sure the same IP address is added as a carp IP in both the nodes. To know more about the CARP IP configuration, please refer the FreeBSD article https://www.freebsd.org/doc/handbook/carp.html .

 

Note: Before running the hastconf.sh script, make sure master node RSA public key is added as authorized key in the secondary node so that, master node can transfer file to the secondary node without password via scp.

 

Script can be downloaded from the git link https://gitlab.com/freebsd1/hast . Instructions on how to run this script is at ‘README’ file.

 

During execution of hastconf.sh, few values should be passed to create hast.conf file in both the nodes,

# ./hastconf.sh <remote_host> <remote_ip> <carp_ip> <remote_poolname> <vol_path> <vol_size> <hastvol_name>

Where,

  • remote_host => hostname of the secondary node
  • remote_ip => IP address of the secondary node
  • carp_ip => Shared carp IP used for failover
  • remote_poolname => Pool name created already in secondary node
  • vol_path => zvol created in primary node, have to provide the full path of it.
  • vol_size => size of the created zvol in primary node, such as 15G/50G.
  • hastvol_name => User defined name for the hast volume.

 

After this, should be able to see the configuration file at /etc/hast.conf in both the nodes and this file WILL be identical.

 

Failover Configuration with CARP

 

In order to achieve the robust storage system which is resistant to the failure of any given node. If the primary node fails, the secondary node is there to take over seamlessly, check and mount the file system, and continue to work without missing a single bit of data. To achieve this, CARP (Common Address Redundancy Protocol) is used along with carp switch script is used to automatically make the secondary node as primary when the primary node fails.

 

Copy the content of this file https://gitlab.com/freebsd1/hast/-/blob/master/devd-conf.txt in to the file /etc/devd.conf  and then copy the script ‘carp-hast-switch.sh’ to the directory /usr/local/sbin/ and then restart the devd service.

 

# service devd restart

 

Note: The above mentioned step has to be followed in both the machines.

 

Then run the command “# hastctl status” in both the nodes and check the output which should show as below:

Node1

 

hast-status

 

Node2

 

hast-status

 

That’s it. ZFS volume has been successfully replicated using HAST. By using this volume /dev/hast/<hastvol>, one can create an iSCSI storage without any issue.

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts
zfs pool usage

ZFS Pool and Dataset Usage

ZFS Pool and Dataset Usage   I am back with another blog to provide the useful script to the Freebsd users to determine the zpool

Assistanz Networks

Installing Zabbix Agent in FreeBSD 12.0

Zabbix Agent Installation and Configuration Guide on FreeBSD 12.0   Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support