CentOs上安装minio
MINIO安装
一、下载二进制文件
wget https://dl.minio.org.cn/server/minio/release/linux-amd64/minio
二、授权,并移动到指定目录
chmod +x minio
sudo mv minio /usr/local/bin/
二、创建服务文件
/usr/lib/systemd/system/minio.service
内容如下:
[Unit] Description=MinIO Documentation=https://minio.org.cn/docs/minio/linux/index.html Wants=network-online.target After=network-online.target AssertFileIsExecutable=/usr/local/bin/minio [Service] WorkingDirectory=/usr/local User=minio-user Group=minio-user 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_OPTS $MINIO_VOLUMES # MinIO RELEASE.2023-05-04T21-44-30Z adds support for Type=notify (https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=) # This may improve systemctl setups where other services use `After=minio.server` # Uncomment the line to enable the functionality # Type=notify # Let systemd restart this service always Restart=always # Specifies the maximum file descriptor number that can be opened by this process LimitNOFILE=65536 # 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})
三、创建用户和组
minio.service 文件默认以 minio-user 用户和组身份运行。 您可以使用 groupadd 和 useradd``命令创建用户和组. 以下示例创建用户、组并设置权限以访问MinIO预定用于存储的文件夹路径。 这些命令通常需要管理员 (``sudo) 权限。
groupadd -r minio-user
useradd -M -r -g minio-user minio-user
创建文件存储目录
mkdir /home/minio
给目录授权为刚创建的用户
chown minio-user:minio-user /home/minio
四、创建环境变量文件
/etc/default/minio
内容:
# 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=minioadmin MINIO_ROOT_PASSWORD=minioadmin # MINIO_VOLUMES sets the storage volume or path to use for the MinIO server. MINIO_VOLUMES="/home/minio" # MINIO_OPTS sets any additional commandline options to pass to the MinIO server. # 例如, `--console-address :9001` sets the MinIO Console listen port MINIO_OPTS="--address :9000 --console-address :9001" # MINIO_SERVER_URL sets the hostname of the local machine for use with the MinIO Server # MinIO assumes your network control plane can correctly resolve this hostname to the local machine # Uncomment the following line and replace the value with the correct hostname for the local machine and port for the MinIO server (9000 by default). #MINIO_SERVER_URL="http://minio.example.net:9000"
五、启动服务
sudo systemctl enable minio.service
sudo systemctl start minio.service
六、查询服务是否正常
sudo systemctl status minio.service
journalctl -f -u minio.service
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· [翻译] 为什么 Tracebit 用 C# 开发
· Deepseek官网太卡,教你白嫖阿里云的Deepseek-R1满血版
· 2分钟学会 DeepSeek API,竟然比官方更好用!
· .NET 使用 DeepSeek R1 开发智能 AI 客户端
· 刚刚!百度搜索“换脑”引爆AI圈,正式接入DeepSeek R1满血版