11

Deploy MinIO Storage on Rocky Linux 8|AlmaLinux 8|CentOS 8

 2 years ago
source link: https://computingforgeeks.com/deploy-minio-storage-on-rocky-almalinux-centos/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Deploy MinIO Storage on Rocky Linux 8|AlmaLinux 8|CentOS 8

MinIO is an open-source S3 compatible object storage licensed under the GNU AGPL v3 Licence. This is a lightweight object storage server that can be bundled with the application stack just like Redis, MySQL, NodeJS e.t.c. The MinIO storage server can be used to store videos, photos, log files, backups, VM/Container images e.t.c. Data is stored/pulled from the server, using a simple GET/PUT API over HTTP.

The MinIO storage server offers the features below:

  • High performance – it is the fastest object storage with the GET/PUT throughput of 325 and 165 GiB/sec respectively on just 32 nodes of NVMe.
  • Encryption – It supports multiple, sophisticated server-side encryption schemes to protect data ensuring integrity, confidentiality, and authenticity with a negligible performance overhead
  • Identity Management– it supports most advanced standards in identity management, with the ability to integrate with the OpenID connect compatible providers as well as key external IDP vendors.
  • Continuous Replication – It is designed for large scale, cross data center deployments thus curbing the challenge with traditional replication approaches that do not scale effectively beyond a few hundred TiB
  • Monitoring – It offers detailed performance analysis with metrics and per-operation logging.
  • Data life cycle management and Tiering – this protects the data within and accross both public and private clouds.
  • Architecture – MinIO is cloud native and light weight and can also run as containers managed by external orchestration services such as Kubernetes. It is efficient to run on low CPU and memory resources and therefore allowing one to co-host a large number of tenants on shared hardware.

This guide seeks to demonstrate how to deploy the MinIO Storage Server on CentOS 8 | Rocky Linux 8.

Getting Started

Before we dive into the installation, update your system packages to their latest stable versions as below.

sudo dnf update

Also, install the required tools.

sudo dnf install wget vim

Step 1 – Install MinIO Storage Server on CentOS 8 | Rocky Linux 8.

Download the latest available binary file for MinIO from the MinIO Downloads page. Alternatively, you can use Wget as illustrated.

##For amd64
wget https://dl.min.io/server/minio/release/linux-amd64/minio

##For arm64
wget https://dl.min.io/server/minio/release/linux-arm64/minio

##For ppc64le
wget https://dl.min.io/server/minio/release/linux-ppc64le/minio

##For s390x
wget https://dl.min.io/server/minio/release/linux-s390x/minio

Once the binary for your architecture has been downloaded, copy it to /usr/local/bin/ and make it executable.

sudo cp minio /usr/local/bin/
sudo chmod +x /usr/local/bin/minio

Create an environment file for MinIO as below.

sudo vim /etc/default/minio

In the file, add the below lines:

# Volume to be used for Minio server.
MINIO_VOLUMES="/tmp/minio/"

# Use if you want to run Minio on a custom port.
MINIO_OPTS="--address :9000 --console-address :9001"

# Root user for the server. 
MINIO_ROOT_USER=admin
# Root secret for the server. 
MINIO_ROOT_PASSWORD=Passw0rd

Here, replace the root_user and password with desired keys and proceed as below.

Step 2 – Create a System Service file for MinIO.

To be able to manage the MinIO storage server like any other systemd service, we need to create a system service file.

Begin by creating a MinIO user to manage the service:

sudo useradd -s /sbin/nologin -d /minio minio

Set the required permissions:

sudo chmod 755 /usr/local/bin/minio
sudo chown minio:minio /usr/local/bin/minio
sudo chown minio:minio /etc/default/minio

Create the service file.

sudo vim /etc/systemd/system/minio.service

In the file, add the content below.

[Unit]
Description=Minio
Documentation=https://docs.minio.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio

[Service]
WorkingDirectory=/usr/local/

User=minio
Group=minio

EnvironmentFile=-/etc/default/minio
ExecStartPre=/bin/bash -c "if [ -z \"${MINIO_VOLUMES}\" ]; then echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\"; exit 1; fi"

ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES

# Let systemd restart this service always
Restart=always

# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536

# Disable timeout logic and wait until process is stopped
TimeoutStopSec=infinity
SendSIGKILL=no

[Install]
WantedBy=multi-user.target
# Built for ${project.name}-${project.version} (${project.name})

Save the file and reload system daemons.

sudo systemctl daemon-reload

Start and enable the MinIO service.

sudo systemctl enable minio.service
sudo systemctl start minio.service

Check the status of the service.

