生活在宁静的角落
Attachments
History
Blame
View Source
A - Z
Changelog
Documentation
About An Otter Wiki
Toggle dark mode
Login
Home
Menu
IT运维
MarkDown语法
It运维
Minio
440afc
Commit
440afc
2025-12-05 06:12:56
Terry
: -/-
it运维/minio.md
..
@@ 1,7 1,127 @@
# Minio
-
安装
+
## 安装
```
dpkg -i minio.deb
```
+
## 检查启动服务
+
+
检查文件:`/usr/lib/systemd/system/minio.service`
+
+
一般不用修改
+
+
```bash
+
[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
+
+
# Disable killing of MinIO by the kernel's OOM killer
+
OOMScoreAdjust=-1000
+
+
SendSIGKILL=no
+
+
[Install]
+
WantedBy=multi-user.target
+
+
# Built for ${project.name}-${project.version} (${project.name})
+
+
```
+
## 创建相关用户与文件夹
+
+
```bash
+
root@xxx# groupadd -r minio-user
+
root@xxx# useradd -M -r -g minio-user minio-user
+
root@xxx# mkdir /data/miniodat
+
root@xxx# chown minio-user:minio-user /data/miniodata/
+
```
+
+
## 创建环境变量文件
+
+
在 `/etc/default/minio` 创建环境变量文件
+
+
```shell
+
# 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=9piSt@J8BXoc6 # 设置密码
+
+
# MINIO_VOLUMES sets the storage volume or path to use for the MinIO server.
+
+
MINIO_VOLUMES="/data/miniodata" # 设置目录
+
+
# 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"
+
```
+
+
## 启动服务
+
+
在本地主机上发出以下命令来启动 MinIO SNSD 部署即服务:
+
```
+
systemctl start minio.service
+
```
+
+
使用以下命令确认服务是否在线和功能正常:
+
+
```
+
sudo systemctl status minio.service
+
journalctl -f -u minio.service
+
```
+
+
+
使用 `systemctl enable minio.service` 将进程作为主机引导的一部分,在服务器重启的过程中该进程会自动重启,而不用再进行手动管理。
+
```
+
systemctl enable minio.service
+
```
+
+
+
journalctl 的显示输出的样例如下面展示的内容:
+
+
```
+
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:9090 http://127.0.0.1:9090
+
RootUser: myminioadmin
+
RootPass: minio-secret-key-change-me
+
+
Command-line: https://minio.org.cn/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://minio.org.cn/docs/minio/linux/index.html
+
```
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9