Difference between revisions of "Greyhole"
(G) |
|||
Line 58: | Line 58: | ||
'''/var/hda/platform/html/config/greyhole.yml''' | '''/var/hda/platform/html/config/greyhole.yml''' | ||
− | To see what options are available, and what they do, refer to the [http:// | + | To see what options are available, and what they do, refer to the [http://raw.github.com/gboudreau/Greyhole/master/greyhole.example.conf sample greyhole.conf] provided with Greyhole. |
greyhole.yml is in in YAML format. Most of it should be easy enough to modify. The only exception would be the sticky_files (and optional sticky_into) options.<br/> | greyhole.yml is in in YAML format. Most of it should be easy enough to modify. The only exception would be the sticky_files (and optional sticky_into) options.<br/> |
Revision as of 14:07, 12 September 2011
Contents
- 1 What is Greyhole
- 2 Important Warnings
- 3 First things first
- 4 For Storage Pool (Partitions)
- 5 Greyhole options
- 6 Greyhole advanced options
- 7 Copying your data into Greyhole shares the first time
- 8 Adding a new drive to your HDA and storage pool
- 9 Drive Mounted as /media
- 10 Monitoring Greyhole
- 11 Convert Greyhole from SQLite to MySQL
- 12 Disable Greyhole
- 13 Testing and Reliability
- 14 Reconnect the Greyhole storage pool after re-install of Fedora / Amahi
- 15 Greyhole Troubleshooting
- 16 Landing Zone Considerations
- 17 Manually updating Greyhole for Amahi
- 18 Emptying Greyhole Attic
- 19 Reference
What is Greyhole
Greyhole is Amahi's Storage pooling technology. Storage Pooling combines the space of multiple disk drives and makes them look as if they were all part of a single pool of disk space. Specifically, Greyhole:
- Combines the space from multiple drives into a single volume
- Distributes files across all drives in the pool
- Creates multiple copies of files in admin-specified shares
This feature is installed by default, but requires a few simple steps to begin utilizing the features.
You can add additional drives to your hda and prepare them for use in Greyhole by following this tutorial.
To add a drive to your Greyhole storage pool. Open your HDA dashboard and navigate to the Shares tab. Then click on the Storage Pool sub-category. You will see a page similar to the one below.
Important Warnings
You should be safe reading existing files directly, or adding new files directly, as long as don't care that your new files will only be moved into the storage pool during the next check, which runs automatically at midnight (or manually using greyhole --fsck). Until then, your new files will be stored in your shared directories (normally /var/hda/files/share_name/).
Also, touching anything inside the gh directories that Greyhole creates at the root of your partitions is a recipe for disaster.
We strongly discourage you from using the root partition in a drive pool.
First things first
You need to go in the Settings tab, and enable Advanced Settings.
Without Advanced Settings enabled, you won't see the following page and options.
For Storage Pool (Partitions)
Select the drives you want available for your storage pool.
Greyhole options
The next step is to select the share you want to replicate across the pool.
From the Shares tab, select the Shares sub-catagory. We chose the Pictures share for this tutorial.
Check the option for "Uses pool" and choose the number of drives to replicate this share. In this instance we have chosen to use all drives available to the greyhole pool.
Note: Greyhole is not a backup solution. If a file is removed, all copies are removed.
Greyhole advanced options
You can further configure Greyhole by manually editing the following file:
/var/hda/platform/html/config/greyhole.yml
To see what options are available, and what they do, refer to the sample greyhole.conf provided with Greyhole.
greyhole.yml is in in YAML format. Most of it should be easy enough to modify. The only exception would be the sticky_files (and optional sticky_into) options.
Here's an example of how those should appear:
To specify the following to Greyhole in greyhole.conf:
Text |
---|
sticky_files = Music/ sticky_files = Videos/Movies/ stick_into = /mnt/hdd1/gh stick_into = /mnt/hdd5/gh sticky_files = Backups/CrashPlan/ stick_into = /mnt/hdd0/gh
|
one should specify this in the greyhole.yml file, where precise indentation matters:
Text |
---|
sticky_files: - - Music/ - - Videos/Movies/ - - /mnt/hdd1/gh - /mnt/hdd5/gh - - Backups/CrashPlan/ - - /mnt/hdd0/gh
|
For your changes to be effective, you'll need to force Amahi to regenerate the greyhole.conf file. You can do so by editing a share, clicking it's path, and just clicking the Save button without actually changing the path.
When you start using Greyhole, you might want to copy or move all your exiting files into your new shares that use the storage pool.
Note: This is not necessary if your files are already in Amahi shares. If they are there, and you enable the Uses pool option in the Amahi dashboard, the files will start getting moved around into the drives in your storage pool during the night (starting at midnight), when the nightly storage pool check starts.
The instructions below are for users who have more data to copy into the Greyhole shares than their currently free space in the /var/hda/files/ folder.
One way to do that is to mount the shares that use the Greyhole storage pool, either on the HDA itself, or on a client computer on your local network, and copy your data from their existing location into the mounted shares. This can be time consuming, but it is the safest way to use Greyhole.
Another way to move your files from their current location into the storage pool is to share their current location using an Amahi share that Uses pool, then let Greyhole nightly check move the files from there into the pool.
Here's a more detailed walkthrough for this method:
- Setup the Greyhole Storage Pool in the Amahi dashboard, Shares > Storage Pool page.
- Go in the Shares > Shares page. In there, make sure you have an existing share for each share you have data for. Create new ones if you need, remove the ones you don't need.
- Edit the path of each of those shares, and enter the current location of your existing data. For example, the Movies share could have a path = /media/External Drive/Movies
- Enable the Uses pool option for each of your shares, and select the number of extra copies you'd like, if any.
- Now, you either need to wait for Greyhole'S nightly check to start, or you can start it manually from a terminal, as root, using this command: greyhole --fsck
- Monitor /var/log/greyhole.log to see when the fsck operation is done.
- Once fsck is done, your data has now been moved into the Greyhole storage pool (in the drives you selected in Shares > Storage Pool). All that should be left in the previous location of your data (/media/External Drive/Movies from the previous example) should be symbolic links pointing to the new file copies. If the previous location is just empty directories (no symlinks), do not panic. This is normal if your previous location is an NTFS or FAT partition (drive).
- Move all those directories / symlinks from there into the correct folders in /var/hda/files/share_name
- Back in the Amahi dashboard, edit the path of the shares once again, and put back /var/hda/files/share_name (i.e. the folders where you moved the symbolic links).
- If you used an NTFS or FAT partition for the previous location, you'll need another fsck to create the symlinks where they should be. Either wait for midnight, or launch it manually, from a command line, as root: greyhole --fsck
You're done. All your existing data is now stored in the various drives included in your storage pool, and are accessible via the Samba shares you have defined in the Amahi dashboard.
Adding a new drive to your HDA and storage pool
This wiki page discusses how to add a new drive to your HDA and to your greyhole storage pool Adding_a_second_hard_drive_to_your_HDA
Drive Mounted as /media
Including any drive mounted as /media/Something in your storage pool is usually a bad idea.
Those mounts are created by the gnome-automounter, which requires you to be logged in into X (Gnome) to become available.
This will create issues with Greyhole, which expects drives to always be available, and will take action when some of them are missing.
Follow this guide to permanently mount your drives, before you include them in your storage pool.
Monitoring Greyhole
Sometimes you might want to monitor what Greyhole is doing, for example when writing data to your greyhole shares for the first time. Here are a few commands you can type in a terminal to follow along.
Scrolling view of total Greyhole operations queue:
bash code |
---|
while [ 1 == 1 ]; do greyhole --view-queue | grep Total; sleep 60; done
|
Scrolling log of what files Greyhole is working on right now:
bash code |
---|
tail -f /var/log/greyhole.log
|
Convert Greyhole from SQLite to MySQL
Greyhole is already using MySQL in Amahi 6.0
Greyhole was previously using SQLite as the default database for queueing up tasks on Amahi. This was unique to Amahi as Greyhole was originally designed to use MySQL for this task.
There are some major performance benefits to using MySQL over SQLite when writing large amounts of files. Switching can be especially useful when moving data to Greyhole shares for the first time. For now there is a script you can run if you want to switch over. This script has been tested to be safe while Greyhole is working but should be used with discretion.
To Convert to MySQL, run as root:
bash code |
---|
/usr/share/greyhole/db_migration-sqlite2mysql.sh
|
To see what DB engine is Greyhole using, do this:
bash code |
---|
grep db_engine /etc/greyhole.conf
|
Disable Greyhole
For those who do not use Greyhole, you can disable it. This is based on the fact you never have used it by enabling 'Uses pool' on any share. Recommend using extreme caution as this could have unpredictable results.
Perform the following steps as user root:
bash code |
---|
chkconfig greyhole off rm /etc/monit.d/greyhole.conf service monit restart service greyhole stop
|
DO NOT attempt to remove the Greyhole package as it is a dependency of the HDA software. Doing so will break your HDA.
Testing and Reliability
Check out the Greyhole grinder to help make Greyhole rock solid.
Reconnect the Greyhole storage pool after re-install of Fedora / Amahi
- Disconnect all data drives before you reinstall. This will prevent you from destroying them by mistake during the Fedora/Amahi install!
- Install Amahi per the regular instructions.
- Connect the data drives, and use hda-diskmount to remount all of them.
Note that if you can, it would be faster if you can re-mount the drives in the same paths they used to have.
Example: If you have one 1TB and one 2TB, and the 1TB was mounted as /var/hda/files/drives/drive1, and the 2TB was mounted as /var/hda/files/drives/drive2, it would be better to re-mount that like that on your new HDA. If you mount them otherwise, it will still work, but Greyhole will work a while to re-build the links in your share before they can be usable.
- Select the drives in the Amahi Dashboard: Setup > Shares > Storage Pool
- Re-create your shares in the Amahi Dashboard: Setup > Shares.
Make sure to select 'Use Pool', and select the correct number of extra copies. If you don't remember all the shares you had, just check inside the 'gh' folder found at the root of your drives to get a reminder!
Example:
bash code |
---|
ls -1 /var/hda/files/drives/*/gh/ | grep -v : | sort -u
|
- Launch a fsck to have Greyhole rebuild your shares.
bash code |
---|
greyhole --fsck
|
Until this completes, some of your files will be missing from your shares.
Greyhole Troubleshooting
Page: Greyhole troubleshooting
Landing Zone Considerations
The landing zone or LZ is the area where files arrive first before being distributed to their final destination. See details in the Greyhole landing zone page.
Manually updating Greyhole for Amahi
Page: Greyhole updating
Emptying Greyhole Attic
bash code |
---|
greyhole --empty-attic
|
About the attic: The attic is used like a Recycle Bin, or Trash. That means you'll need to manually empty it once in a while. To do so, use the --empty-attic parameter (see above). Another option is to create a 'Greyhole Attic' Samba share. More details about that here: https://github.com/gboudreau/Greyhole/wiki/AboutTrash
Reference
Good article on Greyhole with terms explained.