系统相关
首页 > 系统相关> > Windows安装Minio

Windows安装Minio

作者:互联网

Windows安装Minio

创建D:\minio,在D:\minio\中创建install-minio.ps1,修改MINIO_ROOT_USER和MINIO_ROOT_PASSWORD

#Check script run as administrator
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }

Set-Location -Path $PSScriptRoot

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri "https://dl.min.io/server/minio/release/windows-amd64/minio.exe" -OutFile "minio.exe"
Invoke-WebRequest -Uri "https://github.com/winsw/winsw/releases/download/v2.11.0/WinSW.NET4.exe" -OutFile "minio-service.exe"

$config = @'
<service>
  <id>minio</id>
  <name>minio</name>
  <description>MinIO is a high performance object storage server</description>
  <executable>minio.exe</executable>
  <env name="MINIO_ROOT_USER" value="admin"/>
  <env name="MINIO_ROOT_PASSWORD" value="your_password"/>
  <arguments>server D:\minio</arguments>
  <logmode>rotate</logmode>
</service>
'@

Set-Content "minio-service.xml" $config

Start-Process -WorkingDirectory $PSScriptRoot -FilePath "$($PSScriptRoot)\minio-service.exe" -ArgumentList "install" -NoNewWindow -PassThru -Wait

Write-Host "Installation done"

以administrator角色打开powershell,进入到D:\minio\,执行install-minio.ps1

cd D:\minio\
./install-minio.ps1

启动

net start minio

浏览器览器打开minio

http://127.0.0.1:9000

如果不需要minio后,

停止

net stop minio

删除minio service

./minio-service.exe uninstall

标签:exe,Minio,service,Windows,install,PSScriptRoot,ps1,安装,minio
来源: https://blog.csdn.net/engchina/article/details/122519519