一、安装minio客户端mc
1、下载二进制文件
wget https://dl.min.io/client/mc/release/linux-amd64/mc
2、赋予可执行权限
chmod +x mc
二、mc admin heal
1、查询admin heal命令说明
[root@minio-1 minio]# ./mc admin heal
NAME:
mc admin heal - heal disks, buckets and objects on MinIO server
USAGE:
mc admin heal [FLAGS] TARGET
FLAGS:
--scan value select the healing scan mode (normal/deep) (default: "normal")
--recursive, -r heal recursively
--dry-run, -n only inspect data, but do not mutate
--force-start, -f force start a new heal sequence
--force-stop, -s Force stop a running heal sequence
--remove remove dangling objects in heal sequence
--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
SCAN MODES:
normal (default): Heal objects which are missing on one or more disks.
deep : Heal objects which are missing or with silent data corruption on one or more disks.
EXAMPLES:
\1. To format newly replaced disks in a MinIO server with alias 'myminio'
$ mc admin heal myminio
\2. Heal 'testbucket' in a MinIO server with alias 'myminio'
$ mc admin heal myminio/testbucket/
\3. Heal all objects under 'dir' prefix
$ mc admin heal --recursive myminio/testbucket/dir/
\4. Issue a dry-run heal operation to inspect objects health but not heal them
$ mc admin heal --dry-run myminio
\5. Issue a dry-run heal operation to inspect objects health under 'dir' prefix
$ mc admin heal --recursive --dry-run myminio/testbucket/dir/
\6. Force start a running heal sequence (meaning it will force kill the running heal sequence and start a new one)
$ mc admin heal --force-start myminio/testbucket/dir/
\7. Force stop a running heal sequence (meaning it will force kill the running heal sequence)
$ mc admin heal --force-stop myminio/testbucket/dir/
\8. Issue a dry-run heal operation to inspect objects health under 'dir' prefix
$ mc admin heal --dry-run myminio/testbucket/dir/
1、config
set +o history
./mc config host add myminio http://10.0.0.1:9000 you_appkey you_secretkey
set -o history
2、admin
递归修复test1存储桶和及其里面的对象
./mc admin heal -r myminio/test1
递归修复files存储桶和及其里面的对象
./mc admin heal -r myminio/files