Alexey
September 2, 2020, 7:33pm
26
This feature is available starting 1.11.1
Periodic Filesystem Check
On startup, the storage node will write a file and once per minute, it will try to read this file. If the hard drive gets disconnected from the storage node this check will fail and the storage node will error out instead of getting disqualified for failing audits.
Before this version only custom checks are worked:
Beat me to it!
In any case… I’ll post what I was writing anyway…
A bash script to check if a file exists on GNU/Linux systems with bash installed:
#!/bin/bash
if [ ! -f is_connected ]; then
echo -e "WARNING! Storage is disconnected.\nShutting down Node...\n"
# iptables -I INPUT -p tcp --dport 28967 -j REJECT
docker stop -t 300 storagenode &&
exit 0
fi
echo -e "Storage is connected.\n"
#if [[ $(iptables -C INPUT -p tcp --dport 28967 -j REJECT) ]]; then
# iptables -D INPUT -p tcp…
For logs written to a file
tail -f /volume1/storj/v3/data/node.log | awk '/(ERROR|canceled|failed).*GET_AUDIT/ {system ("docker stop -t 300 storagenode")}'
For logs in docker
docker logs -f --tail 20 storagenode | awk '/(ERROR|canceled|failed).*GET_AUDIT/ {system ("docker stop -t 300 storagenode")}'
Please be aware I haven’t tested the docker version. But it should work.
This stops your node if it encounters a single audit failure, that might be overly aggressive as it would also kill your …
@Hacker you can use the below powershell script to monitor for when the usb disconnects. When it detects a usb disconnection event, it will shutdown the storagenode. All you have to do is change the $driveLetter -eq ‘D:’ with the Letter of your usb drive.
I know it is not a solution but it helps prevent those audit errors. If you combine this with uptimerobot monitoring you should get notified since the storagenode goes offline.
Register-WmiEvent -Class win32_VolumeChangeEvent -SourceIdentifi…
For the storagenode there was no difference between lost pieces or disconnected mountpoint, in both cases the OS returns the same error “file not found”.