Simple GlusterFS log rotation

Simple GlusterFS log rotation

Category : How-to

Get Social!

gluster-orange-ant

You’ll be glad to know that GlusterFS has built in log rotation! This means that you can use a simple gluster command to rotate the log for a specific volume. This is very helpful when troubleshooting where it can be easiest to truncate logs before regenerating the issue.

For enduring log rotation I recommend using logrotate which I will cover in a future blog post.

Logs are rotated per volume, so you will need to know the volume name before issuing the command to rotate the log. Use the below command to list all the volumes available on your server:

Use the gluster command, replacing [VOL_NAME] with the volume name of the log file you would like to rotate.

In the below example, the logs for volume datastore will be rotated.

Below is the result on the file system displayed with the ls command.

And that’s it! Your log file will be moved and have a time stamp appended, and a new log will be started for the volume.

See my other post on using logrotate for more advanced log rotation.


Related posts:


2 Comments

Danny

4-Feb-2014 at 7:54 pm

I’m pretty sure that “locate” is supposed to be “rotate” in the commands above. :)

    james.coyle

    6-Feb-2014 at 8:17 pm

    I have updated the type – thanks!

Leave a Reply

Visit our advertisers

Search

Quick Poll

Do you use GlusterFS in your workplace?

Visit our advertisers