Skip to content

Commit 293d61a

Browse files
nitishtkannappanr
authored andcommitted
Update systemd files to not mention config.json file (minio#14)
1 parent 78cdd5b commit 293d61a

File tree

4 files changed

+21
-34
lines changed

4 files changed

+21
-34
lines changed

linux-systemd/README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,18 @@ Systemd script for Minio server.
77
- Systemd script is configured to run the binary from /usr/local/bin/.
88
- Download the binary. Find the relevant links for the binary at https://minio.io/downloads/#minio-server.
99

10-
## Create default configuration.
10+
## Create default configuration
1111

12-
Don't forget to update MINIO_VOLUMES with the correct path.
13-
```
14-
cat <<EOT >> /etc/default/minio
15-
# Local export path.
12+
This file serves as input to Minio systemd service. Use this file to add `MINIO_VOLUMES` with the correct paths,
13+
`MINIO_OPTS` to add Minio server options like `config-dir`, `address`. Minio credentials can be
14+
`MINIO_ACCESS_KEY` and `MINIO_SECRET_KEY` in this file as well.
15+
16+
```sh
17+
$ cat <<EOT >> /etc/default/minio
18+
# Volume to be used for Minio server.
1619
MINIO_VOLUMES="/tmp/minio/"
1720
# Use if you want to run Minio on a custom port.
1821
MINIO_OPTS="--address :9199"
19-
20-
EOT
21-
```
22-
23-
## Override default keys.
24-
25-
By default minio reads credentials from `${HOME}/.minio/config.json`. You can
26-
override these values by adding custom credentials in `/etc/default/minio`.
27-
28-
```
29-
cat <<EOT >> /etc/default/minio
3022
# Access Key of the server.
3123
MINIO_ACCESS_KEY=Server-Access-Key
3224
# Secret key of the server.

linux-systemd/distributed/README.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,18 @@ Systemd script for Distributed Minio server.
77
- Systemd script is configured to run the binary from /usr/local/bin/.
88
- Download the binary. Find the relevant links for the binary at https://minio.io/downloads/#minio-server.
99

10-
## Create the Environment configuration file.
10+
## Create the Environment configuration file
1111

12-
Don't forget to update MINIO_VOLUMES with the correct paths.
12+
This file serves as input to Minio systemd service. Use this file to add `MINIO_VOLUMES` with the correct paths,
13+
`MINIO_OPTS` to add Minio server options like `config-dir`, `address`. Minio credentials should be
14+
`MINIO_ACCESS_KEY` and `MINIO_SECRET_KEY` in this file as well.
1315

1416
```sh
1517
$ cat <<EOT >> /etc/default/minio
16-
# Remote node configuration.
18+
# Remote volumes to be used for Minio server.
1719
MINIO_VOLUMES=http://node1/export1 http://node2/export2 http://node3/export3 http://node4/export4
1820
# Use if you want to run Minio on a custom port.
1921
MINIO_OPTS="--address :9199"
20-
21-
EOT
22-
```
23-
24-
## Override default keys.
25-
26-
By default minio reads credentials from `${HOME}/.minio/config.json`. For
27-
distriuted setup it is required to copy this file across all nodes to have
28-
consistent credentials. You can override this behavior add custom credentials
29-
in `/etc/default/minio`.
30-
```
31-
cat <<EOT >> /etc/default/minio
3222
# Access Key of the server.
3323
MINIO_ACCESS_KEY=Server-Access-Key
3424
# Secret key of the server.
@@ -37,15 +27,18 @@ MINIO_SECRET_KEY=Server-Secret-Key
3727
EOT
3828
```
3929

30+
For distributed setup it is required to copy this file across all nodes to have consistent credentials.
31+
4032
## Systemctl
4133

4234
Download `minio.service` in `/etc/systemd/system/`
35+
4336
```
4437
( cd /etc/systemd/system/; curl -O https://raw.githubusercontent.com/minio/minio-service/master/linux-systemd/distributed/minio.service )
4538
```
4639

4740
Enable startup on boot
41+
4842
```
4943
systemctl enable minio.service
5044
```
51-

linux-systemd/distributed/minio.service

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Group=minio-user
1414
PermissionsStartOnly=true
1515

1616
EnvironmentFile=-/etc/default/minio
17-
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set in /etc/defaults/minio\""
17+
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] && echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\""
18+
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_ACCESS_KEY}\" ] && echo \"Variable MINIO_ACCESS_KEY not set in /etc/default/minio\""
19+
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_SECRET_KEY}\" ] && echo \"Variable MINIO_SECRET_KEY not set in /etc/default/minio\""
1820

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

linux-systemd/minio.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Group=minio-user
1414
PermissionsStartOnly=true
1515

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

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

0 commit comments

Comments
 (0)