![Samuel Merritt](/assets/img/avatar_default.png)
Instead of recommending to edit resetswift to replace "/dev/sdb1" with "/srv/swift-disk", use an environment variable instead. This way I can set SAIO_BLOCK_DEVICE=/srv/swift-disk in my .bashrc, and then when I'm testing out changes to resetswift, I don't need to remember to edit the modified script, nor do I end up submitting changes with the wrong default in there. The variable defaults to /dev/sdb1, so if you use the script unmodified and don't set SAIO_BLOCK_DEVICE, nothing changes for you. Change-Id: I741a8c91c2c54a4f32bc391cd794ef4206402753
18 lines
762 B
Bash
Executable File
18 lines
762 B
Bash
Executable File
#!/bin/bash
|
|
|
|
swift-init all stop
|
|
# Remove the following line if you did not set up rsyslog for individual logging:
|
|
sudo find /var/log/swift -type f -exec rm -f {} \;
|
|
sudo umount /mnt/sdb1
|
|
# If you are using a loopback device set SAIO_BLOCK_DEVICE to "/srv/swift-disk"
|
|
sudo mkfs.xfs -f ${SAIO_BLOCK_DEVICE:-/dev/sdb1}
|
|
sudo mount /mnt/sdb1
|
|
sudo mkdir /mnt/sdb1/1 /mnt/sdb1/2 /mnt/sdb1/3 /mnt/sdb1/4
|
|
sudo chown ${USER}:${USER} /mnt/sdb1/*
|
|
mkdir -p /srv/1/node/sdb1 /srv/2/node/sdb2 /srv/3/node/sdb3 /srv/4/node/sdb4
|
|
sudo rm -f /var/log/debug /var/log/messages /var/log/rsyncd.log /var/log/syslog
|
|
find /var/cache/swift* -type f -name *.recon -exec rm -f {} \;
|
|
# On Fedora use "systemctl restart <service>"
|
|
sudo service rsyslog restart
|
|
sudo service memcached restart
|