MinIO 是一款基于 Go 语言的高性能对象存储服务。
MinIO 采用了 Apache License v2.0 开源协议,兼容亚马逊 S3 云存储服务接口,非常适合于存储大容量非结构化的数据,例如图片、视频、日志文件、备份数据和容器/虚拟机镜像等,而一个对象文件可以是任意大小,从几 kb 到最大 5T 不等。
MinIO 使用纠删码 erasure code 和校验和 checksum 来保护数据免受硬件故障和数据损坏。即便您丢失一半数量(N/2)的硬盘,仍然可以恢复数据。
准备磁盘
[root@minio1 ~]# mkfs.xfs /dev/sdb -L DISK1
meta-data=/dev/sdb isize=512 agcount=4, agsize=655360 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=2621440, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
下载minio安装包:
[root@minio ~]# wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio-20231120224007.0.0.x86_64.rpm -O minio.rpm
--2023-11-22 23:31:46-- https://dl.min.io/server/minio/release/linux-amd64/archive/minio-20231120224007.0.0.x86_64.rpm
Resolving dl.min.io (dl.min.io)... 138.68.11.125, 178.128.69.202
Connecting to dl.min.io (dl.min.io)|138.68.11.125|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 35994002 (34M) [application/x-rpm]
Saving to: ‘minio.rpm’
100%[====================================================================================>] 35,994,002 5.34MB/s in 10s
2023-11-22 23:31:58 (3.29 MB/s) - ‘minio.rpm’ saved [35994002/35994002]
[root@minio ~]# ls
anaconda-ks.cfg minio.rpm
使用yum安装
[root@minio ~]# yum install minio.rpm
Loaded plugins: fastestmirror
Examining minio.rpm: minio-20231120224007.0.0-1.x86_64
Marking minio.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package minio.x86_64 0:20231120224007.0.0-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================
Installing:
minio x86_64 20231120224007.0.0-1 /minio 92 M
Transaction Summary
==============================================================================================================================
Install 1 Package
Total size: 92 M
Installed size: 92 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Verifying : minio-20231120224007.0.0-1.x86_64 1/1
Installed:
minio.x86_64 0:20231120224007.0.0-1
Complete!
将磁盘挂载到 /mnt/disk1
[root@minio ~]# cd /mnt/
[root@minio mnt]# ls
[root@minio mnt]#
[root@minio mnt]# mkdir disk1
[root@minio mnt]#
[root@minio mnt]# mount /dev/mapper/vg_data-lv_data /mnt/disk1/
mount: /dev/mapper/vg_data-lv_data is already mounted or /mnt/disk1 busy
/dev/mapper/vg_data-lv_data is already mounted on /mnt/disk1
[root@minio mnt]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 14G 1.4G 13G 10% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.8M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sda1 1014M 142M 873M 14% /boot
tmpfs 380M 0 380M 0% /run/user/0
/dev/mapper/vg_data-lv_data 99G 33M 99G 1% /mnt/disk1
配置自动挂载
[root@minio default]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Thu Jul 30 21:32:18 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root / xfs defaults 0 0
UUID=efd96cea-98cc-4649-be5c-6c91f03dd845 /boot xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
/dev/mapper/vg_data-lv_data /mnt/disk1 xfs defaults 0 0
创建用户并授权
[root@minio mnt]# groupadd -r minio-user
[root@minio mnt]# useradd -M -r -g minio-user minio-user
[root@minio mnt]# chown minio-user:minio-user /mnt/disk1
[root@minio mnt]#
创建配置文件 /etc/default/minio
[root@minio default]# cat /etc/default/minio
# MINIO_ROOT_USER and MINIO_ROOT_PASSWORD sets the root account for the MinIO server.
# This user has unrestricted permissions to perform S3 and administrative API operations on any resource in the deployment.
# Omit to use the default values 'minioadmin:minioadmin'.
# MinIO recommends setting non-default values as a best practice, regardless of environment
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=Zzbrkm2409@
# MINIO_VOLUMES sets the storage volume or path to use for the MinIO server.
MINIO_VOLUMES="/mnt/disk1"
# MINIO_SERVER_URL sets the hostname of the local machine for use with the MinIO Server
# MinIO assumes your network control plane can correctly resolve this hostname to the local machine
# Uncomment the following line and replace the value with the correct hostname for the local machine and port for the MinIO server (9000 by default).
#MINIO_SERVER_URL="http://minio.example.net:9000"
启动服务,并开机启动
[root@minio default]# systemctl start minio
[root@minio default]# systemctl status minio
● minio.service - MinIO
Loaded: loaded (/usr/lib/systemd/system/minio.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2023-11-22 23:39:09 EST; 7s ago
Docs: https://docs.min.io
Process: 9424 ExecStartPre=/bin/bash -c if [ -z "${MINIO_VOLUMES}" ]; then echo "Variable MINIO_VOLUMES not set in /etc/default/minio"; exit 1; fi (code=exited, status=0/SUCCESS)
Main PID: 9427 (minio)
CGroup: /system.slice/minio.service
└─9427 /usr/local/bin/minio server /mnt/disk1
Nov 22 23:39:09 minio systemd[1]: Started MinIO.
Nov 22 23:39:09 minio minio[9427]: MinIO Object Storage Server
Nov 22 23:39:09 minio minio[9427]: Copyright: 2015-2023 MinIO, Inc.
Nov 22 23:39:09 minio minio[9427]: License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
Nov 22 23:39:09 minio minio[9427]: Version: RELEASE.2023-11-20T22-40-07Z (go1.21.4 linux/amd64)
Nov 22 23:39:09 minio minio[9427]: Status: 1 Online, 0 Offline.
Nov 22 23:39:09 minio minio[9427]: S3-API: http://192.168.3.110:9000 http://127.0.0.1:9000
Nov 22 23:39:09 minio minio[9427]: Console: http://192.168.3.110:41817 http://127.0.0.1:41817
Nov 22 23:39:09 minio minio[9427]: Documentation: https://min.io/docs/minio/linux/index.html
Nov 22 23:39:09 minio minio[9427]: Warning: The standard parity is set to 0. This can lead to data loss.
[root@minio default]# systemctl enable minio.service
Created symlink from /etc/systemd/system/multi-user.target.wants/minio.service to /usr/lib/systemd/system/minio.service.
开启防火墙策略
[root@minio default]# firewall-cmd --permanent --zone=public --add-port=9000/tcp
success
[root@minio default]# firewall-cmd --reload
success
[root@minio default]# firewall-cmd --permanent --zone=public --add-port=41817/tcp
success
[root@minio default]# firewall-cmd --reload
success
访问测试
标签:minio,default,mnt,dev,驱动器,root,节点,MinIO From: https://blog.51cto.com/chenxuewen/8586575