Better formatting and adding systemd config to run Minio server on custom port. (#3113)

This commit is contained in:
Karthic Rao 2016-10-27 22:34:06 +05:30 committed by Harshavardhana
parent 9e2d0ac50b
commit a9dd2793f9

View File

@ -1,40 +1,50 @@
- Systemd script is configured to run the binary from /usr/share/minio/bin/. - Systemd script is configured to run the binary from /usr/share/minio/bin/.
```sh
`$ mkdir -p /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. - Download the binary. Find the relevant links for the binary at https://minio.io/downloads/#minio-server.
```sh
`$ wget -O /usr/share/minio/bin/minio https://dl.minio.io/server/minio/release/linux-amd64/minio` $ wget -O /usr/share/minio/bin/minio https://dl.minio.io/server/minio/release/linux-amd64/minio
```
- Give execute permission to the Minio binary. - Give execute permission to the Minio binary.
```sh
`$ chmod +x /usr/share/minio/bin/minio` $ chmod +x /usr/share/minio/bin/minio
```
- Create user minio. Systemd is configured with User=minio . - Create user minio. Systemd is configured with User=minio .
```sh
`$ useradd minio` $ useradd minio
```
- Create the Environment configuration file. - Create the Environment configuration file.
```sh
`$ cat <<EOT >> /etc/default/minio.conf` $ cat <<EOT >> /etc/default/minio.conf
```
``` ```
# Remote node configuration.
MINIO_VOLUMES=node1:/tmp/drive1 node2:/drive1 node3:/tmp/drive1 minio4:/tmp/drive1 MINIO_VOLUMES=node1:/tmp/drive1 node2:/drive1 node3:/tmp/drive1 minio4:/tmp/drive1
# Use if you want to run Minio on a custom port.
MINIO_OPTS="--address :9199"
# Acess Key of the server.
MINIO_ACCESS_KEY=Server-Access-Key MINIO_ACCESS_KEY=Server-Access-Key
# Secret key of the server.
MINIO_SECRET_KEY=Server-Secret-Key MINIO_SECRET_KEY=Server-Secret-Key
EOT EOT
``` ```
- Download and put `minio.service` in `/etc/systemd/system/` - Download and put `minio.service` in `/etc/systemd/system/`
```sh
`$ ( cd /etc/systemd/system/; curl -O https://raw.githubusercontent.com/minio/minio/master/dist/linux-systemd/distributed/minio.service )` $ ( cd /etc/systemd/system/; curl -O https://raw.githubusercontent.com/minio/minio/master/dist/linux-systemd/distributed/minio.service )
```
- Enable startup on boot. - Enable startup on boot.
```sh
`$ systemctl enable minio.service` $ systemctl enable minio.service
```