Post

MiniO 시작

환경

  • OS: OpenMediaVault 7.4.13-1
    (Based on Debian GNU/Linux 12 (bookworm))

개요

MiniO는 AWS의 S3와 완벽하게 호환되는 오픈소스 Object Storage이다.

S3와 호환된다는 장점으로 인해 On-premise 환경에서 MiniO로 개발을 하고 나중에 단순히 주소를 S3로 바꾸기만 하면 쉽게 이전이 가능하다. 물론 그 반대도 가능하다.

심지어 MiniO의 S3 API는 공식 문서 자체가 Amazon으로 연결이 된다.

설치

OMV는 데비안 계열이므로 deb 파일을 다운로드 후 설치한다.

1
wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20241107005220.0.0_amd64.deb -O minio.deb
결과
1
2
3
4
5
6
7
8
9
10
--2024-11-23 22:28:40--  https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20241107005220.0.0_amd64.deb
Resolving dl.min.io (dl.min.io)... 138.68.11.125, 178.128.69.202
Connecting to dl.min.io (dl.min.io)|138.68.11.125|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 37426422 (36M) [application/vnd.debian.binary-package]
Saving to: ‘minio.deb’

minio.deb                                   100%[===========================================================================================>]  35.69M  10.3MB/s    in 4.2s    

2024-11-23 22:28:45 (8.52 MB/s) - ‘minio.deb’ saved [37426422/37426422]


1
sudo dpkg -i minio.deb
결과
1
2
3
4
5
Selecting previously unselected package minio.
(Reading database ... 51621 files and directories currently installed.)
Preparing to unpack minio.deb ...
Unpacking minio (20241107005220.0.0) ...
Setting up minio (20241107005220.0.0) ...


1
minio -v
결과
1
2
3
4
minio version RELEASE.2024-11-07T00-52-20Z (commit-id=cefc43e4daa4cbb490ef6726ea374e26a93eb85e)
Runtime: go1.23.3 linux/amd64
License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html
Copyright: 2015-2024 MinIO, Inc.


실행

MiniO 서버의 경로를 잡아주고 서버를 실행한다.

1
2
mkdir ~/minio
minio server ~/minio --console-address :9001
결과
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
INFO: Formatting 1st pool, 1 set(s), 1 drives per set.
INFO: WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.
MinIO Object Storage Server
Copyright: 2015-2024 MinIO, Inc.
License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html
Version: RELEASE.2024-11-07T00-52-20Z (go1.23.3 linux/amd64)

API: http://127.0.0.1:9000 
   RootUser: minioadmin 
   RootPass: minioadmin 

WebUI: http://127.0.0.1:9001   
   RootUser: minioadmin 
   RootPass: minioadmin 

CLI: https://min.io/docs/minio/linux/reference/minio-mc.html#quickstart
   $ mc alias set 'myminio' 'http://127.0.0.1:9000' 'minioadmin' 'minioadmin'

Docs: https://docs.min.io
WARN: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD' environment variables


WebUI의 주소로 들어가면 아래 화면이 나오고, 나온다면 성공이다!

01

버킷을 만들고 Public으로 설정하고 임의의 사진 파일을 업로드한 후에

127.0.0.1:9000/버킷/이미지.jpg

위와 같은 형식으로 접근해서 이미지가 잘 보이는지 테스트할 수 있다.

[번외] Systemd 설정

systemd로 편하게 관리해보자.

그다지 어려운 설정은 없으니, 적당히 맞게 수정해주면 된다.

1
sudo nano /lib/systemd/system/minio.service
결과
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio

[Service]
Type=notify

WorkingDirectory=/usr/local

User=minio-user
Group=minio-user
ProtectProc=invisible

EnvironmentFile=-/etc/default/minio
ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES

# Let systemd restart this service always
Restart=always

# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=1048576

# Turn-off memory accounting by systemd, which is buggy.
MemoryAccounting=no

# Specifies the maximum number of threads this process can create
TasksMax=infinity

# Disable timeout logic and wait until process is stopped
TimeoutSec=infinity

SendSIGKILL=no

[Install]
WantedBy=multi-user.target

# Built for ${project.name}-${project.version} (${project.name})


환경변수 파일을 작성한다. 이것도 마찬가지로 적당히 작성하면 된다.

password는 그냥 UUID 생성기로 하나 생성해서 박았다.

1
sudo nano /etc/default/minio
결과
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Set the hosts and volumes MinIO uses at startup
# The command uses MinIO expansion notation {x...y} to denote a
# sequential series.
#
# The following example covers four MinIO hosts
# with 4 drives each at the specified hostname and drive locations.
# The command includes the port that each MinIO server listens on
# (default 9000)

MINIO_VOLUMES="~/minio"

# Set all MinIO server options
#
# The following explicitly sets the MinIO Console listen address to
# port 9001 on all network interfaces. The default behavior is dynamic
# port selection.

MINIO_OPTS="--console-address :9001"

# Set the root username. This user has unrestricted permissions to
# perform S3 and administrative API operations on any resource in the
# deployment.
#
# Defer to your organizations requirements for superadmin user name.

MINIO_ROOT_USER=minioadmin

# Set the root password
#
# Use a long, random, unique string that meets your organizations
# requirements for passwords.

MINIO_ROOT_PASSWORD=minioadmin

# Set to the URL of the load balancer for the MinIO deployment
# This value *must* match across all MinIO servers. If you do
# not have a load balancer, set this value to to any *one* of the
# MinIO hosts in the deployment as a temporary measure.

MINIO_SERVER_URL=""


자동 실행 목록에 추가하고 실행한다.

1
2
3
4
sudo systemctl enable minio
sudo systemctl start minio

systemctl status minio
결과
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
● minio.service - MinIO
     Loaded: loaded (/lib/systemd/system/minio.service; enabled; preset: enabled)
     Active: active (running) since Sat 2024-11-23 23:17:46 KST; 8s ago
       Docs: https://docs.min.io
   Main PID: 402552 (minio)
      Tasks: 9
        CPU: 1.761s
     CGroup: /system.slice/minio.service
             └─402552 /usr/local/bin/minio server --console-address :9001 ~/minio

Nov 23 23:17:46 debian systemd[1]: Starting minio.service - MinIO...
Nov 23 23:17:46 debian systemd[1]: Started minio.service - MinIO.
Nov 23 23:17:46 debian minio[402552]: MinIO Object Storage Server
Nov 23 23:17:46 debian minio[402552]: Copyright: 2015-2024 MinIO, Inc.
Nov 23 23:17:46 debian minio[402552]: License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html
Nov 23 23:17:46 debian minio[402552]: Version: RELEASE.2024-11-07T00-52-20Z (go1.23.3 linux/amd64)
Nov 23 23:17:46 debian minio[402552]: API: http://127.0.0.1:9000
Nov 23 23:17:46 debian minio[402552]: WebUI: http://127.0.0.1:9001
Nov 23 23:17:46 debian minio[402552]: Docs: https://docs.min.io
Nov 23 23:17:46 debian minio[402552]: WARN: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO_ROOT_USER' and 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD' environment variables


참고

MiniO - MinIO Object Storage for Linux
MiniO - Configuring MinIO with SystemD
MiniO - Configure NGINX Proxy for MinIO Server

This post is licensed under CC BY 4.0 by the author.