sh 我用于IBM的分布式minio集群的安装后脚本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 我用于IBM的分布式minio集群的安装后脚本相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env bash

installerlog="$HOME/install.log"
touch "$installerlog"

## Update system and install btrfs tools
sys_update() {
apt update
apt upgrade -y
apt install -y btrfs-tools

} >> "$installerlog" 2>&1


## Create btrfs filesystem, mount it and update fstab
setup_btrfs() {
mkfs.btrfs /dev/xvdc /dev/xvde /dev/xvdf /dev/xvdg -f

mkdir /storage
mount /dev/xvdc /storage

btuuid=$(lsblk --fs /dev/xvdc | grep -v UUID | awk '{print $3}')

echo "UUID=$btuuid /storage   btrfs  defaults 0 0" | sudo tee --append /etc/fstab
} >> "$installerlog" 2>&1

## Install minio binary and create default files
setup_minio() {
wget -O /usr/local/bin/minio https://dl.minio.io/server/minio/release/linux-amd64/minio
chmod +x /usr/local/bin/minio

cat <<EOT >> /etc/default/minio
# Local export path.
MINIO_VOLUMES=http://m1.example.com/storage http://m2.example.com/storage http://m3.example.com/storage http://m4.example.com/storage
MINIO_OPTS="-C /etc/minio"
MINIO_ACCESS_KEY=YOUR_ACCESS_KEY
MINIO_SECRET_KEY=YOUR_SECRET_KEY

EOT

wget -O /etc/systemd/system/minio.service https://raw.githubusercontent.com/minio/minio-service/master/linux-systemd/distributed/minio.service

useradd -r minio-user -s /sbin/nologin
chown minio-user:minio-user /usr/local/bin/minio
chown minio-user:minio-user /storage

mkdir /etc/minio
chown minio-user:minio-user /etc/minio

systemctl enable minio.service
} >> "$installerlog" 2>&1

sys_update
setup_btrfs
setup_minio

sleep 60 && shutdown -r now

以上是关于sh 我用于IBM的分布式minio集群的安装后脚本的主要内容,如果未能解决你的问题,请参考以下文章

minio分布式集群安装部署实战详细手册

minio分布式集群安装部署实战详细手册

minio分布式集群安装部署实战详细手册

离线安装minio集群(篇幅一)

Minio 文件服务分布式集群部署

MinIO 分布式集群搭建