From Fedora Project Wiki

No edit summary
No edit summary
Line 44: Line 44:
After a short time ( < 1 minute), the corrupted file should have been moved by the auditor.  
After a short time ( < 1 minute), the corrupted file should have been moved by the auditor.  
And a fresh version should have been replaced by the replicater
And a fresh version should have been replaced by the replicater
  $> find /srv/node/ -type f -name "1347830459.42610.data" -exec md5sum {} \;
  $> sudo find /srv/node/ -type f -name "1347830459.42610.data" -exec md5sum {} \;
  3482e30580475b04a1b552d41c559582  /srv/node/device1/quarantined/objects/b9a470cf10b569cf56acb7e71dab3d81/1347830459.42610.data
  3482e30580475b04a1b552d41c559582  /srv/node/device1/quarantined/objects/b9a470cf10b569cf56acb7e71dab3d81/1347830459.42610.data
  ba1610dfb5b7fac8d6dd4a348761b5ee  /srv/node/device1/objects/2970/d81/b9a470cf10b569cf56acb7e71dab3d81/1347830459.42610.data
  ba1610dfb5b7fac8d6dd4a348761b5ee  /srv/node/device1/objects/2970/d81/b9a470cf10b569cf56acb7e71dab3d81/1347830459.42610.data

Revision as of 11:31, 25 September 2012

Description

Testing the swift auditor and replicator. The swift auditor is responsible for checking files for bit rot, when it finds a file whose hash does not match what it should it moves it into the quarantine for a replicator to replace

Setup

We first need to configure and enable rsync

$> sudo yum install -y xinetd rsync
$> sudo sed -i -e 's/disable.*/disable = no/g' /etc/xinetd.d/rsync

Create the file /etc/rsyncd.conf with the following contents

$> sudo tee /etc/rsyncd.conf <<EOF
uid = swift
gid = swift
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
address = 127.0.0.1
[account]
max connections = 2
path = /srv/node/
read only = false
lock file = /var/run/account.lock
[container]
max connections = 2
path = /srv/node/
read only = false
lock file = /var/run/container.lock
[object]
max connections = 2
path = /srv/node/
read only = false
lock file = /var/run/object.lock
EOF

Start xinetd

$> sudo service xinetd restart
$> sudo chkconfig xinetd on 

How to test

Select one of the data files on the a storage device and currupt its contents

$> ls / | sudo tee /srv/node/device1/objects/2970/d81/b9a470cf10b569cf56acb7e71dab3d81/1347830459.42610.data

Expected Results

After a short time ( < 1 minute), the corrupted file should have been moved by the auditor. And a fresh version should have been replaced by the replicater

$> sudo find /srv/node/ -type f -name "1347830459.42610.data" -exec md5sum {} \;
3482e30580475b04a1b552d41c559582  /srv/node/device1/quarantined/objects/b9a470cf10b569cf56acb7e71dab3d81/1347830459.42610.data
ba1610dfb5b7fac8d6dd4a348761b5ee  /srv/node/device1/objects/2970/d81/b9a470cf10b569cf56acb7e71dab3d81/1347830459.42610.data
ba1610dfb5b7fac8d6dd4a348761b5ee  /srv/node/device2/objects/2970/d81/b9a470cf10b569cf56acb7e71dab3d81/1347830459.42610.data
ba1610dfb5b7fac8d6dd4a348761b5ee  /srv/node/device3/objects/2970/d81/b9a470cf10b569cf56acb7e71dab3d81/1347830459.42610.data