Linux 命令安装minio
1.建个目录,进入目录
[root@ebs-63652 ~]# cd /opt [root@ebs-63652 opt]# mkdir minio [root@ebs-63652 opt]# cd minio
2.wegt命令下载安装包,安装完成后在minio文件夹中会生成一个minio文本文件
[root@ebs-63652 minio]# wget https://dl.min.io/server/minio/release/linux-amd64/minio --2022-09-29 16:54:56-- https://dl.min.io/server/minio/release/linux-amd64/minio Resolving dl.min.io (dl.min.io)... 138.**.**.125, 178.**.**.202 Connecting to dl.min.io (dl.min.io)|138.**.**.125|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 102023168 (97M) [application/octet-stream] Saving to: ‘minio’ 100%[=====================================================================================================>] 102,023,168 3.35MB/s in 30s 2022-09-29 16:55:27 (3.21 MB/s) - ‘minio’ saved [102023168/102023168]
3.进入minio文件夹,创建日志文件minio.log
[root@ebs-63652 minio]# touch minio.log
4.赋予minio文件权限
[root@ebs-63652 minio]# chmod 777 minio [root@ebs-63652 minio]# ll total 99636 -rwxrwxrwx 1 root root 102023168 Sep 26 12:32 minio -rw-r--r-- 1 root root 0 Sep 29 16:57 minio.log
5.启动minio
[root@ebs-63652 minio]# ./minio server /opt/minio/data
爆红的地方第二个警告:检测到默认凭据“minioadmin:minioadmin”,我们建议您使用“MINIO_ROOT_USER”和“MINIO_ROOT_PASSWORD”环境变量更改这些值。
所以我们按照提示修改
[root@ebs-63652 minio]# export MINIO_ROOT_USER=fileadmin [root@ebs-63652 minio]# export MINIO_ROOT_PASSWORD=fileadmin
6.重新启动minio
[root@ebs-63652 minio]# ./minio server /opt/minio/data
第二个警告消失了。
但是我们使用ip:port登录访问不了,那就看第7步
7.修改环境变量
[root@ebs-63652 minio]# vi /etc/profile
增加两行代码,重新设置用户名密码
export MINIO_ROOT_USER=fileadmin
export MINIO_ROOT_PASSWORD=fileadmin
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL # By default, we want umask to get set. This sets it for login shell # Current threshold for system reserved uid/gids is 200 # You could check uidgid reservation validity in # /usr/share/doc/setup-*/uidgid file if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then umask 002 else umask 022 fi for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do if [ -r "$i" ]; then if [ "${-#*i}" != "$-" ]; then . "$i" else . "$i" >/dev/null fi fi done unset i unset -f pathmunge export MINIO_ROOT_USER=fileadmin --增加这两行 export MINIO_ROOT_PASSWORD=fileadmin --增加这两行
8.重新启动minio。
[root@ebs-63652 minio]# ./minio server /opt/minio/data 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 MinIO Object Storage Server Copyright: 2015-2022 MinIO, Inc. License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html> Version: RELEASE.2022-09-25T15-44-53Z (go1.18.6 linux/amd64) Status: 1 Online, 0 Offline. API: http://192.168.**.57:9000 http://211.**.**.57:9000 http://172.**.0.1:9000 http://127.0.0.1:9000 RootUser: fileadmin RootPass: fileadmin Console: http://192.168.**.57:38560 http://211.**.**.57:38560 http://172.**.0.1:38560 http://127.0.0.1:38560 RootUser: fileadmin RootPass: fileadmin Command-line: https://docs.min.io/docs/minio-client-quickstart-guide $ mc alias set myminio http://192.**.**.57:9000 fileadmin fileadmin Documentation: https://docs.min.io
安全组放开端口35555,访问网址http://211.**.**.57:3555,会发现每次重启minio,端口会变。所以看9
9.在minio文件夹下新建start.sh文件。复制以下命令
nohup /opt/minio/minio server /opt/minio/data --console-address ":35555" > /opt/minio/minio.log 2>&1 &
10.脚本启动minio
[root@ebs-63652 minio]# sh start.sh
本文原创,转载必追究版权。