一、基本信息
官网 https://min.io/
下载 https://min.io/download#/linux
文档 https://docs.min.io/
二、环境、工具说明
1、操作系统 Centos7.4 x64 Minimal 1708
内存 2G
CPU 1核
2、工具:xshell5
3、VMware 版本:VMware Workstation Pro15
三、安装部署
1、虚拟机安装
参考 https://hunter.blog.csdn.net/article/details/89328381
2、安装基本工具
[root@localhost ~]# yum install -y wget vim
3、创建目录
[root@localhost ~]# mkdir /opt/minio
[root@localhost ~]# mkdir /opt/minio/data
4、进入目录
[root@localhost ~]# cd /opt/minio
5、下载
[root@localhost ~]# wget https://dl.min.io/server/minio/release/linux-amd64/minio
6、赋权
[root@localhost ~]# chmod +x minio
7、防火墙开启 9000 端口
[root@localhost ~]# firewall-cmd --zone=public --add-port=9000/tcp --permanent
重启防火墙
[root@localhost ~]# systemctl restart firewalld
或者直接关闭防火墙 (安全条件允许的情况下)
8、启动服务
(1)控制台启动
[root@localhost ~]# /opt/minio/minio server /opt/minio/data/
扩展:
此处如果结合 httpd 搭建文件服务器,会有另一番体验
httpd环境搭建参考
https://hunter.blog.csdn.net/article/details/93907895
搭建完成之后,把 minio 服务启动的 data 目录改为 httpd 的指定目录即可
(2)后台守护启动
[root@localhost ~]# nohup /opt/minio/minio server /opt/minio/data/ &
(3)自定义端口
[root@localhost ~]# nohup /opt/minio/minio server 节点ip:指定端口 /opt/minio/data/ &
控制台启动详情如下:
详细信息如下:
AccessKey 和 SecretKey 是下一步浏览器登录的账号和密码
Endpoint: http://192.168.11.20:9000 http://127.0.0.1:9000
AccessKey: 4S12N3TBBCCOFRI73HMC
SecretKey: GBhI1fLXcWWgbbGVB7ZI63nmFuysYBNVF+OsgQJg
Browser Access:
http://192.168.11.20:9000 http://127.0.0.1:9000
Command-line Access: https://docs.min.io/docs/minio-client-quickstart-guide
$ mc config host add myminio http://192.168.11.20:9000 4S12N3TBBCCOFRI73HMC GBhI1fLXcWWgbbGVB7ZI63nmFuysYBNVF+OsgQJg
Object API (Amazon S3 compatible):
Go: https://docs.min.io/docs/golang-client-quickstart-guide
Java: https://docs.min.io/docs/java-client-quickstart-guide
Python: https://docs.min.io/docs/python-client-quickstart-guide
JavaScript: https://docs.min.io/docs/javascript-client-quickstart-guide
.NET: https://docs.min.io/docs/dotnet-client-quickstart-guide
9、浏览器查看
浏览器录入地址: http://(节点ip):9000
录入账号和密码
10、创建存储桶
创建成功的存储桶
11、在指定的存储桶中上传文件
上传的文件列表
12、查看文件链接
把链接放入浏览器地址栏,可直接查看详情
13、在控制台查看已上传的文件列表
[root@localhost ~]# ll /opt/minio/data/test/
14、下载、安装客户端
(1)进入目录
[root@localhost ~]# /opt/minio/
(2)下载客户端
[root@localhost minio]# wget https://dl.min.io/client/mc/release/linux-amd64/mc
(3)赋权
[root@localhost minio]# chmod +x mc
(4)查看说明
[root@localhost minio]# ./mc --help
NAME:
mc - MinIO Client for cloud storage and filesystems.
USAGE:
mc [FLAGS] COMMAND [COMMAND FLAGS | -h] [ARGUMENTS...]
COMMANDS:
ls list buckets and objects
mb make a bucket
rb remove a bucket
cp copy objects
mirror synchronize object(s) to a remote site
cat display object contents
head display first 'n' lines of an object
pipe stream STDIN to an object
share generate URL for temporary access to an object
find search for objects
sql run sql queries on objects
stat show object metadata
tree list buckets and objects in a tree format
du summarize disk usage folder prefixes recursively
diff list differences in object name, size, and date between two buckets
rm remove objects
event configure object notifications
watch listen for object notification events
policy manage anonymous access to buckets and objects
admin manage MinIO servers
session resume interrupted operations
config configure MinIO client
update update mc to latest release
version show version info
GLOBAL FLAGS:
--autocompletion install auto-completion for your shell
--config-dir value, -C value path to configuration folder (default: "/root/.mc")
--quiet, -q disable progress bar display
--no-color disable color theme
--json enable JSON formatted output
--debug enable debug output
--insecure disable SSL certificate verification
--help, -h show help
--version, -v print the version
TIP:
Use 'mc --autocompletion' to enable shell autocompletion
VERSION:
RELEASE.2019-08-14T20-49-49Z
(5)查看目录
[root@localhost minio]# ./mc ls
15、扩展 多种编程语言的 API 文档
Object API (Amazon S3 compatible):
Go: https://docs.min.io/docs/golang-client-quickstart-guide
Java: https://docs.min.io/docs/java-client-quickstart-guide
Python: https://docs.min.io/docs/python-client-quickstart-guide
JavaScript: https://docs.min.io/docs/javascript-client-quickstart-guide
.NET: https://docs.min.io/docs/dotnet-client-quickstart-guide
至此,Centos7 安装 Minio (文件服务器)操作完毕!希望对您能有所帮助!