github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/fs/health/fshc.md (about)

     1  Filesystem Health Checker (FSHC)
     2  ---------------------------------
     3  
     4  ## Overview
     5  
     6  FSHC monitors and manages filesystems used by AIStore. Every time AIStore triggers an IO error, FSHC checks health of the corresponding filesystem. Checking includes testing the filesystem availability, reading existing data, and creating temporary files. A filesystem that does not pass the test is automatically disabled and excluded from all next AIStore operations. Once a disabled filesystem is repaired, it can be marked as available for AIStore again.
     7  
     8  ### How FSHC detects a faulty filesystem
     9  
    10  When an error is triggered, FSHC receives the error and a filename. If the error is not an IO error or it is not severe one(e.g, file not found error does not mean trouble) no extra tests are performed. If the error needs attention, FSHC tries to find out to which filesystem the filename belongs. In case of the filesystem is already disabled, or it is being tested at that moment, or filename is outside of any filesystem utilized by AIStore, FSHC returns immediately. Otherwise, FSHC starts the filesystem check.
    11  
    12  Filesystem check includes the following tests: availability, reading existing files, and writing to temporary files. Unavailable or readonly filesystem is disabled immediately without extra tests. For other filesystems FSHC selects a few random files to read, then creates a few temporary files filled with random data. The final decision about filesystem health is based on the number of errors of each operation and their severity.
    13  
    14  ## Getting started
    15  
    16  Check FSHC configuration before deploying a cluster. All settings are in the section `fschecker` of [AIStore configuration file](/deploy/dev/local/aisnode_config.sh)
    17  
    18  | Name | Default value | Description |
    19  |---|---|---|
    20  | fschecker_enabled | true | Enables or disables launching FHSC at startup. If FSHC is disabled it does not test any filesystem even a read/write error triggered |
    21  | fschecker_test_files | 4 | The maximum number of existing files to read and temporary files to create when running a filesystem test |
    22  | fschecker_error_limit | 2 | If the number of triggered IO errors for reading or writing test is greater or equal this limit the filesystem is disabled. The number of read and write errors are not summed up, so if the test triggered 1 read error and 1 write error the filesystem is considered unstable but it is not disabled |
    23  
    24  When AIStore is running, FSHC can be disabled and enabled on a given target via REST API.
    25  
    26  Disable FSHC on a given target:
    27  
    28  ```console
    29  $ curl -i -X PUT -H 'Content-Type: application/json' \
    30  	-d '{"action": "set-config","name": "fschecker_enabled", "value": "false"}' \
    31  	http://localhost:8084/v1/daemon
    32  ```
    33  
    34  Enable FSHC on a given target:
    35  
    36  ```console
    37  $ curl -i -X PUT -H 'Content-Type: application/json' \
    38  	-d '{"action": "set-config","name": "fschecker_enabled", "value": "true"}' \
    39  	http://localhost:8084/v1/daemon
    40  ```