How do you guys on this list normally deal with the ulog files? Kill
everything but the last 5? Use the inform command to determine which
are no longer relevant? Via cron?
Anyone have a script or two they'd like to share? :)
Jeff
I made the tokyotyrant ruby gem (also just a commandline program) to manage my
tyrant clusters. 'archive-ulog' is one of the sub commands.
$ tyrantmanager archive-ulogs --help
NAME
tyrantmanager v1.4.1
SYNOPSIS
tyrantmanager archive-ulogs instances [options]+
DESCRIPTION
Archive the ulog files that are no longer necessary for replication
PARAMETERS
instances (1 -> list(instances=all))
A comman separated list of instance names the tyrant manager knows
about
--home=home (0 ~> home=/var/lib/tyrant)
The home directory of the tyrant manager
--log-level=log-level (0 ~> log-level)
The verbosity of logging, one of [ debug, info, warn, error, fatal ]
--archive-method=archive-method (0 ~> archive-method=compress)
The method of archiving, compress, or delete. Choosing 'delete' will
also delete previously 'compressed' ulog files.
--dry-run
Do not archive, just show the commands
--slaves=slaves (0 ~> list_of_string(slaves))
Comma separated list of slave instances connection strings
host:port,host:port,...
--help, -h
AUTHOR
Copyright 2009 (c) Jeremy Hinegardner
I run via cron every night:
/usr/local/bin/tyrantmanager archive --home /var/lib/tyrant/
enjoy,
-jeremy
--
========================================================================
Jeremy Hinegardner jer...@hinegardner.org
On a similar note, the documentation for ttservctl suggests that logs
will rotate when sent a SIGHUP signal. I have tried both "ttservcrtl
hup" and "kill -HUP processid" with no luck. Though I can't see what I
am doing wrong, the server does restart according to the log.
http://1978th.net/tokyotyrant/spex.html#serverprog_ttservctl
I think that the this is to support debug/error log rotation, not ulog
rotation. Hitting the server with HUP makes the server close and reopen
the debug/error log. You would use this in combination with something
like logrotate to rotate the logs and then hit ttserver with HUP in the
'postrotate' section of the logrotate config.
This would have ttserver close its log file handles and then open up
the log file again, which would create the file again, since the old
one had been moved by logrotate.
I just tested this scenario and that appears to be what happens. Hittting
ttserver with HUP does not have it reopen the ulog files, it only has it reopen
then debug/error log file.