Preparation Before InstallationAfter CentOS has stopped maintenance, the official related repositories have been closed. You need to change the repository source. Please refer to the following articleCentOS 7 stops online updates, change yum to Vault sourceThe article uses Tsinghua’s source, but you can also change to Alibaba’s source according to your needs. Below is the method to change to Alibaba’s source; the original official source is no longer maintained, just copy and paste to overwrite.
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
yum clean all && yum makecache
Preparing the Installation Package<span>minio </span>
Download the installation package to /usr/local/soft, this address should be consistent with the address in the script file
<span>This script supports online downloading,</span><span> if the installation package is not prepared, ensure that the installation machine is properly connected to the internet</span>
Writing the Script Fileinstall_mysql.sh (CentOS version), the following is the content of the script file, please copy and save it as a script file.
#! /usr/bin/bash
## Fully automated source code compilation and installation for any version
if [ ! -d "/usr/local/soft" ]
then
echo "The folder does not exist, please create a new folder and place the installation package here"
exit
fi
# Download MinIO installation package
cd /usr/local/soft
if [ ! -f minio ]
then
wget https://dl.minio.org.cn/server/minio/release/linux-amd64/minio
fi
chmod +x minio
if [ -f /usr/local/minio/conf/minio.conf ]
then
rm -rf /usr/local/minio/conf/minio.conf
fi
mkdir /usr/local/minio
mkdir /usr/local/minio/conf
cd /usr/local/minio/conf
touch minio.conf
echo "MINIO_VOLUMES="/usr/local/minio/data"\nMINIO_OPTS="--address :9001"\nMINIO_ROOT_USER="admin"\nMINIO_ROOT_PASSWORD="admin@123" " >>minio.conf
cd /lib/systemd/system
if [ -f minio.service ]
then
rm -rf /lib/systemd/system/minio.service
fi
touch minio.service
echo "[Unit]\nDescription=MinIO\nDocumentation=https://docs.min.io\nWants=network-online.target\nAfter=network-online.target\nAssertFileIsExecutable=/usr/local/soft/minio\n[Service]\nUser=root\nGroup=root\nWorkingDirectory=/usr/local/soft\nEnvironmentFile=/usr/local/minio/conf/minio.conf\nExecStart=/usr/local/soft/minio server $MINIO_OPTS $MINIO_VOLUMES\nRestart=always\nLimitNOFILE=65536\nTimeoutStopSec=infinity\nSendSIGKILL=no\n[Install]\nWantedBy=multi-user.target" >>minio.service
# Set to start on boot
systemctl daemon-reload
systemctl enable minio.service
systemctl start minio.service
Note that after installation, the default account is admin and the default password is admin@123. If installing a different version, you need to modify the filename in the script to the prepared filename.
The written script file should be placed in /usr/local/soft (if modified, please use your own file path) for execution (it can actually be placed elsewhere, but without the installation package, it can only be placed in /usr/local/soft), and remember to set permissions.
Technical accumulation, meeting is fate
