Commit Graph

18 Commits

Author SHA1 Message Date
Pawel Jakub Dawidek
89bad89a59 If no listen address is specified, bind by default to:
tcp4://0.0.0.0:8457
	tcp6://[::]:8457

MFC after:	3 weeks
2011-05-20 11:16:25 +00:00
Pawel Jakub Dawidek
a87399ba7f Rename ipv4/ipv6 to tcp4/tcp6.
MFC after:	3 weeks
2011-05-20 11:15:27 +00:00
Pawel Jakub Dawidek
d4cb6369e6 In preparation for IPv6 support allow to specify multiple addresses to
listen on.

MFC after:	3 weeks
2011-05-19 23:18:42 +00:00
Pawel Jakub Dawidek
b64a692b64 Allow to specify remote as 'none' again which was broken by r219351, where
'none' was defined as a value for checksum.

Reported by:	trasz
MFC after:	1 week
2011-05-08 11:10:56 +00:00
Mikolaj Golub
0d9d733c57 Fix isitme(), which is used to check if node-specific configuration
belongs to our node, and was returning false positive if the first
part of a node name matches short hostname.

Approved by:	pjd (mentor)
2011-05-08 09:31:17 +00:00
Pawel Jakub Dawidek
20f32a33d2 Timeout must be positive.
MFC after:	1 week
2011-04-20 16:36:59 +00:00
Pawel Jakub Dawidek
ac6518673e The replication mode that is currently support is fullsync, not memsync.
Correct this and print a warning if different replication mode is
configured.

MFC after:	1 week
2011-04-12 19:13:10 +00:00
Pawel Jakub Dawidek
0b626a289e In hast.conf we define the other node's address in 'remote' variable.
This way we know how to connect to secondary node when we are primary.
The same variable is used by the secondary node - it only accepts
connections from the address stored in 'remote' variable.
In cluster configurations it is common that each node has its individual
IP address and there is one addtional shared IP address which is assigned
to primary node. It seems it is possible that if the shared IP address is
from the same network as the individual IP address it might be choosen by
the kernel as a source address for connection with the secondary node.
Such connection will be rejected by secondary, as it doesn't come from
primary node individual IP.

Add 'source' variable that allows to specify source IP address we want to
bind to before connecting to the secondary node.

MFC after:	1 week
2011-03-21 08:54:59 +00:00
Pawel Jakub Dawidek
8cd3d45ad9 Allow to compress on-the-wire data using two algorithms:
- HOLE - it simply turns all-zero blocks into few bytes header;
	it is extremely fast, so it is turned on by default;
	it is mostly intended to speed up initial synchronization
	where we expect many zeros;
- LZF - very fast algorithm by Marc Alexander Lehmann, which shows
	very decent compression ratio and has BSD license.

MFC after:	2 weeks
2011-03-06 23:09:33 +00:00
Pawel Jakub Dawidek
1fee97b01f Allow to checksum on-the-wire data using either CRC32 or SHA256.
MFC after:	2 weeks
2011-03-06 22:56:14 +00:00
Pawel Jakub Dawidek
a7130d73a6 Detect when resource is configured more than once.
MFC after:	3 days
2010-12-26 19:08:41 +00:00
Pawel Jakub Dawidek
66db33a13b When node-specific configuration is missing in resource section, provide
more useful information. Instead of:

	hastd: remote address not configured for resource foo

Print the following:

	No resource foo configuration for this node (acceptable node names: freefall, freefall.freebsd.org, 44333332-4c44-4e31-4a30-313920202020).

MFC after:	3 days
2010-12-26 19:07:58 +00:00
Pawel Jakub Dawidek
584a9bc3f8 Plug memory leaks.
Found with:	valgrind
MFC after:	3 days
2010-10-24 15:41:23 +00:00
Pawel Jakub Dawidek
0becad39a7 Allow to execute specified program on various HAST events.
MFC after:	2 weeks
Obtained from:	Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 15:16:52 +00:00
Pawel Jakub Dawidek
3f828c18e5 Reduce indent where possible.
MFC after:	2 weeks
Obtained from:	Wheel Systems Sp. z o.o. http://www.wheelsystems.com
2010-08-27 14:28:39 +00:00
Pawel Jakub Dawidek
bbbb114cda Prepare configuration parsing code to be called multiple times:
- Don't exit on errors if not requested.
- Don't keep configuration in global variable, but allocate memory for
  configuration.
- Call yyrestart() before yyparse() so that on error in configuration file
  we will start from the begining next time and not from the place we left of.

MFC after:	1 month
2010-08-05 19:08:54 +00:00
Pawel Jakub Dawidek
5571414ca8 Fix a problem where hastd will stuck in recv(2) after sending request to
secondary, which died between send(2) and recv(2). Do it by adding timeout
to recv(2) for primary incoming and outgoing sockets and secondary outgoing
socket.

Reported by:	Mikolaj Golub <to.my.trociny@gmail.com>
Tested by:	Mikolaj Golub <to.my.trociny@gmail.com>
MFC after:	3 days
2010-04-29 15:36:32 +00:00
Pawel Jakub Dawidek
32115b105a Please welcome HAST - Highly Avalable Storage.
HAST allows to transparently store data on two physically separated machines
connected over the TCP/IP network. HAST works in Primary-Secondary
(Master-Backup, Master-Slave) configuration, which means that only one of the
cluster nodes can be active at any given time. Only Primary node is able to
handle I/O requests to HAST-managed devices. Currently HAST is limited to two
cluster nodes in total.

HAST operates on block level - it provides disk-like devices in /dev/hast/
directory for use by file systems and/or applications. Working on block level
makes it transparent for file systems and applications. There in no difference
between using HAST-provided device and raw disk, partition, etc. All of them
are just regular GEOM providers in FreeBSD.

For more information please consult hastd(8), hastctl(8) and hast.conf(5)
manual pages, as well as http://wiki.FreeBSD.org/HAST.

Sponsored by:	FreeBSD Foundation
Sponsored by:	OMCnet Internet Service GmbH
Sponsored by:	TransIP BV
2010-02-18 23:16:19 +00:00