Lotus-Miner配置存储位置

Lotus Miner配置存储位置

如果--no-local-storage矿工初始化期间使用了该标志,则应指定用于密封(建议使用快速SSD)和长期存储的磁盘位置。

If you used the --no-local-storage flag during the miner initialization, you should specify the disk locations for sealing (fast SSD recommended) and long-term storage.

Lotus Miner跟踪in ~/.lotusminer/storage.json(或$LOTUS_MINER_PATH/storage.json)中已定义的存储位置,并使用~/.lotusminerpath作为缺省值。

The Lotus Miner keeps track of defined storage locations in in ~/.lotusminer/storage.json (or $LOTUS_MINER_PATH/storage.json) and uses ~/.lotusminer path as default.

初始化存储位置后,将<path-to-storage>/sectorstorage.json创建一个文件,其中包含分配给该位置的UUID,以及该文件是否可用于密封或存储。

Upon initialization of a storage location, a <path-to-storage>/sectorstorage.json file is created that contains the UUID assigned to this location, along with whether it can be used for sealing or storing.

一.自定义seal位置

所述密封件密封扇区时存储位置被使用。它应该是一种真正快速的存储介质,以使磁盘不会成为延迟密封过程的瓶颈。可以通过以下方式指定:

The seal storage location is used when sealing sectors. It should be a really fast storage medium so that the disk does not become the bottleneck that delays the sealing process. It can be specified with:

1
lotus-miner storage attach --init --seal <PATH_FOR_SEALING_STORAGE>

二.自定义store位置

一旦密封过程完成后,密封扇区被移动到存储位置,该位置可被指定为如下:

Once the sealing process is completed, sealed sectors are moved to the store location, which can be specified as follow:

1
lotus-miner storage attach --init --store <PATH_FOR_LONG_TERM_STORAGE>

该位置可以由大容量的磁盘组成,尽管速度较慢。

This location can be made of large capacity, albeit slower, spinning-disks.

三. 存储路径操作

1. 更改默认存储路径

export LOTUS_MINER_PATH="/path/to/.lotusminer"

  • Miner 默认存储路径是 ~/.lotusminer,可通过指定 LOTUS_MINER_PATH 环境变量来更改;
  • $LOTUS_MINER_PATH 目录下的 storage.json 文件,用来定义Miner挂载的所有存储路径,例如:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "StoragePaths": [
    {
      "Path": "/home/ubuntu/disk_md0/lotusminer"
    },
    {
      "Path": "/home/ubuntu/sectors/storage0"
    },
    {
      "Path": "/home/ubuntu/sectors/storage1"
    }
  ]
}
  • 其中/home/ubuntu/disk_md0/lotusminer为Miner本地Worker的存储路径;

  • /home/ubuntu/sectors/storage0/home/ubuntu/sectors/storage1都是新增的用来存储密封结果的路径。

  • 每个存储路径下都会有 sectorstore.json 配置文件,用来配置该存储路径的用途。

    1
    2
    3
    4
    5
    6
    
    {
      "ID": "83b4fc88-283a-4496-a2f9-cf10781c4ec3", # 唯一标识ID
      "Weight": 10, # 该存储路径权重
      "CanSeal": true, # 是否可以用来存储密封过程中生成的临时文件
      "CanStore": true  # 是否可以用来存储密封好的数据
    }
    

    其中需要注意的3个参数是:

    • Weight: 该存储路径的权重,权重越大的路径会优先存数据
    • CanSeal: 是否可以用来存储密封过程中生成的临时文件;
    • CanStore: 是否可以用来存储密封好的数据,Miner本地Worker的CanStore要设置为false,Seal Worker的CanStore默认就是false;

2. 多个存储路径管理

当Miner挂载多个存储路径时,需要对多个存储路径进行管理时,可以手动对每个存储路径下的sectorstore.json配置文件进行修改权重的配比和存储路径的用途管理。当多个存储路径配置不同的权重时,Miner会根据各个存储路径的权重配比进行存储。若某一存储路径快满时,可以设置该路径下的sectorstore.json"CanSeal": false"CanStore": false,这样Miner就不会往该路径下存储任何数据了。

3.列出存储位置

1
lotus-miner storage list

四.更新位置

要将数据从一个位置移动到另一位置,请遵循Miner生命周期指南中的说明

要完全删除一个位置,请storage.json手动编辑并重新启动矿机。