master
md 53 lines 2.05 KB
Rendered Raw
1 ### Understand the alert
2
3 This alert is related to the InterPlanetary File System (IPFS) distributed file system. It calculates the percentage of used IPFS datastore space. When you receive this alert, it means that your IPFS storage repository space is highly utilized.
4
5 ### What does high datastore usage mean?
6
7 High datastore usage means your IPFS storage is close to its capacity. This can affect the system's performance and stability. It is essential to keep an eye on IPFS storage usage to ensure smooth functioning and avoid running out of storage.
8
9 ### Troubleshoot the alert
10
11 1. Check IPFS datastore usage
12
13 To check the current IPFS datastore storage utilization, use the `ipfs repo stat` command:
14
15 ```
16 ipfs repo stat
17 ```
18
19 2. Identify large files and folders within the datastore
20
21 To find the largest files and folders within your IPFS datastore, use the following command:
22
23 ```
24 ipfs pin ls --type=recursive | xargs -n1 -I {} echo -n "{} " && ipfs object stat {} | head -n1 | awk '{print $2}'
25 ```
26
27 3. Clean up IPFS datastore
28
29 You can clean up and remove files that are no longer needed from your datastore using `ipfs pin rm` and `ipfs repo gc` commands. Be cautious while removing data to avoid losing any essential files.
30
31 For example:
32
33 ```
34 ipfs pin rm <CID>
35 ipfs repo gc
36 ```
37
38 4. Consider increasing the size of your datastore
39
40 If your datastore is continuously getting filled, you might need to increase its capacity to ensure smooth operation. This can be done by adjusting the `Datastore.StorageMax` configuration setting in the `config` file, which is typically located in the `.ipfs` folder.
41
42 ```
43 ipfs config Datastore.StorageMax <new size>
44 ```
45
46 5. Monitor datastore usage over time
47
48 Regularly monitor your IPFS datastore usage using `ipfs repo stat` command to stay informed about its storage utilization and plan for any necessary adjustments.
49
50 ### Useful resources
51
52 1. [IPFS Documentation](https://docs.ipfs.io/)
53 2. [IPFS resize datastore](https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#datastorestoragemax)