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 
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.