2016-07-19 17:56:34 -04:00
# Minio FreeBSD Quickstart Guide [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minio/minio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2016-04-26 13:17:02 -04:00
### Minio with ZFS backend - FreeBSD
This example assumes that you have a FreeBSD 10.x running
2016-07-21 17:58:16 -04:00
#### Step 1.
2016-04-26 13:17:02 -04:00
As root on the FreeBSD edit `/etc/rc.conf`
2016-07-19 22:08:43 -04:00
2016-07-21 17:58:16 -04:00
```sh
2016-04-26 13:17:02 -04:00
zfs_enable="YES"
2016-07-21 17:58:16 -04:00
2016-04-26 13:17:02 -04:00
```
Start ZFS service
2016-07-19 22:08:43 -04:00
2016-07-21 17:58:16 -04:00
```sh
2016-04-26 13:17:02 -04:00
# service zfs start
```
2016-07-21 17:58:16 -04:00
```sh
2016-04-26 13:17:02 -04:00
# dd if=/dev/zero of=/zfs bs=1M count=4000
2016-07-21 17:58:16 -04:00
2016-04-26 13:17:02 -04:00
```
Configure a loopback device on the `/zfs` file.
2016-07-19 22:08:43 -04:00
2016-07-21 17:58:16 -04:00
```sh
2016-04-26 13:17:02 -04:00
# mdconfig -a -t vnode -f /zfs
2016-07-21 17:58:16 -04:00
2016-04-26 13:17:02 -04:00
```
Create zfs pool
2016-07-19 22:08:43 -04:00
2016-07-21 17:58:16 -04:00
```sh
2016-04-26 13:17:02 -04:00
# zpool create minio-example /dev/md0
```
2016-07-21 17:58:16 -04:00
```sh
2016-04-26 13:17:02 -04:00
# df /minio-example
Filesystem 512-blocks Used Avail Capacity Mounted on
minio-example 7872440 38 7872402 0% /minio-example
2016-07-21 17:58:16 -04:00
2016-04-26 13:17:02 -04:00
```
Verify if it is writable
2016-07-19 22:08:43 -04:00
2016-07-21 17:58:16 -04:00
```sh
2016-04-26 13:17:02 -04:00
# touch /minio-example/testfile
# ls -l /minio-example/testfile
-rw-r--r-- 1 root wheel 0 Apr 26 00:51 /minio-example/testfile
2016-07-21 17:58:16 -04:00
2016-04-26 13:17:02 -04:00
```
2016-08-15 05:44:48 -04:00
Now you have successfully created a ZFS pool for further reading please refer to [ZFS Quickstart Guide ](https://www.freebsd.org/doc/handbook/zfs-quickstart.html )
2016-04-26 13:17:02 -04:00
2016-04-29 16:35:20 -04:00
However, this pool is not taking advantage of any ZFS features, so let's create a ZFS filesytem on this pool with compression enabled. ZFS supports many compression algorithms: lzjb, gzip, zle, lz4. LZ4 is often the most performant algorithm in terms of compression of data versus system overhead.
2016-04-26 13:17:02 -04:00
2016-07-21 17:58:16 -04:00
```sh
2016-04-26 13:17:02 -04:00
# zfs create minio-example/compressed-objects
2016-04-29 16:35:20 -04:00
# zfs set compression=lz4 minio-example/compressed-objects
2016-07-21 17:58:16 -04:00
2016-04-26 13:17:02 -04:00
```
To keep monitoring your pool use
2016-07-21 17:58:16 -04:00
```sh
2016-04-26 13:17:02 -04:00
# zpool status
pool: minio-example
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
minio-example ONLINE 0 0 0
md0 ONLINE 0 0 0
errors: No known data errors
2016-07-21 17:58:16 -04:00
2016-04-26 13:17:02 -04:00
```
2016-07-21 17:58:16 -04:00
#### Step 2.
2016-04-26 13:17:02 -04:00
Now start minio server on the ``/minio-example/compressed-objects``, change the permissions such that this directory is accessibly by a normal user
2016-07-21 17:58:16 -04:00
```sh
2016-04-26 13:17:02 -04:00
# chown -R minio-user:minio-user /minio-example/compressed-objects
2016-07-21 17:58:16 -04:00
2016-04-26 13:17:02 -04:00
```
Now login as ``minio-user`` and start minio server.
2016-07-21 17:58:16 -04:00
```sh
2016-04-26 13:17:02 -04:00
$ curl https://dl.minio.io/server/minio/release/freebsd-amd64/minio > minio
$ chmod 755 minio
$ ./minio server /minio-example/compressed-objects
```
Point your browser to http://localhost:9000 and login with the credentials displayed on the command line.
Now you have a S3 compatible server running on top of your ZFS backend which transparently provides disk level compression for your uploaded objects.
Thanks for using Minio, awaiting feedback :-)
2016-07-21 17:58:16 -04:00
2016-04-29 16:35:20 -04:00
#### Building Minio Server From Source
It is possible to build the minio server from source on FreeBSD. To do this we will used the golang distribution provided by the FreeBSD pkg infrastructure.
2016-11-23 05:35:19 -05:00
We will need to install golang and GNU make:
2016-04-29 16:35:20 -04:00
2016-07-21 17:58:16 -04:00
```sh
2016-04-29 16:35:20 -04:00
$ sudo pkg install go gmake
```
2016-11-23 05:35:19 -05:00
Now we can proceed with the normal build process of minio server as found [here ](https://github.com/minio/minio/blob/master/CONTRIBUTING.md ). The only caveat is we need to specify gmake (GNU make) when building minio server as the current Makefile is not BSD make compatible:
2016-04-29 16:35:20 -04:00
From here you can start the server as you would with a precompiled minio server build.