On Wed, 2007-07-11 at 16:09 -0400, Ofer Inbar wrote:
> Matthias Blankenhaus <[EMAIL PROTECTED]> wrote:
> > First of, you need to reroute your data, e.g. to /dev/shm. So in
> > gmetad.conf I have the following:
> [...]
> > Secondly, in /etc/init.d/gmetad you need to create /dev/shm/rrds before
> > using it. So I have this:
> [...]
> > Thirdly, you need some logic to archive the rrds from /dev/shm/ to a
> > disk.
>
> Bernard Li <[EMAIL PROTECTED]> wrote:
> > You can also just mount /var/lib/ganglia/rrds as tmpfs:
> >
> > none /var/lib/ganglia/rrds tmpfs size=1024M,mode=755,uid=nobody,gid=root
> > 0 0
>
> It sounds like you've both done this. However, both of you leave out
> something I think would be important: after a reboot, how do you get
> the existing RRDs into place before gmetad begins, so that you
> maintain historical data rather than starting a brand new set of RRDs
> at each boot? Do you do this?
>
> With Matthias' method, you could add some more lines to the portion
> of /etc/init.d/gmetad that creates /dev/shm/rrds, to then rsync your
> RRDs from disk. That shouldn't interface with later restarts because
> if the directory already exists, it won't rsync. If you've done this,
> have you run into any problems?
>
> With Bernard's method, it is either mounted at boot time, or
> /etc/init.d/gmetad needs to check for it and mount it. If it mounts
> at boot, how do you handle copying the existing RRD files into place
> before starting gmetad?
> -- Cos
We do it with a modified gmetad init script (patch attached from old
version of gmetad), and for backups, we just do a nightly restart of
gmetad.
I haven't tried the backup/restore with rsync, but with tar, doing it on
a live rrds directory would almost always result in at least one IO
error from what I think was tar trying to read a file at the same exact
time that it was being changed by gmetad. This is why we do it by
restarting gmetad, and only once a day.
~Jason
--
/------------------------------------------------------------------\
| Jason A. Smith Email: [EMAIL PROTECTED] |
| Atlas Computing Facility, Bldg. 510M Phone: +1-631-344-4226 |
| Brookhaven National Lab, P.O. Box 5000 Fax: +1-631-344-7616 |
| Upton, NY 11973-5000, U.S.A. |
\------------------------------------------------------------------/
diff -uNr ganglia-monitor-core-2.5.3-dist/gmetad/gmetad.init ganglia-monitor-core-2.5.3/gmetad/gmetad.init
--- ganglia-monitor-core-2.5.3-dist/gmetad/gmetad.init Fri Oct 18 17:57:58 2002
+++ ganglia-monitor-core-2.5.3/gmetad/gmetad.init Thu Aug 28 14:09:27 2003
@@ -10,8 +10,21 @@
RETVAL=0
+# For improved performance, make a tmpfs filesystem to store the rrds into memory:
+# - Add a line like this to your /etc/fstab file:
+# $ echo -e "none\t\t\t/var/lib/ganglia/rrds\ttmpfs\tsize=500M,mode=755,uid=nobody,gid=nobody\t0 0" >>/etc/fstab
+# Comment this out to disable the tmpfs database backup/restore:
+TMPFS=1
+
case "$1" in
start)
+ # Restore the data backup if necessary:
+ if [ "$TMPFS" -a ! -d /var/lib/ganglia/rrds/__SummaryInfo__ -a -r /var/lib/ganglia/rrds-backup.tar ]; then
+ echo -n "Restoring gmetad's rrds database from saved backup...."
+ tar -xPf /var/lib/ganglia/rrds-backup.tar
+ echo "done."
+ fi
+
echo -n "Starting GANGLIA gmetad: "
[ -f $GMETAD ] || exit 1
@@ -27,6 +40,13 @@
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/gmetad
+
+ # Make a backup of gmetad's database directory:
+ if [ "$TMPFS" -a "$RETVAL" -eq "0" -a -d /var/lib/ganglia/rrds/__SummaryInfo__ ]; then
+ echo -n "Saving gmetad's rrds database directory to disk...."
+ tar -cPf /var/lib/ganglia/rrds-backup.tar /var/lib/ganglia/rrds
+ echo "done."
+ fi
;;
restart|reload)
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ganglia-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-general