minio单节点搭建

  • 1.初始化工作
#.1.配置dns并安装基础软件
sed -i 's/^nameserver.*/nameserver 223.5.5.5/g' /etc/resolv.conf
cat /etc/resolv.conf | grep "^nameserver" > /dev/null || echo "nameserver 223.5.5.5" > /etc/resolv.conf
yum install -y -q curl wget ntp ntpdate lrzsz telnet zip unzip net-tools

#.2.修改时区并同步时间
timedatectl set-timezone Asia/Shanghai
/usr/sbin/ntpdate -u ntp.aliyun.com

#.3.建议禁用firewalld否则重启后需要iptable -F清除防火墙策略
/usr/sbin/iptables -F
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service

#.4.建议关闭selinux否则会限制服务
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
setenforce 0
  • 2.下载 minio 2023-06-29
mkdir -p /data/minio_9000/{data,logs}
curl -L http://iso.sqlfans.cn/linux/minio.2023-06-29 -o /data/minio_9000/minio
chmod +x /data/minio_9000/minio
  • 3.配置启停脚本
cat >/data/minio_9000/start.sh<<EOF
#!/bin/bash
export MINIO_ROOT_USER=minioadmin
export MINIO_ROOT_PASSWORD=Admin_147

pid=\$(ps -ef | grep minio | grep -v grep | wc -l)
if [ \$pid -eq 1 ]; then ps -ef | grep minio | grep -v grep | awk '{print \$2}' | xargs kill -9 2> /dev/null; fi

nohup /data/minio_9000/minio server /data/minio_9000/data --console-address=":9100" > /data/minio_9000/logs/minio.log 2>&1 &
EOF

chmod +x /data/minio_9000/start.sh
cat /data/minio_9000/start.sh | awk 'BEGIN{ RS=" "; } { print $1 }' | grep http
  • 4.启动minio(9000即刻监听,而9100待所有节点启动后才被监听)
sh /data/minio_9000/start.sh
netstat -lnpt | grep minio
  • 5.添加到开机启动
cat /etc/rc.local | grep minio || echo "sh /data/minio_9000/start.sh" >> /etc/rc.local
  • 6.登录 minio 页面控制台,示例 http://10.30.3.231:9100
地址:http://10.30.3.231:9100
账号:minioadmin
密码:Admin_147
Copyright © www.sqlfans.cn 2024 All Right Reserved更新时间: 2024-04-10 11:18:20

results matching ""

    No results matching ""