dist: Adding systemd script for running Minio distributed. (#3034)
parent
885bac330b
commit
87af2dbc43
@ -0,0 +1,41 @@ |
||||
|
||||
- Systemd script is configured to run the binary from /usr/share/minio/bin/. |
||||
|
||||
`$ mkdir -p /usr/share/minio/bin/` |
||||
|
||||
- Download the binary. Find the relevant links for the binary at https://minio.io/downloads/#minio-server. |
||||
|
||||
`$ wget -O /usr/share/minio/bin/minio https://dl.minio.io/server/minio/release/linux-amd64/minio` |
||||
|
||||
- Give execute permission to the Minio binary. |
||||
|
||||
`$ chmod +x /usr/share/minio/bin/minio` |
||||
|
||||
- Create user minio. Systemd is configured with User=minio . |
||||
|
||||
`$ useradd minio` |
||||
|
||||
- Create the Environment configuration file. |
||||
|
||||
`$ cat <<EOT >> /etc/default/minio.conf` |
||||
|
||||
``` |
||||
MINIO_VOLUMES=node1:/tmp/drive1 node2:/drive1 node3:/tmp/drive1 minio4:/tmp/drive1 |
||||
|
||||
MINIO_ACCESS_KEY=Server-Access-Key |
||||
|
||||
MINIO_SECRET_KEY=Server-Secret-Key |
||||
|
||||
EOT |
||||
``` |
||||
- Download and put `minio.service` in `/etc/systemd/system/` |
||||
|
||||
`$ ( cd /etc/systemd/system/; curl -O https://raw.githubusercontent.com/minio/minio/master/dist/linux-systemd/distributed/minio.service )` |
||||
|
||||
- Enable startup on boot. |
||||
|
||||
`$ systemctl enable minio.service` |
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,40 @@ |
||||
[Unit] |
||||
Description=Minio |
||||
Documentation=https://docs.minio.io |
||||
Wants=network-online.target |
||||
After=network-online.target |
||||
AssertFileIsExecutable=/usr/share/minio/bin/minio |
||||
|
||||
[Service] |
||||
WorkingDirectory=/usr/share/minio/ |
||||
|
||||
User=minio |
||||
Group=minio |
||||
|
||||
PermissionsStartOnly=true |
||||
|
||||
EnvironmentFile=-/etc/default/minio.conf |
||||
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set in /etc/defaults/minio.conf\"" |
||||
|
||||
ExecStart=/usr/share/minio/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 |
||||
|
||||
# Built for ${project.name}-${project.version} (${project.name}) |
Loading…
Reference in new issue