Commit Graph

23 Commits

Author SHA1 Message Date
Mikolaj Golub
6b66c350a7 Make hastctl list command output current queue sizes.
Reviewed by:	pjd
MFC after:	1 month
2013-10-26 08:38:21 +00:00
Mikolaj Golub
14f200d97e Make hastctl(1) ('list' command) output a worker pid.
Reviewed by:	pjd
MFC after:	3 days
2013-07-01 18:41:07 +00:00
Mikolaj Golub
f7854e9247 Remove code duplication. 2013-04-21 20:51:53 +00:00
Dmitry Morozovsky
5632176c77 Rename 'status' command to 'list' and introduce new 'status' which produces
more terse output more observable for both scripts and humans.

Also, it shifts hastctl closer to GEOM utilities with their list/status command
pairs.

Approved by:	pjd
MFC after:	4 weeks
2013-03-14 22:29:37 +00:00
Pawel Jakub Dawidek
2ee08bd197 Removed redundant includes. 2013-03-14 21:21:14 +00:00
Mikolaj Golub
6559a21f71 Fix casting.
MFC after:	3 days
2013-02-26 20:19:45 +00:00
Mikolaj Golub
2adbba660d Add i/o error counters to hastd(8) and make hastctl(8) display
them.  This may be useful for detecting problems with HAST disks.

Discussed with and reviewed by:	pjd
MFC after:	1 week
2013-02-25 20:09:07 +00:00
Pawel Jakub Dawidek
2b1b224d24 For functions that return -1 on failure check exactly for -1 and not for
any negative number.

MFC after:	3 days
2012-01-10 22:39:07 +00:00
Pawel Jakub Dawidek
00bddd18b3 Prefer PJDLOG_ASSERT()/PJDLOG_ABORT() over assert().
MFC after:	3 days
2011-09-27 08:21:00 +00:00
Mikolaj Golub
1332d29cbc When exiting with error because of an invalid command line argument
use errx(3), not err(3), and the exit code from sysexits(3).

Approved by:	pjd (mentor)
2011-07-13 05:56:51 +00:00
Pawel Jakub Dawidek
3db86c39ae Keep statistics on number of BIO_READ, BIO_WRITE, BIO_DELETE and BIO_FLUSH
requests as well as number of activemap updates.

Number of BIO_WRITEs and activemap updates are especially interesting, because
if those two are too close to each other, it means that your workload needs
bigger number of dirty extents. Activemap should be updated as rarely as
possible.

MFC after:	1 week
2011-05-23 21:15:19 +00:00
Pawel Jakub Dawidek
0cddb12ffd Currently we are unable to use capsicum for the primary worker process,
because we need to do ioctl(2)s, which are not permitted in the capability
mode. What we do now is to chroot(2) to /var/empty, which restricts access
to file system name space and we drop privileges to hast user and hast
group.

This still allows to access to other name spaces, like list of processes,
network and sysvipc.

To address that, use jail(2) instead of chroot(2). Using jail(2) will restrict
access to process table, network (we use ip-less jails) and sysvipc (if
security.jail.sysvipc_allowed is turned off). This provides much better
separation.

MFC after:	1 week
2011-05-14 17:02:03 +00:00
Mikolaj Golub
610bc6ae4a Fix assert messages.
Approved by:	pjd (mentor)
2011-04-26 19:11:15 +00:00
Mikolaj Golub
64acad05cd Remove hast_proto_recv(). It was used only in one place, where
hast_proto_recv_hdr() may be used. This also fixes the issue
(introduced by r220523) with hastctl, which crashed on assert in
hast_proto_recv_data().

Suggested and approved by:	pjd (mentor)
2011-04-17 16:18:45 +00:00
Pawel Jakub Dawidek
4d8dc3b838 When dropping privileges prefer capsicum over chroot+setgid+setuid.
We can use capsicum for secondary worker processes and hastctl.
When working as primary we drop privileges using chroot+setgid+setuid
still as we need to send ioctl(2)s to ggate device, for which capsicum
doesn't allow (yet).

X-MFC after:	capsicum is merged to stable/8
2011-03-21 21:31:50 +00:00
Pawel Jakub Dawidek
4b6b8dd656 Forgot to commit this as a part of r219818.
MFC after:	1 week
2011-03-21 11:52:00 +00:00
Mikolaj Golub
e7272ff323 In command line options allow size to be specified using k/M/G/T
suffixes.

Approved by:	pjd (mentor)
MFC after:	1 week
2011-03-13 19:23:32 +00:00
Pawel Jakub Dawidek
dd5759bf72 Print some of the numbers in human readable form (using %N).
MFC after:	2 weeks
2011-03-07 10:42:28 +00:00
Pawel Jakub Dawidek
7cf48ac8c8 Drop privileges after connecting to hastd, but before sending or receiving
anything.

MFC after:	1 week
2011-02-03 10:44:40 +00:00
Bjoern A. Zeeb
5a1caf9a5d Add missing argument after r218192. 2011-02-02 20:00:35 +00:00
Pawel Jakub Dawidek
eeb3cd677d Add functions to initialize/finalize pjdlog. This allows to open/close log
file at will.

MFC after:	1 week
2011-01-27 19:24:07 +00:00
Doug Barton
36d8ab97a0 Update the arguments to yy_config_parse() to match r210883.
Choose the more conservative option ('yes' to exit on error) to match
the equivalent code in hastd.
2010-08-06 05:20:21 +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