前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >minio 对象存储 单机部署

minio 对象存储 单机部署

作者头像
Freedom123
发布2024-03-29 09:33:12
1230
发布2024-03-29 09:33:12
举报
文章被收录于专栏:DevOpsDevOps

一. 简介 Minio是Apache License v2.0下发布的对象存储服务器。它与Amazon S3云存储服务兼容。它最适合存储非结构化数据,如照片,视频,日志文件,备份和容器/ VM映像。对象的大小可以从几KB到最大5TB Minio服务器足够轻,可以与应用程序堆栈捆绑在一起,类似于NodeJS,Redis和MySQL。https://docs.minio.io/

二. 部署 1. 二进制部署

代码语言:javascript
复制
wget https://dl.minio.io/server/minio/release/linux-amd64/minio
chmod +x minio
./minio server /data
 
# use
# 启动后会打印出AccessKey和SecretKey等信息
./minio server /data/minio_oss_srv   
 
# 后台运行
nohup ./minio server /data/minio_oss_srv > /data/logs/minio/minio.log 2>&1 & 
 
# 自定义MINIO_ACCESS_KEY和MINIO_SECRET_KEY
export MINIO_ACCESS_KEY=minio
export MINIO_SECRET_KEY=miniostorage
./minio server /data/minio_oss_srv 
 
#自定义端口号
./minio server --address 101.121.115.159:9001 /data/minio_oss_srv

注意启动显示的 appkey secretkey是默认登录账户,密码

登陆:浏览器输入: http://ip:9000

2. Docker部

代码语言:javascript
复制
docker pull minio/minio
 
#在Docker中运行Minio单点模式
docker run -p 9000:9000 -e MINIO_ACCESS_KEY=sunseaiot -e MINIO_SECRET_KEY=sunseaiot minio/minio server /data
 
#要创建具有永久存储的Minio容器,您需要将本地持久目录从主机操作系统映射到虚拟配置~/.minio 并导出/data目录
#建立外挂文件夹 /Users/hbl/dockersp/volume/minio/
docker run -p 9000:9000 -e MINIO_ACCESS_KEY=sunseaiot -e 
MINIO_SECRET_KEY=sunseaiot -v /Users/hbl/dockersp/volume/minio/data:/data -v 
/Users/hbl/dockersp/volume/minio/config:/root/.minio minio/minio server /dat

登陆:浏览器输入: http://ip:9000 账户:sunseaiot 密码:sunseaiot

三. 操作 1. 上传文件 2. 创建/删除bucket

四. 启动服务文档

代码语言:javascript
复制
NAME:
  minio server - start object storage server
 
USAGE:
  minio server [FLAGS] DIR1 [DIR2..]
  minio server [FLAGS] DIR{1...64}
 
DIR:
  DIR points to a directory on a filesystem. When you want to combine
  multiple drives into a single large system, pass one directory per
  filesystem separated by space. You may also use a '...' convention
  to abbreviate the directory arguments. Remote directories in a
  distributed setup are encoded as HTTP(s) URIs.
 
FLAGS:
  --address value               bind to a specific ADDRESS:PORT, ADDRESS can be an IP or hostname (default: ":9000")
  --config-dir value, -C value  [DEPRECATED] Path to legacy configuration directory. (default: "/root/.minio")
  --certs-dir value, -S value   Path to certs directory. (default: "/root/.minio/certs")
  --quiet                       Disable startup information.
  --anonymous                   Hide sensitive information from logging.
  --json                        Output server logs and startup information in json format.
  --help, -h                    Show help.
  
ENVIRONMENT VARIABLES:
  ACCESS:
     MINIO_ACCESS_KEY: Custom username or access key of minimum 3 characters in length.
     MINIO_SECRET_KEY: Custom password or secret key of minimum 8 characters in length.
 
  BROWSER:
     MINIO_BROWSER: To disable web browser access, set this value to "off".
 
  CACHE:
     MINIO_CACHE_DRIVES: List of mounted drives or directories delimited by ";".
     MINIO_CACHE_EXCLUDE: List of cache exclusion patterns delimited by ";".
     MINIO_CACHE_EXPIRY: Cache expiry duration in days.
     MINIO_CACHE_MAXUSE: Maximum permitted usage of the cache in percentage (0-100).
 
  DOMAIN:
     MINIO_DOMAIN: To enable virtual-host-style requests, set this value to Minio host domain name.
 
  WORM:
     MINIO_WORM: To turn on Write-Once-Read-Many in server, set this value to "on".
 
  BUCKET-DNS:
     MINIO_DOMAIN:    To enable bucket DNS requests, set this value to Minio host domain name.
     MINIO_PUBLIC_IPS: To enable bucket DNS requests, set this value to list of Minio host public IP(s) delimited by ",".
     MINIO_ETCD_ENDPOINTS: To enable bucket DNS requests, set this value to list of etcd endpoints delimited by ",".
 
   KMS:
     MINIO_SSE_VAULT_ENDPOINT: To enable Vault as KMS,set this value to Vault endpoint.
     MINIO_SSE_VAULT_APPROLE_ID: To enable Vault as KMS,set this value to Vault AppRole ID.
     MINIO_SSE_VAULT_APPROLE_SECRET: To enable Vault as KMS,set this value to Vault AppRole Secret ID.
     MINIO_SSE_VAULT_KEY_NAME: To enable Vault as KMS,set this value to Vault encryption key-ring name.
 
EXAMPLES:
  1. Start minio server on "/home/shared" directory.
     $ minio server /home/shared
 
  2. Start minio server bound to a specific ADDRESS:PORT.
     $ minio server --address 192.168.1.101:9000 /home/shared
 
  3. Start minio server and enable virtual-host-style requests.
     $ export MINIO_DOMAIN=mydomain.com
     $ minio server --address mydomain.com:9000 /mnt/export
 
  4. Start erasure coded minio server on a node with 64 drives.
     $ minio server /mnt/export{1...64}
 
  5. Start distributed minio server on an 32 node setup with 32 drives each. Run following command on all the 32 nodes.
     $ export MINIO_ACCESS_KEY=minio
     $ export MINIO_SECRET_KEY=miniostorage
     $ minio server http://node{1...32}.example.com/mnt/export/{1...32}
 
  6. Start minio server with edge caching enabled.
     $ export MINIO_CACHE_DRIVES="/mnt/drive1;/mnt/drive2;/mnt/drive3;/mnt/drive4"
     $ export MINIO_CACHE_EXCLUDE="bucket1/*;*.png"
     $ export MINIO_CACHE_EXPIRY=40
     $ export MINIO_CACHE_MAXUSE=80
     $ minio server /home/shared
 
  7. Start minio server with KMS enabled.
     $ export MINIO_SSE_VAULT_APPROLE_ID=9b56cc08-8258-45d5-24a3-679876769126
     $ export MINIO_SSE_VAULT_APPROLE_SECRET=4e30c52f-13e4-a6f5-0763-d50e8cb4321f
     $ export MINIO_SSE_VAULT_ENDPOINT=https://vault-endpoint-ip:8200
     $ export MINIO_SSE_VAULT_KEY_NAME=my-minio-key
     $ minio server /home/shared
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2024-03-28,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
容器服务
腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档