http://dl.minio.org.cn/server/minio/release/
https://blog.csdn.net/qq_39218530/article/details/107839487
[root@localhost minio]# wget dl.minio.org.cn/server/minio/release/linux-amd64/minio
--2021-01-22 22:01:14-- http://dl.minio.org.cn/server/minio/release/linux-amd64/minio
Resolving dl.minio.org.cn (dl.minio.org.cn)... 112.30.175.222, 112.30.175.218, 36.158.224.38, ...
Connecting to dl.minio.org.cn (dl.minio.org.cn)|112.30.175.222|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 50479104 (48M) [application/octet-stream]
Saving to: ‘minio’
100%[========================================================================================================================>] 50,479,104 4.72MB/s in 8.4s
2021-01-22 22:01:23 (5.75 MB/s) - ‘minio’ saved [50479104/50479104]
2)添加可执行权限
[root@localhost minio]# chmod +x minio
3)启动minio
[root@localhost minio]# ./minio server /data
Endpoint: http://192.168.0.105:9000 http://127.0.0.1:9000
RootUser: minioadmin
RootPass: minioadmin
Browser Access:
http://192.168.0.105:9000 http://127.0.0.1:9000
Command-line Access: https://docs.min.io/docs/minio-client-quickstart-guide
$ mc alias set myminio http://192.168.0.105:9000 minioadmin minioadmin
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
Detected default credentials 'minioadmin:minioadmin', please change the credentials immediately using 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD'
4)文件存放位置
cd /进入主目录
[root@localhost home]# pwd
/data/home
# 下载 minio
wget http://dl.minio.org.cn/server/minio/release/linux-amd64/minio
# 添加可执行权限
chmod +x minio
# 设置登录minio的 access key
export MINIO_ACCESS_KEY=minioadmin
# 设置登录minio的 secret key
export MINIO_SECRET_KEY=minioadmin
# 启动 minio
./minio server /data
ctrl+backspace 删除
cat > getonly.json << EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:ListAllMyBuckets", // 查看所有的“桶”列表
"s3:ListBucket", // 查看桶内的对象列表
"s3:GetBucketLocation",
"s3:GetObject", // 下载对象
"s3:PutObject", // 上传对象
"s3:DeleteObject" // 删除对象
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::*"
],
"Sid": ""
}
]
}
EOF
mc config host add minio http://192.168.1.11 user1 user1234 --api s3v4
[root@localhost ~]# cd minio/
[root@localhost minio]# ll
total 68516
-rw-r--r--. 1 root root 506 Feb 6 11:43 getonly.json
-rwxr-xr-x. 1 root root 19677184 Jan 16 10:47 mc
-rwxr-xr-x. 1 root root 50479104 Jan 9 05:22 minio
[root@localhost minio]# ./mc ls minio
[2021-01-24 12:53:26 CST] 0B 0124/
[2021-01-23 21:06:31 CST] 0B demo-bucket/
[2021-01-22 22:19:41 CST] 0B home/
[2021-01-24 12:31:57 CST] 0B sub/
[root@localhost minio]# ./mc ls
[2021-02-06 11:43:27 CST] 506B getonly.json
[2021-01-16 10:47:25 CST] 19MiB mc
[2021-01-09 05:22:10 CST] 48MiB minio
[root@localhost minio]# ./mc ls minio
[2021-01-24 12:53:26 CST] 0B 0124/
[2021-01-23 21:06:31 CST] 0B demo-bucket/
[2021-01-22 22:19:41 CST] 0B home/
[2021-01-24 12:31:57 CST] 0B sub/
[root@localhost minio]# ./mc admin policy add minio getonly getonly.json
mc: <ERROR> Unable to parse the input policy: invalid character '/' looking for beginning of value.
[root@localhost minio]# vim getonly.json
[root@localhost minio]# ./mc admin policy add minio getonly getonly.json
Added policy `getonly` successfully.
[root@localhost minio]# mc admin user add minio newuser newuser123
bash: mc: command not found...
[root@localhost minio]# /.mc admin user add minio newuser newuser123
-bash: /.mc: No such file or directory
[root@localhost minio]# ./mc admin user add minio newuser newuser123
Added user `newuser` successfully.
[root@localhost minio]# ./mc admin policy set minio getonly user=newuser
Policy getonly is set on user `newuser`
[root@localhost minio]# ./mc admin group add minio newgroup newuser
Added members {newuser} to group newgroup successfully.
[root@localhost minio]# ./mc admin policy set minio getonly group=newgroup
Policy getonly is set on group `newgroup`
[root@localhost minio]# ./mc admin user disable minio newuser
Disabled user `newuser` successfully.
[root@localhost minio]# ./mc admin group disable myminio newgroup
mc: <ERROR> Unable to initialize admin connection. No valid configuration found for 'myminio' host alias.
[root@localhost minio]# ./mc admin group disable minio newgroup
Disabled group `newgroup` successfully.
[root@localhost minio]# ./mc admin user list minio
disabled newuser getonly
[root@localhost minio]# ./mc admin user enable minio newuser
Enabled user `newuser` successfully.
[root@localhost minio]# ./mc admin group enable minio newgroup
Enabled group `newgroup` successfully.
minio己经上传的文件怎么修改其文件名呢?
在web管理界面下修改吗?
另外我们见过的很多对象存储中,一旦上传了就不让修改名称的。
请了解。
上传的时候,可以在本地映射一个表,对应MinIO中的文件名。如果要重命名,让前端业务系统中的名字发生变化。
但是,后端的实际使用的key 不要变。
[root@localhost minio]# wget http://dl.minio.org.cn/client/mc/release/linux-amd64/mc
--2021-02-12 11:34:42-- http://dl.minio.org.cn/client/mc/release/linux-amd64/mc
Resolving dl.minio.org.cn (dl.minio.org.cn)... 111.48.29.241, 111.48.32.239, 111.48.28.203, ...
Connecting to dl.minio.org.cn (dl.minio.org.cn)|111.48.29.241|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 19677184 (19M) [application/octet-stream]
Saving to: ‘mc’
100%[========================================================================================================================>] 19,677,184 2.40MB/s in 7.8s
2021-02-12 11:34:50 (2.41 MB/s) - ‘mc’ saved [19677184/19677184]
[root@localhost minio]# chmod +x mc
[root@localhost minio]# ./mc config host add minio http://192.168.1.11:9000 minioadmin minioadmin --api s3v4
Added `minio` successfully.
[root@localhost minio]# ./mc ls minio
[2021-02-12 11:26:58 CST] 0B cattle/
[root@localhost minio]#
cat > getonly.json << EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:ListAllMyBuckets",
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::*"
],
"Sid": ""
}
]
}
EOF