minio在Linux上单机安装

1.下载二进制程序

# 下载二进制程序
wget https://dl.minio.org.cn/server/minio/release/linux-amd64/minio
# 增加执行权限
chmod +x minio
# 将程序文件移动到指定目录
sudo mv minio /usr/local/bin/

注意:下载最新的二进制程序可能和你的Linux系统内核不匹配

2.创建systemd服务文件

.deb或软件包.rpm将以下systemd服务文件安装到 /etc/systemd/system/minio.service。对于二进制安装,在所有 MinIO 主机上手动创建此文件:

[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio

[Service]
WorkingDirectory=/usr/local

User=root
Group=root
ProtectProc=invisible

EnvironmentFile=-/etc/default/minio
ExecStartPre=/bin/bash -c "if [ -z \"${MINIO_VOLUMES}\" ]; then echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\"; exit 1; fi"
ExecStart=/usr/local/bin/minio server $MINIO_P $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

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

# Disable timeout logic and wait until process is stopped
TimeoutStopSec=infinity
SendSIGKILL=no

[Install]
WantedBy=multi-user.target

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

注意:其中的用户和组都设置的是root,官方推荐为minio单独创建用户,这里为了简便就没这么做

3.创建环境变量文件

创建一个环境变量文件在/etc/default/minio

# 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="/opt/minio/data"

# 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 :9998"
MINIO_P="--address :9997"

# 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.

# root用户名
MINIO_ROOT_USER=minioadmin

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

# root用户密码
MINIO_ROOT_PASSWORD=123qweasd

# 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="http://minio:9500"

4.启动minio服务

# 启动服务
sudo systemctl start minio.service

# 查看服务状态
sudo systemctl status minio.service
journalctl -f -u minio.service

启动成功后journalctl命令会查看到如下输出

Apr 07 10:40:20 iZ2ze6wqqqhhr17q9nfjzcZ systemd[1]: Started MinIO.
Apr 07 10:40:20 iZ2ze6wqqqhhr17q9nfjzcZ minio[2814]: WARNING: Detected Linux kernel version older than 4.0.0 release, there are some known potential performance problems with this kernel version. MinIO recommends a minimum of 4.x.x linux kernel version for best performance
Apr 07 10:40:20 iZ2ze6wqqqhhr17q9nfjzcZ minio[2814]: Automatically configured API requests per node based on available memory on the system: 125
Apr 07 10:40:20 iZ2ze6wqqqhhr17q9nfjzcZ minio[2814]: Finished loading IAM sub-system (took 0.1s of 0.1s to load data).
Apr 07 10:40:20 iZ2ze6wqqqhhr17q9nfjzcZ minio[2814]: Status:         1 Online, 0 Offline.
Apr 07 10:40:20 iZ2ze6wqqqhhr17q9nfjzcZ minio[2814]: API: http://172.30.88.171:9997  http://127.0.0.1:9997
Apr 07 10:40:20 iZ2ze6wqqqhhr17q9nfjzcZ minio[2814]: Console: http://172.30.88.171:9998 http://127.0.0.1:9998
Apr 07 10:40:20 iZ2ze6wqqqhhr17q9nfjzcZ minio[2814]: Documentation: https://docs.min.io
Apr 07 10:40:21 iZ2ze6wqqqhhr17q9nfjzcZ minio[2814]: You are running an older version of MinIO released 9 months ago
Apr 07 10:40:21 iZ2ze6wqqqhhr17q9nfjzcZ minio[2814]: Update: Run `mc admin update`
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值