1 min read

FreeBSD安装MinIO

环境

OS: FreeBSD-14.1-amd64

安装记录

安装MinIO

# pkg install minio

创建数据目录

# mkdir /data/minio
# chown minio:minio /data/minio
# chmod 0700 /mdata/minio

证书生成【可选】

# vim /usr/local/etc/ssl/openssl.conf
basicConstraints = CA:FALSE
nsCertType = server
nsComment = "OpenSSL Generated Server Certificate"
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
IP.1 = 10.10.10.10
IP.2 = 10.10.10.11



# openssl genrsa -out private.key 4096
...
# openssl req -new -key private.key -out public.csr
...
# openssl x509 -req -in public.csr -CA CAs/rootca.crt -CAkey CAs/rootca.key -CAcreateserial -out public.crt  -days 3650 -sha256 -extfile openssl.conf

配置MinIO参数,编辑/etc/rc.conf文件,追加以下内容:

  • 单节点
minio_disks="/data/minio"
#minio_certs="/usr/local/etc/ssl"
minio_env="MINIO_ACCESS_KEY=myaccesskey MINIO_SECRET_KEY=mysecretkey"
  • 分布式
minio_disks="http://10.10.10.10:9000/mnt/minio-data1 http://10.10.10.10:9000/mnt/minio-data2 http://10.10.10.11:9000/mnt/minio-data1 http://10.10.10.11:9000/mnt/minio-data2"
#minio_certs="/usr/local/etc/ssl"
minio_env="MINIO_ACCESS_KEY=myaccesskey MINIO_SECRET_KEY=mysecretkey"

启动服务并配置开机自启动

# service minio start
或
# /usr/local/etc/rc.d/minio start
# sysrc minio_enable=yes