Doc: Modified the contents for Doctor. (#2262)
parent
5730d40478
commit
a7b5b8e63f
@ -1,76 +0,0 @@ |
|||||||
## Using aws-sdk-go with Minio |
|
||||||
|
|
||||||
aws-sdk-go is the official AWS SDK for the Go programming language. This document covers |
|
||||||
how to use aws-sdk-go with Minio server. |
|
||||||
|
|
||||||
### Install AWS SDK S3 service |
|
||||||
|
|
||||||
```sh |
|
||||||
$ go get github.com/aws/aws-sdk-go/service/s3 |
|
||||||
``` |
|
||||||
|
|
||||||
### List all buckets on Minio |
|
||||||
|
|
||||||
```go |
|
||||||
package main |
|
||||||
|
|
||||||
import ( |
|
||||||
"fmt" |
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws" |
|
||||||
"github.com/aws/aws-sdk-go/aws/credentials" |
|
||||||
"github.com/aws/aws-sdk-go/aws/session" |
|
||||||
"github.com/aws/aws-sdk-go/service/s3" |
|
||||||
) |
|
||||||
|
|
||||||
func main() { |
|
||||||
newSession := session.New() |
|
||||||
s3Config := &aws.Config{ |
|
||||||
Credentials: credentials.NewStaticCredentials("<YOUR-ACCESS-KEY-ID>", "<YOUR-SECRET-ACCESS-KEY", ""), |
|
||||||
Endpoint: aws.String("http://localhost:9000"), |
|
||||||
Region: aws.String("us-east-1"), |
|
||||||
DisableSSL: aws.Bool(true), |
|
||||||
S3ForcePathStyle: aws.Bool(true), |
|
||||||
} |
|
||||||
// Create an S3 service object in the default region. |
|
||||||
s3Client := s3.New(newSession, s3Config) |
|
||||||
|
|
||||||
cparams := &s3.CreateBucketInput{ |
|
||||||
Bucket: aws.String("newbucket"), // Required |
|
||||||
} |
|
||||||
_, err := s3Client.CreateBucket(cparams) |
|
||||||
if err != nil { |
|
||||||
// Message from an error. |
|
||||||
fmt.Println(err.Error()) |
|
||||||
return |
|
||||||
} |
|
||||||
|
|
||||||
var lparams *s3.ListBucketsInput |
|
||||||
// Call the ListBuckets() Operation |
|
||||||
resp, err := s3Client.ListBuckets(lparams) |
|
||||||
if err != nil { |
|
||||||
// Message from an error. |
|
||||||
fmt.Println(err.Error()) |
|
||||||
return |
|
||||||
} |
|
||||||
|
|
||||||
// Pretty-print the response data. |
|
||||||
fmt.Println(resp) |
|
||||||
} |
|
||||||
``` |
|
||||||
|
|
||||||
Populate your AccessKeyId and SecretAccessKey credentials and run the program as shown below. |
|
||||||
|
|
||||||
```sh |
|
||||||
$ go run aws-sdk-minio.go |
|
||||||
{ |
|
||||||
Buckets: [{ |
|
||||||
CreationDate: 2015-10-22 01:46:04 +0000 UTC, |
|
||||||
Name: "newbucket" |
|
||||||
}], |
|
||||||
Owner: { |
|
||||||
DisplayName: "minio", |
|
||||||
ID: "minio" |
|
||||||
} |
|
||||||
} |
|
||||||
``` |
|
@ -1,27 +0,0 @@ |
|||||||
## Setting up Proxy using Caddy. |
|
||||||
|
|
||||||
Please download [Caddy Server](https://caddyserver.com/download) |
|
||||||
|
|
||||||
Create a caddy configuration file as below, change the ip addresses according to your local |
|
||||||
minio and DNS configuration. |
|
||||||
|
|
||||||
```bash |
|
||||||
$ ./minio --address localhost:9000 server <your_export_dir> |
|
||||||
``` |
|
||||||
|
|
||||||
```bash |
|
||||||
your.public.com { |
|
||||||
proxy / localhost:9000 { |
|
||||||
proxy_header Host {host} |
|
||||||
proxy_header X-Real-IP {remote} |
|
||||||
proxy_header X-Forwarded-Proto {scheme} |
|
||||||
} |
|
||||||
} |
|
||||||
``` |
|
||||||
|
|
||||||
```bash |
|
||||||
$ ./caddy |
|
||||||
Activating privacy features... done. |
|
||||||
your.public.com:443 |
|
||||||
your.public.com:80 |
|
||||||
``` |
|
@ -1,84 +0,0 @@ |
|||||||
## Ubuntu (Kylin) 14.04 |
|
||||||
### Build Dependencies |
|
||||||
This installation document assumes Ubuntu 14.04+ on x86-64 platform. |
|
||||||
|
|
||||||
##### Install Git, GCC |
|
||||||
```sh |
|
||||||
$ sudo apt-get install git build-essential |
|
||||||
``` |
|
||||||
|
|
||||||
##### Install Go 1.6+ |
|
||||||
|
|
||||||
Download Go 1.6+ from [https://golang.org/dl/](https://golang.org/dl/). |
|
||||||
|
|
||||||
```sh |
|
||||||
$ wget https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz |
|
||||||
$ mkdir -p ${HOME}/bin/ |
|
||||||
$ mkdir -p ${HOME}/go/ |
|
||||||
$ tar -C ${HOME}/bin/ -xzf go1.6.linux-amd64.tar.gz |
|
||||||
``` |
|
||||||
##### Setup GOROOT and GOPATH |
|
||||||
|
|
||||||
Add the following exports to your ``~/.bashrc``. Environment variable GOROOT specifies the location of your golang binaries |
|
||||||
and GOPATH specifies the location of your project workspace. |
|
||||||
|
|
||||||
```sh |
|
||||||
export GOROOT=${HOME}/bin/go |
|
||||||
export GOPATH=${HOME}/go |
|
||||||
export PATH=${HOME}/bin/go/bin:${GOPATH}/bin:$PATH |
|
||||||
``` |
|
||||||
##### Source the new enviornment |
|
||||||
|
|
||||||
```sh |
|
||||||
$ source ~/.bashrc |
|
||||||
``` |
|
||||||
|
|
||||||
##### Testing it all |
|
||||||
|
|
||||||
```sh |
|
||||||
$ go env |
|
||||||
``` |
|
||||||
|
|
||||||
## OS X (Yosemite) 10.10 |
|
||||||
### Build Dependencies |
|
||||||
This installation document assumes OS X Yosemite 10.10+ on x86-64 platform. |
|
||||||
|
|
||||||
##### Install brew |
|
||||||
```sh |
|
||||||
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
|
||||||
``` |
|
||||||
|
|
||||||
##### Install Git, Python |
|
||||||
```sh |
|
||||||
$ brew install git python |
|
||||||
``` |
|
||||||
|
|
||||||
##### Install Go 1.6+ |
|
||||||
|
|
||||||
Install golang binaries using `brew` |
|
||||||
|
|
||||||
```sh |
|
||||||
$ brew install go |
|
||||||
$ mkdir -p $HOME/go |
|
||||||
``` |
|
||||||
|
|
||||||
##### Setup GOROOT and GOPATH |
|
||||||
|
|
||||||
Add the following exports to your ``~/.bash_profile``. Environment variable GOROOT specifies the location of your golang binaries |
|
||||||
and GOPATH specifies the location of your project workspace. |
|
||||||
|
|
||||||
```sh |
|
||||||
export GOPATH=${HOME}/go |
|
||||||
export GOVERSION=$(brew list go | head -n 1 | cut -d '/' -f 6) |
|
||||||
export GOROOT=$(brew --prefix)/Cellar/go/${GOVERSION}/libexec |
|
||||||
export PATH=${GOPATH}/bin:$PATH |
|
||||||
``` |
|
||||||
##### Source the new enviornment |
|
||||||
```sh |
|
||||||
$ source ~/.bash_profile |
|
||||||
``` |
|
||||||
##### Testing it all |
|
||||||
|
|
||||||
```sh |
|
||||||
$ go env |
|
||||||
``` |
|
@ -1,40 +0,0 @@ |
|||||||
# Server command line SPEC - Fri Apr 1 19:49:56 PDT 2016 |
|
||||||
|
|
||||||
## Single disk |
|
||||||
Regular single server, single disk mode. |
|
||||||
``` |
|
||||||
$ minio server <disk> |
|
||||||
``` |
|
||||||
|
|
||||||
## Multi disk |
|
||||||
``` |
|
||||||
$ minio controller start - Start minio controller. |
|
||||||
``` |
|
||||||
Prints a secret token to be used by all parties. |
|
||||||
|
|
||||||
Start all servers without disk with `MINIO_CONTROLLER` env set, start in cluster mode. |
|
||||||
``` |
|
||||||
$ MINIO_CONTROLLER=<host>:<token> minio server |
|
||||||
``` |
|
||||||
|
|
||||||
## Minio Controller cli. |
|
||||||
|
|
||||||
Set controller host and token. |
|
||||||
``` |
|
||||||
$ export MINIO_CONTROLLER=<host>:<token> |
|
||||||
``` |
|
||||||
|
|
||||||
Create a cluster from the pool of nodes. |
|
||||||
``` |
|
||||||
$ minioctl new <clustername> <ip1>:/mnt/disk1 .. <ip16>:/mnt/disk1 |
|
||||||
``` |
|
||||||
|
|
||||||
Start the cluster. |
|
||||||
``` |
|
||||||
$ minioctl start <clustername> |
|
||||||
``` |
|
||||||
|
|
||||||
Stop the cluster |
|
||||||
``` |
|
||||||
$ minioctl stop <clustername> |
|
||||||
``` |
|
Loading…
Reference in new issue