Introduction
In the world of data storage and management, object storage has gained significant traction due to its scalability, flexibility, and cost-effectiveness. MinIO, an open-source object storage server, has emerged as a popular choice for organizations seeking to harness the power of object storage. In this guide, we will walk you through the step-by-step process of installing MinIO Object Storage Server on a Rocky Linux distribution, enabling you to unlock the potential of distributed object storage.
Table of Contents
Key Features
Key features of MinIO storage include:
- Scalability: MinIO can scale to accommodate large amounts of data, making it suitable for both small-scale deployments and large enterprise solutions.
- High Performance: MinIO is designed to deliver high throughput and low latency, optimized for data-intensive workloads.
- Elasticity: It can be easily deployed in a distributed mode, allowing for seamless expansion as the storage needs grow.
- Erasure Coding: MinIO supports erasure coding, a data protection technique that allows for data redundancy and fault tolerance without the need for traditional replication.
- Data Security: MinIO offers various security features, including encryption at rest and in transit, to ensure the confidentiality and integrity of stored data.
- S3 Compatibility: MinIO is API-compatible with Amazon S3, meaning applications and tools built to work with S3 can be easily adapted to use MinIO.
- Self-Healing: MinIO can automatically detect and recover from hardware failures, ensuring data availability.
- Lifecycle Management: It supports data lifecycle policies, allowing users to define rules for automatic data migration or deletion based on specified criteria.
- Integration with Kubernetes: MinIO can be deployed as a stateful set in Kubernetes, facilitating cloud-native storage setups.
Prerequisites
Before we dive into the installation process, ensure that you have:
- A server running Rocky Linux with root access or sudo privileges. To set this up, follow our guide : Initial Setup Ubuntu Server 22.04: Secure and Efficient
- A non-root user with sudo/root privileges.
- An additional disk or directory will be used as object storage.
- For production, you will need a domain name pointed to the Rocky Linux server IP address.
Install MinIO on Rocky Linux
As shown above, follow these detailed steps to Install MinIO on Rocky Linux server and streamline your object storage management processes:
Step 1: System Update
It’s essential to begin by updating your system’s package repositories to ensure you’re working with the latest software versions. Open the terminal and execute the following command:
[samm@php82 ~]$ sudo dnf upgrade --refresh
Extra Packages for Enterprise Linux 9 - x86_64 9.5 kB/s | 6.5 kB 00:00
Extra Packages for Enterprise Linux 9 - x86_64 4.5 MB/s | 18 MB 00:04
Rocky Linux 9 - BaseOS 2.1 kB/s | 4.1 kB 00:01
Rocky Linux 9 - AppStream 3.3 kB/s | 4.5 kB 00:01
Rocky Linux 9 - Extras 1.8 kB/s | 2.9 kB 00:01
Dependencies resolved.
Nothing to do.
Complete!
Step 2: Download MinIO Binary
MinIO offers standalone binaries, which significantly streamline the installation process. To begin, head over to the MinIO download page and locate the link relevant to your specific Rocky Linux version. Once identified, utilize the wget command to retrieve the MinIO binary:
[samm@minio ~]$ sudo curl -o /usr/local/bin/minio https://dl.min.io/server/minio/release/linux-amd64/minio
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 95.1M 100 95.1M 0 0 4562k 0 0:00:21 0:00:21 --:--:-- 3013k
After downloading the binary, use the following command to grant execution permissions to the MinIO binary:
[samm@minio ~]$ sudo chmod +x /usr/local/bin/minio
In order to enable the execution of the MinIO binary file, it’s necessary to include the ‘/usr/local/bin’ directory within the $PATH environment variable.
[samm@minio ~]$ echo 'export PATH="$PATH:/usr/local/bin"' >> ~/.bashrc
reload the ‘~/.bashrc‘ configuration file and verify the $PATH environment variable
[samm@minio ~]$ source ~/.bashrc
[samm@minio ~]$ echo $PATH
/home/samm/.local/bin:/home/samm/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/local/bin
Once done, verify to ensure that the ‘minio’ command is available
[samm@minio ~]$ which minio
/usr/local/bin/minio
Confirm the presently installed version of MinIO on your system.
[samm@minio ~]$ minio --version
minio version RELEASE.2023-07-18T17-49-40Z (commit-id=0120ff93bc4b9cfaf2865e55850e9b20e5ef703d)
Runtime: go1.19.11 linux/amd64
License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>
Copyright: 2015-2023 MinIO, Inc.
Step 3: Setting up Storage for MinIO Object Storage using LVM
LVM, short for Logical Volume Manager, serves as a storage device manager and provides exceedingly sophisticated management choices. It finds application across diverse domains, such as virtualization platforms, enterprises, and extensive storage setups.
When configuring MinIO object storage, you must establish a designated directory or utilize an extra disk specifically earmarked for object storage purposes. In this illustration, the process of designating the ‘/dev/sdb
‘ disk as the MinIO object storage repository will be elucidated.
Check the Disks or Partititons
First, run the following command to check the list of available disk/ partititons.
[samm@minio ~]$ sudo lsblk -e7
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 49G 0 part
├─rl-root 253:0 0 45G 0 lvm /
└─rl-swap 253:1 0 4G 0 lvm [SWAP]
sdb 8:16 0 20G 0 disk
sr0 11:0 1 8.8G 0 rom
[samm@minio ~]$ sudo fdisk -l
Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xcff9283d
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 104857599 102758400 49G 8e Linux LVM
Disk /dev/mapper/rl-root: 45.04 GiB, 48364519424 bytes, 94461952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/rl-swap: 3.95 GiB, 4244635648 bytes, 8290304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Format the Disk (sdb)
Next, format HDD “sdb” to use for MinIO object storage.
[samm@minio ~]$ sudo fdisk /dev/sdb
Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x28de590f.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-41943039, default 2048): 2048
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-41943039, default 41943039): 41943039
Created a new partition 1 of type 'Linux' and of size 20 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
Check again partititon with the following command:
[samm@minio ~]$ sudo lsblk -e7
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 49G 0 part
├─rl-root 253:0 0 45G 0 lvm /
└─rl-swap 253:1 0 4G 0 lvm [SWAP]
sdb 8:16 0 20G 0 disk
└─sdb1 8:17 0 20G 0 part
sr0 11:0 1 8.8G 0 rom
Create LV Structure
Now initialize the available physical volumes that you want to use with LVM.
[samm@minio ~]$ sudo pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
[samm@minio ~]$ sudo lvmdiskscan -l
WARNING: only considering LVM devices
/dev/sda2 [ <49.00 GiB] LVM physical volume
/dev/sdb1 [ <20.00 GiB] LVM physical volume
0 LVM physical volume whole disks
2 LVM physical volumes
Create a Volume Group
In the earlier command, ‘/dev/sdb’ represents the device identifier for the physical volume. You can modify this as needed. Subsequently, generate a volume group by indicating the volume group’s name along with the associated physical volume in the subsequent command.
[samm@minio ~]$ sudo vgcreate storage /dev/sdb1
Volume group "storage" successfully created
[samm@minio ~]$ sudo vgdisplay storage
--- Volume group ---
VG Name storage
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size <20.00 GiB
PE Size 4.00 MiB
Total PE 5119
Alloc PE / Size 0 / 0
Free PE / Size 5119 / <20.00 GiB
VG UUID 4qrBA8-b7Ei-TqGt-FdmP-eufW-0pY1-8YkqGS
Create a Logical Volume
With the previous steps successfully completed, the next undertaking involves the creation of a logical volume within the designated volume group. The ‘lvcreate’ command accomplishes this task.
[samm@minio ~]$ sudo lvcreate -l 100%FREE -n data storage
Logical volume "data" created.
[samm@minio ~]$ sudo lvdisplay
--- Logical volume ---
LV Path /dev/storage/data
LV Name data
VG Name storage
LV UUID gUMzWL-iftB-iHfj-aHjG-8bUE-ajhQ-nIhQhh
LV Write Access read/write
LV Creation host, time minio, 2023-07-25 11:37:16 -0400
LV Status available
# open 0
LV Size <20.00 GiB
Current LE 5119
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
Create a Filesystem on Logical Volume
Now, format the logical volume through the following command:
[samm@minio ~]$ sudo mkfs.xfs /dev/storage/data
meta-data=/dev/storage/data isize=512 agcount=4, agsize=1310464 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1 bigtime=1 inobtcount=1
data = bsize=4096 blocks=5241856, 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
Discarding blocks...Done.
Check again partititons with the following command:
[samm@minio ~]$ sudo lsblk -e7
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 49G 0 part
├─rl-root 253:0 0 45G 0 lvm /
└─rl-swap 253:1 0 4G 0 lvm [SWAP]
sdb 8:16 0 20G 0 disk
└─sdb1 8:17 0 20G 0 part
└─storage-data 253:2 0 20G 0 lvm
sr0 11:0 1 8.8G 0 rom
Now we have “/dev/storage/data”. Next create a new directory ‘/data’ that will be used as the mount point for the partition ‘/dev/storage/data’.
[samm@minio ~]$ sudo mkdir -p /data
Mount the Logical Volume
Next, mount the partition ‘/dev/storage/data’ to the target directory ‘/data’.
[samm@minio ~]$ sudo mount /dev/mapper/storage-data /data
This action will provisionally mount the ‘/dev/storage/data’ partition, with the configuration reverting after a system restart. To ensure enduring persistence, the system mounts the partition through the ‘/etc/fstab’ file, which guarantees automatic partition mounting during system boot.
[samm@minio ~]$ sudo vi /etc/fstab
/dev/mapper/storage-data /data xfs defaults 0 0
Then save the file and exit.
Execute the subsequent command to mount the accessible partitions in the ‘/etc/fstab’ file. Verify the absence of error messages, indicating successful mounting of partitions to their respective target directories.
[samm@minio ~]$ sudo mount -a
Now, run the following command to verify the configuration of your partition.
[samm@minio ~]$ df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs tmpfs 1.8G 0 1.8G 0% /dev/shm
tmpfs tmpfs 733M 21M 713M 3% /run
/dev/mapper/rl-root xfs 46G 3.8G 42G 9% /
/dev/sda1 xfs 1014M 268M 747M 27% /boot
tmpfs tmpfs 367M 0 367M 0% /run/user/1101
/dev/mapper/storage-data xfs 20G 175M 20G 1% /data
With the partition now configured for object storage, the subsequent step involves initiating the configuration process for MinIO installation.
Step 4: Configuring MinIO Object Storage
In this phase, we will set up a new configuration for MinIO, which will result in creating a fresh configuration file specifically for running the MinIO service. The MinIO configuration file is expected to reside within ‘/etc/minio
‘, while the configuration required for operating the MinIO service is anticipated to be situated at ‘/etc/default/minio
‘.
Continued in part 2, next in “How To Install a MinIO Object Storage Server on Rocky Linux (Part 2)“
Also Read Our Other Guides :
- How To Install Nginx on Rocky Linux 9: A Comprehensive Guide
- How To Install PHP 8.2 on Rocky Linux 9
- How To Install Python 3.11 on Rocky Linux 9
- How To Secure Nginx with Let’s Encrypt on Rocky Linux 9
- How To Install and Configure Ansible on Rocky Linux 9
- How To Install and Configure Elasticsearch on Ubuntu Server 22.04
Hopefully, now you have learned how to Install a MinIO Object Storage Server on Rocky Linux Part 1.