storj.io/minio@v0.0.0-20230509071714-0cbc90f649b1/docs/zh_CN/FreeBSD.md (about)

     1  # MinIO FreeBSD 快速入门 [![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io)
     2  
     3  ### MinIO with ZFS backend - FreeBSD
     4  此示例假设你已经有正在运行的FreeBSD 11.x。
     5  
     6  #### 启动 ZFS service
     7  ```sh
     8  sysrc zfs_enable="YES"
     9  ```
    10  
    11  启动 ZFS service
    12  ```sh
    13  service zfs start
    14  ```
    15  
    16  在 `/zfs` 文件上配置一个回环设备`loopback device `。
    17  ```sh
    18  dd if=/dev/zero of=/zfs bs=1M count=4000
    19  mdconfig -a -t vnode -f /zfs
    20  ```
    21  
    22  创建zfs池
    23  ```sh
    24  zpool create minio-example /dev/md0
    25  ```
    26  
    27  ```sh
    28  df /minio-example
    29  Filesystem    512-blocks Used   Avail Capacity  Mounted on
    30  minio-example    7872440   38 7872402     0%    /minio-example
    31  ```
    32  
    33  验证其是否可写
    34  ```sh
    35  touch /minio-example/testfile
    36  ls -l /minio-example/testfile
    37  -rw-r--r--  1 root  wheel  0 Apr 26 00:51 /minio-example/testfile
    38  ```
    39  
    40  现在您已经成功创建了一个ZFS池,了解更多,请参考 [ZFS 快速入门](https://www.freebsd.org/doc/handbook/zfs-quickstart.html)
    41  
    42  不过,这个池并没有利用ZFS的任何特性。我们可以在这个池上创建一个带有压缩功能的ZFS文件系统,ZFS支持多种压缩算法: [`lzjb`, `gzip`, `zle`, `lz4`]。`lz4` 在数据压缩和系统开销方面通常是最最优的算法。
    43  ```sh
    44  zfs create minio-example/compressed-objects
    45  zfs set compression=lz4 minio-example/compressed-objects
    46  ```
    47  
    48  监控池是否健康
    49  ```sh
    50  zpool status -x
    51  all pools are healthy
    52  ```
    53  
    54  #### 启动MinIO服务
    55  从FreeBSD port安装 [MinIO](https://min.io)。
    56  ```sh
    57  pkg install minio
    58  ```
    59  
    60  配置MinIO,让其使用挂载在`/minio-example/compressed-objects`的ZFS卷。
    61  ```
    62  sysrc minio_enable=yes
    63  sysrc minio_disks=/minio-example/compressed-objects
    64  ```
    65  
    66  启动Mino。
    67  ```
    68  service minio start
    69  ```
    70  
    71  现在你已经成功的让MinIO运行在ZFS上,你上传的对象都获得了磁盘级别的压缩功能,访问 http://localhost:9000。
    72  
    73  #### 关闭MinIO服务
    74  ```sh
    75  service minio stop
    76  ```