Common include for single-node deployments describes multi-drive, which is wrong for single-drive. Replaced include with inline content that specifies only a single drive everywhere. Incidentally fixed list indentation in override, copied fix into include as well. Fixes: https://github.com/minio/docs/issues/1330 Staged: [Deploy MinIO: Single-Node Single-Drive](http://192.241.195.202:9000/staging/DOC-1330/linux/operations/install-deploy-manage/deploy-minio-single-node-single-drive.html) (edited include not available to review on staging -- applies to macos or docker/container -- but checked locally)
7.0 KiB
1) Download the MinIO Server
2) Create the
systemd
Service File
The .deb
or .rpm
packages install the
following systemd
service file to /usr/lib/systemd/system/minio.service
. For
binary installations, create this file manually on all MinIO hosts.
Note
systemd
checks the /etc/systemd/...
path
before checking the /usr/lib/systemd/...
path and uses the
first file it finds. To avoid conflicting or unexpected configuration
options, check that the file exists only at the
/usr/lib/systemd/system/minio.service
path.
Refer to the man page for systemd.unit for details on the file path search order.
[Unit]
Description=MinIO
Documentation=https://min.io/docs/minio/linux/index.html
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio
[Service]
WorkingDirectory=/usr/local
User=minio-user
Group=minio-user
ProtectProc=invisible
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
# MinIO RELEASE.2023-05-04T21-44-30Z adds support for Type=notify (https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=)
# This may improve systemctl setups where other services use `After=minio.server`
# Uncomment the line to enable the functionality
# Type=notify
# Let systemd restart this service always
Restart=always
# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536
# Specifies the maximum number of threads this process can create
TasksMax=infinity
# 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})
The minio.service
file runs as the
minio-user
User and Group by default. You can create the
user and group using the groupadd
and useradd
commands. The following example creates the user and group, and sets
permissions to access the folder paths intended for use by MinIO. These
commands typically require root (sudo
) permissions.
groupadd -r minio-user
useradd -M -r -g minio-user minio-user
chown minio-user:minio-user /mnt/data
The drive path in this example is specified by the MINIO_VOLUMES environment variable. Change the value here and in the environment variable file to match the path to the drive intended for use by MinIO.
Alternatively, change the User
and Group
values to another user and group on the system host with the necessary
access and permissions.
MinIO publishes additional startup script examples on github.com/minio/minio-service <minio-service>
.
To update deployments managed using systemctl
, see minio-upgrade-systemctl
.
3) Create the Environment Variable File
Create an environment variable file at
/etc/default/minio
. The MinIO Server container can use this
file as the source of all environment variables <minio-server-environment-variables>
.
The following example provides a starting environment file:
# MINIO_ROOT_USER and MINIO_ROOT_PASSWORD sets the root account for the MinIO server.
# This user has unrestricted permissions to perform S3 and administrative API operations on any resource in the deployment.
# Omit to use the default values 'minioadmin:minioadmin'.
# MinIO recommends setting non-default values as a best practice, regardless of environment
MINIO_ROOT_USER=myminioadmin
MINIO_ROOT_PASSWORD=minio-secret-key-change-me
# MINIO_VOLUMES sets the storage volume or path to use for the MinIO server.
MINIO_VOLUMES="/mnt/data"
# MINIO_OPTS sets any additional commandline options to pass to the MinIO server.
# For example, `--console-address :9001` sets the MinIO Console listen port
MINIO_OPTS="--console-address :9001"
Include any other environment variables as required for your deployment.
Server RELEASE.2024-03-03T17-50-39Z
MinIO automatically generates unique root credentials if all of the following conditions are true:
KES <tutorials/getting-started/>
Release 2024-03-01T18-06-46Z or later running- Have not defined:
MINIO_ROOT_USER
variableMINIO_ROOT_PASSWORD
variable
- Have:
- set up KES with a
supported KMS target <#supported-kms-targets>
- disabled root access with the
MinIO environment variable <minio-disable-root-access>
- set up KES with a
When those conditions are met at startup, MinIO uses the KMS to generate unique root credentials for the deployment using a hash-based message authentication code (HMAC).
If MinIO generates such credentials, the key used to generate the credentials must remain the same and continue to exist. All data on the deployment is encrypted with this key!
To rotate the generated root credentials, generate a new key in the
KMS, then update the value of the MINIO_KMS_KES_KEY_NAME
with the new key.
4) Start the MinIO Service
Issue the following command on the local host to start the MinIO deployment as a service:
The journalctl
output should resemble the following:
Status: 1 Online, 0 Offline.
API: http://192.168.2.100:9000 http://127.0.0.1:9000
RootUser: myminioadmin
RootPass: minio-secret-key-change-me
Console: http://192.168.2.100:9001 http://127.0.0.1:9001
RootUser: myminioadmin
RootPass: minio-secret-key-change-me
Command-line: https://min.io/docs/minio/linux/reference/minio-mc.html
$ mc alias set myminio http://10.0.2.100:9000 myminioadmin minio-secret-key-change-me
Documentation: https://min.io/docs/minio/linux/index.html
The API
block lists the network interfaces and port on
which clients can access the MinIO S3 API. The Console
block lists the network interfaces and port on which clients can access
the MinIO Web Console.