Object storage is a computer data storage that manages data as objects, as opposed to other storage architectures like file systems which manages data as a file hierarchy, and block storage which manages data as blocks within sectors and tracks.
Object storage is used for housing videos and photos, music, and files for online collaboration. In object storage, data is sectioned off into units (aka “objects”) where it is stored in a flat environment. Each object includes:
- Data
- Metadata
- Unique identifier
All data blocks for a file are contained together as an object and are stored in what is called a storage pool. To access data, the storage system uses a unique identifier and metadata to find the object. Data can be accessed using RESTful APIs, HTTP, and HTTPS.
Object storage is crucial to the functioning of cloud services and applications. And because of the way object storage works, you can scale very quickly, up to petabytes and exabytes (so long as the machine in question has the space).
MinIO is a high performance object storage solution that provides an Amazon Web Services S3-compatible API and supports all core S3 features. MinIO is built to deploy anywhere - public or private cloud, baremetal infrastructure, orchestrated environments, and edge infrastructure. It is a high performance distributed object storage server, designed for large-scale private cloud infrastructure. MinIO is designed in a cloud-native manner to scale sustainably in multi-tenant environments.
In this guide, we will explore how to deploy standalone minio server in a Rocky Linux but it should work similarly in other Linux distributions.
Related content
- How to set CORS headers on your Amazon S3 bucket
- How to store Django Static and Media files in Amazon S3
- Script to Upload files to AWS S3 Using Golang
- Using AWS S3 Programatically with Python using Boto3 SDK
- Using AWS S3 from the terminal with awscli
Running Minio server
Minio Server is distributed as an executable binary. It is hosted by the minio team. Use this command to download the file to the /usr/local/bin
directory
|
|
That command will download the minio executable file and save it into /usr/local/bin
. You will then need to give the file executable permissions with:
|
|
Once downloaded you can check the version
|
|
Configuring Data Directory for Minio Storage
Minio will store the files uploaded to a path in the file system. You thus need to create a directory that will be used for that purpose.
If your local storage isn’t large enough to house all of the data, you’ll need to attach an external drive and mount it. Let’s say you have a drive named /dev/sdb1
and you want to mount it to /mnt/data
.
First, created the /mnt/data
directory with:
|
|
Next, mount the drive with:
|
|
To mount the drive on boot, we need to add an entry to fstab
. Open fstab:
|
|
At the bottom of that file, add the following:
|
|
Do note that if your drive uses another partition format, make sure to replace ext4
with the proper type.
Save and close the file. Remount all available partitions with:
|
|
You should see no errors.
Testing that Minio runs as expected
To test that the binary is working as expected, you can use this command to run the server in the terminal:
|
|
This will run the service exposing admin in port 9001
. Access http://localhost:9001/ using the username and password provided as part of the arguments.
Running Minio with systemd
Set up Data Directory and configurations
When running Minio in a remote server, we would want the service to run as a daemon so it persists logouts. Systemd provides us a way to achieve that.
First we will need to a system user that will be used by the service. Create it with this command:
|
|
Change the ownership of the data diretory so that it belongs to the minio
user with:
|
|
Now, make a directory to house the MinIO configurations with:
|
|
Give that directory the proper ownership with:
|
|
Create a configuration file for MinIO with the command:
|
|
In that file, paste the following:
|
|
Where SecretP4s$w0rd
is a strong/unique password.
Save and close the file.
Give that file the proper permissions with:
|
|
Create a systemd file
Once the configurations are set up, we are ready to create a systemd file. Open the file with your favourite text editor:
|
|
In that file, paste the following:
|
|
Save and close the file.
Reload the systemd daemon with:
|
|
Start and enable the MinIO service with:
|
|
Open the Firewall
If you have firewalld installed and enabled, you will need to configure it.
Without the firewall open, we can’t access MinIO, which requires both 9000
and 9001
TCP ports open. Do this with the commands:
|
|
Reload the firewall with:
|
|
Accessing Minio
Open a web browser on the same network and point it to http://SERVER:9000
(where SERVER is the IP address or domain of the hosting server). You should be greeted by the login screen, where you’ll authenticate with username admin
and the password you created in the configuration file.
Once you successfully authenticate, you’ll find yourself on the main MinIO window, where you can create your first storage bucket and manage things like access keys, identities, monitoring, notification, tiers, replication, and more.