Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Install Setup [running on ubuntu 16.04]

1. Install go 1.7.5

sudo apt-get install git 
wget https://storage.googleapis.com/golang/go1.7.5.linux-amd64.tar.gz
tar -C ${HOME} -xzf go1.7.5.linux-amd64.tar.gz

Add the following exports to your ~/.bashrc.

export GOROOT=${HOME}/go
export GOPATH=${HOME}/work
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

Source the new environment

source ~/.bashrc

Testing it all

go version
go version go1.7.5 linux/amd64

2. Install Minio and Minio Client

Minio:

go get -u github.com/minio/minio
cd $GOPATH/src/github.com/minio/minio
go install 

Minio Client

go get -u github.com/minio/mc
cd $GOPATH/src/github.com/minio/mc
go install 

3. Start Minio server [This is a test purpose setup, not recomemnded for anything else.]

minio server ~/data1 ~/data2 ~/data3 ~/data4
Initializing data volume.
[01/04] /home/ubuntu/data1 - 7.0 GiB online
[02/04] /home/ubuntu/data2 - 7.0 GiB online
[03/04] /home/ubuntu/data3 - 7.0 GiB online
[04/04] /home/ubuntu/data4 - 7.0 GiB online

Endpoint:  http://192.168.86.140:9000  http://127.0.0.1:9000
AccessKey: PDRME539X2A6SR1MKTL6 
SecretKey: cQlPVKB9BxQMmLpN3ya8SsBmOkhfTAxd0DXDacwz 
Region:    us-east-1
SQS ARNs:  <none>

Browser Access:
   http://192.168.86.140:9000  http://127.0.0.1:9000

Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide
 
    mc config host add myminio http://127.0.0.1:9000 PDRME539X2A6SR1MKTL6 cQlPVKB9BxQMmLpN3ya8SsBmOkhfTAxd0DXDacwz

4. Setup Minio Client configuration.

4.1 Add host alias [This might be different in your setup]

mc config host add myminio http://127.0.0.1:9000 PDRME539X2A6SR1MKTL6 cQlPVKB9BxQMmLpN3ya8SsBmOkhfTAxd0DXDacwz

4.2 Add a bucket

mc mb myminio/bucket1

4.3 Add object to bucket

mc cp linux-amd64.tar.gz myminio/bucket1

4.4 Minio Heal Command

Note: In our example

::Disc/Data Directories are::

/home/ubuntu/data1
/home/ubuntu/data2
/home/ubuntu/data3
/home/ubuntu/data4

::Bucket is::

bucket1

::Object inside bucket 1 is::

linux-amd64.tar.gz

Scenario 1: Heal an object.

mc ls myminio/bucket1
[2017-03-24 13:24:25 IST]  80MiB linux-amd64.tar.gz

Now let us remove object "linux-amd64.tar.gz" from "/home/ubuntu/data1".

$ ls data1/bucket1/
linux-amd64.tar.gz
$ rm -r data4/bucket1/linux-amd64.tar.gz
$ ls data1/bucket1/ [Because object is deleted]

$ mc admin heal myminio/bucket1
Object bucket1/linux-amd64.tar.gz is healed.
$ ls data1/bucket1/
linux-amd64.tar.gz

Scenario 2:Heal a bucket.

 mc ls myminio/bucket1
[2017-03-24 13:24:25 IST]  80MiB linux-amd64.tar.gz

Remove the bucket name "bucket1" forcefully from ''data1`` disc.

$ ls data1/bucket1/
linux-amd64.tar.gz
$ rm -r data1/bucket1/
$ ls data1/
$ mc admin heal myminio/bucket1
Object bucket1/linux-amd64.tar.gz is healed.
$ mc ls myminio
[2017-03-24 18:54:25 IST]     0B bucket1/

Heal the disk

$ rm -r data1/
$ mc admin heal myminio  [This will bring back data1 disc]

heal bucket and objects on data1 disk.

$ mc admin heal  -r myminio/
Object: bucket1/linux-amd64.tar.gz, can be healed.

For more usage information run command below to your terminal :

$ mc admin heal 
@bweston92

This comment has been minimized.

Copy link

commented Apr 4, 2017

👍

@rusher81572

This comment has been minimized.

Copy link

commented Apr 15, 2017

I am getting the following error:

root@rpi-1:~/.minio# /mc admin heal linuxtoys --debug
mc: POST /?heal= HTTP/1.1
Host: linux-toys.com:8000
User-Agent: Minio (linux; arm) madmin-go/0.0.1 mc/DEVELOPMENT.GOGET
Content-Length: 0
Authorization: AWS4-HMAC-SHA256 Credential=REDACTED/20170415/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-minio-operation, Signature=REDACTED
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20170415T024740Z
X-Minio-Operation: format
Accept-Encoding: gzip

mc: HTTP/1.1 500 Internal Server Error
Transfer-Encoding: chunked
Accept-Ranges: bytes
Content-Type: application/xml
Date: Sat, 15 Apr 2017 02:47:43 GMT
Server: Minio/DEVELOPMENT.GOGET (linux; arm)
Vary: Origin
X-Amz-Bucket-Region: us-east-1
X-Amz-Request-Id: 14B5723E33D506B6

102

InternalErrorWe encountered an internal error, please try again./3L1373L137
0

mc: Response Time: 3.021878819s

mc: Cannot heal the disks. We encountered an internal error, please try again.
(0) admin-heal.go:408 cmd.mainAdminHeal(..)
Release-Tag:DEVELOPMENT.GOGET | Commit:DEVELOPMENT. | Host:rpi-1 | OS:linux | Arch:arm | Lang:go1.7.5 | Mem:1.1MB/22MB | Heap:1.1MB/2.7MB

{"status":"error","error":{"message":"Cannot heal the disks.","cause":{"message":"We encountered an internal error, please try again.","error":{"Code":"InternalError","Message":"We encountered an internal error, please try again.","BucketName":"","Key":"","RequestID":"3L137","HostID":"3L137","Region":""}},"type":"fatal","trace":[{"line":408,"file":"admin-heal.go","func":"cmd.mainAdminHeal"}],"sysinfo":{"host.arch":"arm","host.cpus":"4","host.lang":"go1.7.5","host.name":"rpi-1","host.os":"linux","mem.heap.total":"2.7MB","mem.heap.used":"1.0MB","mem.total":"23MB","mem.used":"1.0MB"}}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.