Site icon installvirtual

System Services for minio centos I Minio

system services for minio

System services for Minio

We will configure system services for minio on centos. It would be easy to manage minio with systemd.

Prerequisites

Systemd scripts is configured to run the binary from /usr/local/bin/.

Download the binary from the link.

Also read: How to install minio on centos 7

Create default configuration

Use the following snippet to create the configuration

cat <<EOT >> /etc/default/minio
# Local export path.
MINIO_VOLUMES="/tmp/minio/"
# Use if you want to run Minio on a custom port.
MINIO_OPTS="--address :9199"
EOT

Update the MINIO_VOLUMES to the location of your choice.

Update the keys

We also need to update the default access keys in order to use minio. By default minio reads credentials from ${HOME}/.minio/config.json. You can override these values by adding custom credentials in /etc/default/minio.

cat <<EOT >> /etc/default/minio
# Access Key of the server.
MINIO_ACCESS_KEY=Server-Access-Key
# Secret key of the server.
MINIO_SECRET_KEY=Server-Secret-Key
EOT

Add service in systemd

Create a new file minio.service in /etc/systemd/system and add the following in it.

Update the minio user and group with your local environment.

 [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-user
 Group=minio-user

PermissionsStartOnly=true

EnvironmentFile=-/etc/default/minio
 ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\""

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

StandardOutput=journal
 StandardError=inherit

# 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=0

# SIGTERM signal is used to stop Minio
 KillSignal=SIGTERM

SendSIGKILL=no

SuccessExitStatus=0

[Install]
 WantedBy=multi-user.target

Enable and start minio service

We will enable minio service on boot and start it.

systemctl enable minio

Start the Services

We will use systemctl to start the minio service

systemctl start minio

Stopping Services

systemctl stop minio

Status of minio

systemctl status minio

Note: Please make sure MINIO_VOLUMES has correct write access.

Read also: How to install minio on centos
Read also: How to install glusterfs on centos

If you got some problem using this tutorial please feel free to comment below..

Exit mobile version