停止、重启minio脚本
1. 停止minio脚本stopMinio.sh
#!/bin/bash
echo "Stopping minio"
pid=`ps -ef | grep 'minio server' | grep -v grep | awk '{print $2}'`
if [ -n "$pid" ]
then
kill -9 $pid
fi
echo "Stop Success!"
2. 重启minio脚本reStartMinio.sh
#!/bin/bash
MINIO_DIR='/usr/XXX'
DATA_DIR=$MINIO_DIR'/minioData'
LOG_DIR=$DATA_DIR'/minio.log'
MINIO_ACCESS_KEY='账号'
MINIO_SECRET_KEY='密码'
STOP=$MINIO_DIR'/stopMinio.sh'
SERVER_PORT='8084'
CONSOLE_PORT='8083'
$STOP
export MINIO_ACCESS_KEY=$MINIO_ACCESS_KEY
export MINIO_SECRET_KEY=$MINIO_SECRET_KEY
# 重启服务
source /etc/profile
nohup $MINIO_DIR/minio server --address 0.0.0.0:$SERVER_PORT --console-address 0.0.0.0:$CONSOLE_PORT $DATA_DIR > $LOG_DIR 2>&1 &
echo "Start Success!"
注意自己的minio目录、minio数据目录和minio日志路径