Sales4 min read765 words

Ubuntu 20.04 MinIO Cluster Installation

Fatih Çevik

Fatih Çevik

PlusClouds Author

Cloud & SaaS

What is MinIO?

MinIO is a high-performance object storage service released under the GNU Affero General Public License V3.0. If you are reading this article, most of you may have heard of or used the Amazon S3 storage service. We can say that the MinIO service has nearly the same functionalities as S3. By using MinIO, you can create your own S3 server at a lower cost.

What is Object Storage?

Object storage takes every part of the data and redesigns it as an object. Unlike file storage and block storage, the data is stored in unique metadata sections assigned piece by piece in the storage pool.

Preparation and Requirements

In this article, we will use the Ubuntu 20.04 operating system.

  • 4 Ubuntu 20.04 installed servers

  • Root access on all nodes

  • Stable internet connection on the nodes where installation will take place

After Meeting the Requirements, We Can Proceed to Installation.

The next steps must be done completely on all nodes.

1. Mount a New Disk Aside from the Disk Where the Operating System is Installed

Our essential requirement for MinIO cluster installation is to mount a new disk for the MinIO service aside from the disk where the operating system is installed.

We can list the disks connected to the machine with the following command.

fdisk -l

 Disk /dev/xvda:   80   GiB,   85899345920   bytes,   167772160   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
Disklabel type: gpt
Disk identifier: 2666C97D-884F-4535-8F56-5DCE785E1D25

Device Start End Sectors Size Type
/dev/xvda1 2048 4095 2048 1M BIOS boot
/dev/xvda2 4096 2101247 2097152 1G Linux filesystem
/dev/xvda3 2101248 167772126 165670879 79G Linux filesystem




Disk /dev/xvdb: 20 GiB, 21474836480 bytes, 41943040 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

You will encounter an output similar to the one above. Here, the /dev/xvda disk is the disk where our operating system is installed. The newly added disk appears as /dev/xvdb.

Before performing the mount operation for the new disk, we need to do a few more things.

First, create a physical area with the following command.

pvcreate /dev/xvdb

Immediately after, we create the directory where we will mount our disk.

mkdir /data

Then we create the file system of our new disk with the following command.

mkfs.ext4 /dev/xvdb

After creating the file system, we perform the last remaining step for the mount operation. We configure the disk and mount directory in the /etc/fstab file.

nano /etc/fstab

After reaching the file, we add the following line.

/dev/xvdb /data ext4 defaults,noatime,nofail 0 0

Our disk is now ready for the mount operation. We perform the mount operation with the following command.

mount -a

You can verify the mount operation with the following command.

df -h

Don't forget that we need to perform the same operation on all nodes.

2. Perform MinIO Service Installation

Prepare your operating system before service installation. You can carry out the operations with the following command.

apt update && apt upgrade && apt install wget -y

Then we download the MinIO service and give the required permissions.

wget -O /usr/local/bin/minio https://dl.minio.io/server/minio/release/linux-amd64/minio

chmod +x /usr/local/bin/minio

We create and edit the service file for MinIO in the directory where our system services are located.

nano /lib/systemd/system/minio.service

Copy and paste the following lines and save.

 [Unit]

Description =minio

Documentation =https://docs.min.io

Wants =network-online.target

After =network-online.target

AssertFileIsExecutable =/usr/local/bin/minio

[Service]

WorkingDirectory =/usr/local/

User =root

Group =root

EnvironmentFile =/etc/default/minio

ExecStart =/usr/local/bin/minio server $MINIO_OPTS \
--console-address ":9001"

Restart =always

LimitNOFILE =65536

TimeoutStopSec =infinity

SendSIGKILL = no

[Install]

WantedBy =multi-user.target

Then we create and edit our MinIO config file.

nano /etc/default/minio

Copy and paste the following lines. Don't forget to change the necessary places with your own information.

 MINIO_OPTS=  "http://hostname1:9000/data     http://hostname2:9000/data         http://hostname3:9000/data         http://hostname4:9000/data     "  

MINIO_ACCESS_KEY= "A secure key that will serve as at least a 16 character user information"

MINIO_SECRET_KEY= "A console login password of at least 16 characters"

If you have performed the same operations on all nodes mentioned above, the only thing left is to run the MinIO service on each node individually.

systemctl daemon-reload systemctl enable minio systemctl start minio.service

And finally, you can verify that your cluster is running actively with the following command.

systemctl status minio.service

Your MinIO cluster is now ready for use. See you in another article :)

#There is no text provided for translation. Please provide the text you would like to be translated into English.

Sıkça Sorulan Sorular

What is MinIO and how does it relate to S3?

MinIO is a high-performance object storage service released under the GNU Affero General Public License V3.0. It has nearly the same functionalities as Amazon S3, and using MinIO lets you create your own S3-like server at a lower cost.

What is Object Storage?

Object storage stores data as objects with unique metadata, redesigning data into separate pieces. It differs from file storage and block storage, which organize data differently.

What are the preparation and hardware requirements for installing MinIO on Ubuntu 20.04?

The article uses Ubuntu 20.04 as the operating system. You will need four Ubuntu 20.04 installed servers, root access on all nodes, and a stable internet connection on the nodes where installation will take place.

How do you prepare and mount a new disk for MinIO on a node?

Identify the new disk using a tool like fdisk -l, for example /dev/xvdb. Then create a physical area with pvcreate /dev/xvdb, create the /data directory, format the disk with mkfs.ext4 /dev/xvdb, update /etc/fstab with the line /dev/xvdb /data ext4 defaults,noatime,nofail 0 0, and finally run mount -a and verify with df -h.

How do you install the MinIO service on Ubuntu 20.04?

Update and upgrade the operating system and install wget. Then download the MinIO binary to /usr/local/bin/minio and make it executable. After that, create and edit the MinIO service and configuration files in their respective locations.

How is the MinIO cluster configured across multiple nodes?

The cluster is configured by setting MINIO_OPTS in /etc/default/minio to include the data endpoints for all nodes, such as http://hostname1:9000/data and similar entries. You also specify MINIO_ACCESS_KEY and MINIO_SECRET_KEY, then start the MinIO service on each node.

How do you start and verify the MinIO cluster on all nodes?

On each node, run systemctl daemon-reload, systemctl enable minio, and systemctl start minio.service. Finally, verify that the cluster is running with systemctl status minio.service.