Centos 7 安装Minio

创建目录

mkdir -p /data/minio/data

下载

cd /data/minio
wget https://dl.minio.io/server/minio/release/linux-amd64/minio

添加执行权限

chmod +x minio

编辑配置文件

vim /etc/default/minio

MINIO_ROOT_USER="admin"
MINIO_ROOT_PASSWORD="admin123"
MINIO_VOLUMES="/data/minio/data"
MINIO_OPTS="--address 0.0.0.0:9000"
MINIO_OPTS1="--console-address 0.0.0.0:19001"

设置开机启动

vim /etc/systemd/system/minio.service

[Unit]
Description=MinIO
Documentation=https://docs.min.io
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/data/minio/minio

[Service]
WorkingDirectory=/data/minio
ProtectProc=invisible

EnvironmentFile=/etc/default/minio
ExecStartPre=/bin/bash -c "if [ -z \"${MINIO_VOLUMES}\" ]; then echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\"; exit 1; fi"
ExecStart=/data/minio/minio server --address 0.0.0.0:9000 $MINIO_OPTS  $MINIO_OPTS1 $MINIO_VOLUMES

# Let systemd restart this service always
Restart=always

# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536

# Specifies the maximum number of threads this process can create
TasksMax=infinity

# Disable timeout logic and wait until process is stopped
TimeoutStopSec=infinity
SendSIGKILL=no

[Install]
WantedBy=multi-user.target
加载配置
systemctl daemon-reload

启动minio

systemctl start minio.service

开启开机自启

systemctl enable minio.service

登陆测试

http://ip:19001/login

docker安装minio

新建容器挂载目录

mkdir -p /data/minio/data

拉取镜像

docker pull quay.io/minio/minio

启动minio容器

docker run -d \
  -p 9000:9000 \
  -p 9001:9001 \
  --name minio \
  -v /data/minio/data:/data \
  -e "MINIO_ROOT_USER=admin" \
  -e "MINIO_ROOT_PASSWORD=admin12345" \
  quay.io/minio/minio server /data --console-address ":9001"

访问

http://ip:9001

你可能感兴趣的:(centos,linux,bash)