1.手动启动
MINIO_ROOT_USER=akim MINIO_ROOT_PASSWORD=abc_123 ./minio server /opt/minio/data --console-address :9003 --address :9002 ## /opt/minio/data
存储目录;--console-address 是 UI 界面的端口 --address 是api端口
2.开机自启动
1.在minio根目录下新建start.sh:
#!/bin/bash
ROOT_DIR=/opt/minio
export MINIO_ROOT_USER=akim
export MINIO_ROOT_PASSWORD=akim_123app
nohup $ROOT_DIR/minio server $ROOT_DIR/data --address=":9002" --console-address=":9003" &
echo $(ps -ef|grep "minio server"|grep -v "grep"|awk '{print $2}') > /var/run/minio_9002.pid
2.进入init.d目录
cd /etc/init.d
3.创建服务文件
vim nginx
4.编写脚本
#!/bin/bash
### BEGIN INIT INFO
# Provides: minio_9002
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: minio service
# Description: minio service
### END INIT INFO
EXEC=/opt/minio/start.sh
PIDFILE=/var/run/minio_9002.pid
case "$1" in
start)
if [ -f $PIDFILE ]
then
echo "$PIDFILE exists, process is already running or crashed"
else
echo "Starting Minio Service..."
sh $EXEC
fi
;;
stop)
if [ ! -f $PIDFILE ]
then
echo "$PIDFILE does not exist, process is not running"
else
PID=$(cat $PIDFILE)
echo "Stopping Minio Service..."
kill -9 $PID
rm -rf $PIDFILE
echo "Minio stopped"
fi
;;
*)
echo "Please use start or stop as first argument"
;;
esac
exit 0
5.修改文件权限:
chmod 777 minio
6.添加或删除服务
添加:
chkconfig --add minio
删除:
chkconfig --del minio
7.启动、停止或重启服务
启动:
service minio start
停止:
service minio stop
重启:
service minio restart
8.设置开启或关闭开机启动
开启:
chkconfig minio on
关闭:
chkconfig minio off
9.查看es进程,验证是否已启动
ps -ef | grep minio
#打开页面访问登录成功即可
http://localhost:9003
注意事项:
1.项目集成minio,使用的端口是--address的9002而不是console-address的9003
2.AccessKey和SecretKey的查看方式:
在minio管理界面的Identity菜单下,找到Users菜单,点击右边的Create Users,录入账号、密码和勾选权限,保存后来到列表,选择刚才创建的账号点击进去,在左边选择Service Accounts选项卡,点击右边Create service account,进入创建界面,点击Create按钮完成,最后显示AccessKey和SecretKey,还可以下载下来
文章评论