$ systemctl status minio.service
 minio.service - Minio
   Loaded: loaded (/etc/systemd/system/minio.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2022-01-26 02:51:12 EST; 6s ago
          Docs: https://docs.minio.io
  Process: 32928 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: 32930 (minio)
    Tasks: 7 (limit: 36438)
   Memory: 59.5M
   CGroup: /system.slice/minio.service
           └─37603 /usr/local/bin/minio server --address :9000 --console-address :9001 /tmp/minio/

Jan 26 03:00:48 localhost.localdomain systemd[1]: minio.service: Succeeded.
Jan 26 03:00:48 localhost.localdomain systemd[1]: Stopped Minio.
Jan 26 03:00:48 localhost.localdomain systemd[1]: Starting Minio...
Jan 26 03:00:48 localhost.localdomain systemd[1]: Started Minio.
Jan 26 03:00:49 localhost.localdomain minio[32930]: API: http://192.168.205.2:9000  http://192.168.122.1:9000  http://127.0.0.1:9000
Jan 26 03:00:49 localhost.localdomain minio[32930]: Console: http://192.168.205.2:9001 http://192.168.122.1:9001 http://127.0.0.1:9001
Jan 26 03:00:49 localhost.localdomain minio[32930]: Documentation: https://docs.min.io

Step 3 – Access the MinIO Storage Server Web Console.

The MinIO storage server web UI can be accessed using the URL http:// IP Address :9000/

Allow the ports through the firewall.

sudo firewall-cmd --zone=public --add-port=9000/tcp --permanent
sudo firewall-cmd --zone=public --add-port=9001/tcp --permanent
sudo firewall-cmd --reload

You should be granted this page. Login using the root_user and access key created in step 1.

On successful authentication, you will be granted the MinIO dashboard below.

Under the “Users” tab, create a user with the access and secret key.

Create a group under the “Groups” tab and add your user to it.

Navigate to the Buckets tab and create a bucket where you can upload files and folders.

Add files to your bucket by clicking on browse.

Upload a file/folder to your bucket.

The uploaded files/folders will appear as above. You can download/delete/preview them. You can also share the file using a link with the expiry period set as below.

You can as well view the logs under tools and select your desired tool. Some tools here need to be configured first.

Logs will be presented as below.

Step 4 – Use MinIO Client(mc) to manage MinIO server.

The MinIO Client provides an easy way to manage the Server by providing UNIX commands such as ls, rm, cat, mv, mirror, cp e.t.c. The MinIO Client can be installed on a system using binaries as below.

##For amd64
wget https://dl.min.io/client/mc/release/linux-amd64/mc

##For ppc64
wget https://dl.min.io/client/mc/release/linux-ppc64le/mc

Copy the file to your path and make it executable.

sudo cp mc /usr/local/bin/
sudo chmod +x /usr/local/bin/mc

Verify the installation using the command below.

$ mc --version
mc version RELEASE.2022-02-16T05-54-01Z

Now to connect to your MinIO server using mc, the syntax below is used.

mc alias set <ALIAS> <YOUR-S3-ENDPOINT> [YOUR-ACCESS-KEY] [YOUR-SECRET-KEY] [--api API-SIGNATURE]

For example, in this case, we will connect to our MinIO server with the command:

mc alias set minio http://192.168.205.2 admin Passw0rd --api S3v4

Here the API signature flag is optional and is set to S3v4 by default. The connection will occur as below.

You can also specify keys using standard input as below.

$ mc alias set minio http://192.168.205.2 --api S3v4
Enter Access Key:admin
Enter Secret Key:Passw0rd

Once connected, you can test your setup using the play command to list all the buckets:

mc ls play

Sample Output:

Now you can proceed and use more mc commands. In case you need help, find it as below:

$ mc --help
NAME:
  mc - MinIO Client for cloud storage and filesystems.

USAGE:
  mc [FLAGS] COMMAND [COMMAND FLAGS | -h] [ARGUMENTS...]

COMMANDS:
  alias      manage server credentials in configuration file
  ls         list buckets and objects
  mb         make a bucket
  rb         remove a bucket
  cp         copy objects
  mv         move objects
  rm         remove object(s)
  mirror     synchronize object(s) to a remote site
  cat        display object contents
  head       display first 'n' lines of an object
  pipe       stream STDIN to an object
  find       search for objects
  sql        run sql queries on objects
  stat       show object metadata
  tree       list buckets and objects in a tree format
  du         summarize disk usage recursively
  retention  set retention for object(s)
  legalhold  manage legal hold for object(s)
  support    support related commands
  share      generate URL for temporary access to an object
  version    manage bucket versioning
  ilm        manage bucket lifecycle
  encrypt    manage bucket encryption config
  event      manage object notifications
  watch      listen for object notification events
  undo       undo PUT/DELETE operations
  anonymous  manage anonymous access to buckets and objects
  tag        manage tags for bucket and object(s)
  diff       list differences in object name, size, and date between two buckets
  replicate  configure server side bucket replication
  admin      manage MinIO servers
  update     update mc to latest release

The end!

We have successfully deployed a MinIO Storage Server on CentOS 8 | Rocky Linux 8. I hope this was helpful. In case you encountered any problems with this guide, feel free to share in the comments below.

Related posts:

How To Deploy Rook Ceph Storage on Kubernetes Cluster

Deploy and Use OpenEBS Container Storage on Kubernetes

Install and Configure XigmaNAS NAS (Network-Attached Storage) Solution


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK