Merge branch 'master' into release

This commit is contained in:
Harshavardhana
2016-11-25 18:23:36 -08:00
24 changed files with 168 additions and 116 deletions
+1 -1
View File
@@ -180,7 +180,7 @@ func (authClient *AuthRPCClient) Call(serviceMethod string, args interface {
err = authClient.rpc.Call(serviceMethod, args, reply) err = authClient.rpc.Call(serviceMethod, args, reply)
// Invalidate token, and mark it for re-login on subsequent reconnect. // Invalidate token, and mark it for re-login on subsequent reconnect.
if err != nil && err == rpc.ErrShutdown { if err == rpc.ErrShutdown {
authClient.mu.Lock() authClient.mu.Lock()
authClient.isLoggedIn = false authClient.isLoggedIn = false
authClient.mu.Unlock() authClient.mu.Unlock()
+3 -5
View File
@@ -85,11 +85,9 @@ func loadAllBucketPolicies(objAPI ObjectLayer) (policies map[string]*bucketPolic
for _, bucket := range buckets { for _, bucket := range buckets {
policy, pErr := readBucketPolicy(bucket.Name, objAPI) policy, pErr := readBucketPolicy(bucket.Name, objAPI)
if pErr != nil { if pErr != nil {
if !isErrIgnored(pErr, []error{ // net.Dial fails for rpc client or any
// net.Dial fails for rpc client or any // other unexpected errors during net.Dial.
// other unexpected errors during net.Dial. if !isErrIgnored(pErr, errDiskNotFound) {
errDiskNotFound,
}) {
if !isErrBucketPolicyNotFound(pErr) { if !isErrBucketPolicyNotFound(pErr) {
pErrs = append(pErrs, pErr) pErrs = append(pErrs, pErr)
} }
+17
View File
@@ -120,3 +120,20 @@ func errorsCause(errs []error) []error {
} }
return cerrs return cerrs
} }
var baseIgnoredErrs = []error{
errDiskNotFound,
errFaultyDisk,
errFaultyRemoteDisk,
}
// isErrIgnored returns whether given error is ignored or not.
func isErrIgnored(err error, ignoredErrs ...error) bool {
err = errorCause(err)
for _, ignoredErr := range ignoredErrs {
if ignoredErr == err {
return true
}
}
return false
}
+2 -9
View File
@@ -438,22 +438,15 @@ func removeListenerConfig(bucket string, objAPI ObjectLayer) error {
// Loads both notification and listener config. // Loads both notification and listener config.
func loadNotificationAndListenerConfig(bucketName string, objAPI ObjectLayer) (nCfg *notificationConfig, lCfg []listenerConfig, err error) { func loadNotificationAndListenerConfig(bucketName string, objAPI ObjectLayer) (nCfg *notificationConfig, lCfg []listenerConfig, err error) {
nConfigErrs := []error{
// When no previous notification configs were found.
errNoSuchNotifications,
// net.Dial fails for rpc client or any
// other unexpected errors during net.Dial.
errDiskNotFound,
}
// Loads notification config if any. // Loads notification config if any.
nCfg, err = loadNotificationConfig(bucketName, objAPI) nCfg, err = loadNotificationConfig(bucketName, objAPI)
if err != nil && !isErrIgnored(err, nConfigErrs) { if err != nil && !isErrIgnored(err, errDiskNotFound, errNoSuchNotifications) {
return nil, nil, err return nil, nil, err
} }
// Loads listener config if any. // Loads listener config if any.
lCfg, err = loadListenerConfig(bucketName, objAPI) lCfg, err = loadListenerConfig(bucketName, objAPI)
if err != nil && !isErrIgnored(err, nConfigErrs) { if err != nil && !isErrIgnored(err, errDiskNotFound, errNoSuchNotifications) {
return nil, nil, err return nil, nil, err
} }
return nCfg, lCfg, nil return nCfg, lCfg, nil
+1 -1
View File
@@ -90,7 +90,7 @@ func (fs fsObjects) listMultipartUploads(bucket, prefix, keyMarker, uploadIDMark
// For any walk error return right away. // For any walk error return right away.
if walkResult.err != nil { if walkResult.err != nil {
// File not found or Disk not found is a valid case. // File not found or Disk not found is a valid case.
if isErrIgnored(walkResult.err, fsTreeWalkIgnoredErrs) { if isErrIgnored(walkResult.err, fsTreeWalkIgnoredErrs...) {
eof = true eof = true
break break
} }
+5
View File
@@ -60,6 +60,11 @@ func newFSObjects(storage StorageAPI) (ObjectLayer, error) {
return nil, fmt.Errorf("Unable to recognize backend format, %s", err) return nil, fmt.Errorf("Unable to recognize backend format, %s", err)
} }
// Initialize meta volume, if volume already exists ignores it.
if err = initMetaVolume([]StorageAPI{storage}); err != nil {
return nil, fmt.Errorf("Unable to initialize '.minio.sys' meta volume, %s", err)
}
// Initialize fs objects. // Initialize fs objects.
fs := fsObjects{ fs := fsObjects{
storage: storage, storage: storage,
+6 -4
View File
@@ -167,11 +167,16 @@ func Main() {
// Initialize config. // Initialize config.
configCreated, err := initConfig() configCreated, err := initConfig()
fatalIf(err, "Unable to initialize minio config.") if err != nil {
console.Fatalf("Unable to initialize minio config. Err: %s.\n", err)
}
if configCreated { if configCreated {
console.Println("Created minio configuration file at " + mustGetConfigPath()) console.Println("Created minio configuration file at " + mustGetConfigPath())
} }
// Enable all loggers by now so we can use errorIf() and fatalIf()
enableLoggers()
// Fetch access keys from environment variables and update the config. // Fetch access keys from environment variables and update the config.
accessKey := os.Getenv("MINIO_ACCESS_KEY") accessKey := os.Getenv("MINIO_ACCESS_KEY")
secretKey := os.Getenv("MINIO_SECRET_KEY") secretKey := os.Getenv("MINIO_SECRET_KEY")
@@ -189,9 +194,6 @@ func Main() {
fatalIf(errInvalidArgument, "Invalid secret key. Accept only a string containing from 8 to 40 characters.") fatalIf(errInvalidArgument, "Invalid secret key. Accept only a string containing from 8 to 40 characters.")
} }
// Enable all loggers by now.
enableLoggers()
// Init the error tracing module. // Init the error tracing module.
initError() initError()
+8 -26
View File
@@ -48,17 +48,6 @@ func init() {
globalObjLayerMutex = &sync.Mutex{} globalObjLayerMutex = &sync.Mutex{}
} }
// isErrIgnored should we ignore this error?, takes a list of errors which can be ignored.
func isErrIgnored(err error, ignoredErrs []error) bool {
err = errorCause(err)
for _, ignoredErr := range ignoredErrs {
if ignoredErr == err {
return true
}
}
return false
}
// House keeping code for FS/XL and distributed Minio setup. // House keeping code for FS/XL and distributed Minio setup.
func houseKeeping(storageDisks []StorageAPI) error { func houseKeeping(storageDisks []StorageAPI) error {
var wg = &sync.WaitGroup{} var wg = &sync.WaitGroup{}
@@ -83,9 +72,7 @@ func houseKeeping(storageDisks []StorageAPI) error {
// Cleanup all temp entries upon start. // Cleanup all temp entries upon start.
err := cleanupDir(disk, minioMetaTmpBucket, "") err := cleanupDir(disk, minioMetaTmpBucket, "")
if err != nil { if err != nil {
switch errorCause(err) { if !isErrIgnored(errorCause(err), errDiskNotFound, errVolumeNotFound, errFileNotFound) {
case errDiskNotFound, errVolumeNotFound, errFileNotFound:
default:
errs[index] = err errs[index] = err
} }
} }
@@ -196,12 +183,7 @@ func newStorageAPI(ep *url.URL) (storage StorageAPI, err error) {
return newStorageRPC(ep) return newStorageRPC(ep)
} }
var initMetaVolIgnoredErrs = []error{ var initMetaVolIgnoredErrs = append(baseIgnoredErrs, errVolumeExists)
errVolumeExists,
errDiskNotFound,
errFaultyDisk,
errFaultyRemoteDisk,
}
// Initializes meta volume on all input storage disks. // Initializes meta volume on all input storage disks.
func initMetaVolume(storageDisks []StorageAPI) error { func initMetaVolume(storageDisks []StorageAPI) error {
@@ -227,24 +209,24 @@ func initMetaVolume(storageDisks []StorageAPI) error {
// Attempt to create `.minio.sys`. // Attempt to create `.minio.sys`.
err := disk.MakeVol(minioMetaBucket) err := disk.MakeVol(minioMetaBucket)
if err != nil { if err != nil {
if !isErrIgnored(err, initMetaVolIgnoredErrs) { if !isErrIgnored(err, initMetaVolIgnoredErrs...) {
errs[index] = err errs[index] = err
return
} }
return
} }
err = disk.MakeVol(minioMetaTmpBucket) err = disk.MakeVol(minioMetaTmpBucket)
if err != nil { if err != nil {
if !isErrIgnored(err, initMetaVolIgnoredErrs) { if !isErrIgnored(err, initMetaVolIgnoredErrs...) {
errs[index] = err errs[index] = err
return
} }
return
} }
err = disk.MakeVol(minioMetaMultipartBucket) err = disk.MakeVol(minioMetaMultipartBucket)
if err != nil { if err != nil {
if !isErrIgnored(err, initMetaVolIgnoredErrs) { if !isErrIgnored(err, initMetaVolIgnoredErrs...) {
errs[index] = err errs[index] = err
return
} }
return
} }
}(index, disk) }(index, disk)
} }
+4 -4
View File
@@ -24,22 +24,22 @@ import (
// Function not implemented error // Function not implemented error
func isSysErrNoSys(err error) bool { func isSysErrNoSys(err error) bool {
return err != nil && err == syscall.ENOSYS return err == syscall.ENOSYS
} }
// Not supported error // Not supported error
func isSysErrOpNotSupported(err error) bool { func isSysErrOpNotSupported(err error) bool {
return err != nil && err == syscall.EOPNOTSUPP return err == syscall.EOPNOTSUPP
} }
// No space left on device error // No space left on device error
func isSysErrNoSpace(err error) bool { func isSysErrNoSpace(err error) bool {
return err != nil && err == syscall.ENOSPC return err == syscall.ENOSPC
} }
// Input/output error // Input/output error
func isSysErrIO(err error) bool { func isSysErrIO(err error) bool {
return err != nil && err == syscall.EIO return err == syscall.EIO
} }
// Check if the given error corresponds to ENOTDIR (is not a directory). // Check if the given error corresponds to ENOTDIR (is not a directory).
+1 -1
View File
@@ -133,7 +133,7 @@ func listDirFactory(isLeaf isLeafFunc, treeWalkIgnoredErrs []error, disks ...Sto
} }
// For any reason disk was deleted or goes offline, continue // For any reason disk was deleted or goes offline, continue
// and list from other disks if possible. // and list from other disks if possible.
if isErrIgnored(err, treeWalkIgnoredErrs) { if isErrIgnored(err, treeWalkIgnoredErrs...) {
continue continue
} }
break break
+3 -3
View File
@@ -117,10 +117,10 @@ var (
// Check if the operating system is a docker container. // Check if the operating system is a docker container.
func isDocker() bool { func isDocker() bool {
cgroup, err := ioutil.ReadFile("/proc/self/cgroup") cgroup, err := ioutil.ReadFile("/proc/self/cgroup")
if err != nil && os.IsNotExist(err) { if err != nil && !os.IsNotExist(err) {
return false errorIf(err, "Unable to read `cgroup` file.")
} }
fatalIf(err, "Unable to read `cgroup` file.")
return bytes.Contains(cgroup, []byte("docker")) return bytes.Contains(cgroup, []byte("docker"))
} }
+5 -10
View File
@@ -21,17 +21,12 @@ import (
"sync" "sync"
) )
// list all errors that can be ignore in a bucket operation.
var bucketOpIgnoredErrs = append(baseIgnoredErrs, errDiskAccessDenied)
// list all errors that can be ignored in a bucket metadata operation. // list all errors that can be ignored in a bucket metadata operation.
var bucketMetadataOpIgnoredErrs = append(bucketOpIgnoredErrs, errVolumeNotFound) var bucketMetadataOpIgnoredErrs = append(bucketOpIgnoredErrs, errVolumeNotFound)
// list all errors that can be ignore in a bucket operation.
var bucketOpIgnoredErrs = []error{
errFaultyDisk,
errFaultyRemoteDisk,
errDiskNotFound,
errDiskAccessDenied,
}
/// Bucket operations /// Bucket operations
// MakeBucket - make a bucket. // MakeBucket - make a bucket.
@@ -143,7 +138,7 @@ func (xl xlObjects) getBucketInfo(bucketName string) (bucketInfo BucketInfo, err
} }
err = traceError(err) err = traceError(err)
// For any reason disk went offline continue and pick the next one. // For any reason disk went offline continue and pick the next one.
if isErrIgnored(err, bucketMetadataOpIgnoredErrs) { if isErrIgnored(err, bucketMetadataOpIgnoredErrs...) {
continue continue
} }
break break
@@ -219,7 +214,7 @@ func (xl xlObjects) listBuckets() (bucketsInfo []BucketInfo, err error) {
return bucketsInfo, nil return bucketsInfo, nil
} }
// Ignore any disks not found. // Ignore any disks not found.
if isErrIgnored(err, bucketMetadataOpIgnoredErrs) { if isErrIgnored(err, bucketMetadataOpIgnoredErrs...) {
continue continue
} }
break break
+1 -1
View File
@@ -62,7 +62,7 @@ func (xl xlObjects) isObject(bucket, prefix string) (ok bool) {
return true return true
} }
// Ignore for file not found, disk not found or faulty disk. // Ignore for file not found, disk not found or faulty disk.
if isErrIgnored(err, xlTreeWalkIgnoredErrs) { if isErrIgnored(err, xlTreeWalkIgnoredErrs...) {
continue continue
} }
errorIf(err, "Unable to stat a file %s/%s/%s", bucket, prefix, xlMetaJSONFile) errorIf(err, "Unable to stat a file %s/%s/%s", bucket, prefix, xlMetaJSONFile)
+1 -1
View File
@@ -184,7 +184,7 @@ func listBucketNames(storageDisks []StorageAPI) (bucketNames map[string]struct{}
continue continue
} }
// Ignore any disks not found. // Ignore any disks not found.
if isErrIgnored(err, bucketMetadataOpIgnoredErrs) { if isErrIgnored(err, bucketMetadataOpIgnoredErrs...) {
continue continue
} }
break break
+3 -11
View File
@@ -206,15 +206,7 @@ func pickValidXLMeta(metaArr []xlMetaV1, modTime time.Time) (xlMetaV1, error) {
} }
// list of all errors that can be ignored in a metadata operation. // list of all errors that can be ignored in a metadata operation.
var objMetadataOpIgnoredErrs = []error{ var objMetadataOpIgnoredErrs = append(baseIgnoredErrs, errDiskAccessDenied, errVolumeNotFound, errFileNotFound, errFileAccessDenied)
errDiskNotFound,
errDiskAccessDenied,
errFaultyDisk,
errFaultyRemoteDisk,
errVolumeNotFound,
errFileAccessDenied,
errFileNotFound,
}
// readXLMetaParts - returns the XL Metadata Parts from xl.json of one of the disks picked at random. // readXLMetaParts - returns the XL Metadata Parts from xl.json of one of the disks picked at random.
func (xl xlObjects) readXLMetaParts(bucket, object string) (xlMetaParts []objectPartInfo, err error) { func (xl xlObjects) readXLMetaParts(bucket, object string) (xlMetaParts []objectPartInfo, err error) {
@@ -228,7 +220,7 @@ func (xl xlObjects) readXLMetaParts(bucket, object string) (xlMetaParts []object
} }
// For any reason disk or bucket is not available continue // For any reason disk or bucket is not available continue
// and read from other disks. // and read from other disks.
if isErrIgnored(err, objMetadataOpIgnoredErrs) { if isErrIgnored(err, objMetadataOpIgnoredErrs...) {
continue continue
} }
break break
@@ -250,7 +242,7 @@ func (xl xlObjects) readXLMetaStat(bucket, object string) (xlStat statInfo, xlMe
} }
// For any reason disk or bucket is not available continue // For any reason disk or bucket is not available continue
// and read from other disks. // and read from other disks.
if isErrIgnored(err, objMetadataOpIgnoredErrs) { if isErrIgnored(err, objMetadataOpIgnoredErrs...) {
continue continue
} }
break break
+2 -2
View File
@@ -166,7 +166,7 @@ func (xl xlObjects) isMultipartUpload(bucket, prefix string) bool {
return true return true
} }
// For any reason disk was deleted or goes offline, continue // For any reason disk was deleted or goes offline, continue
if isErrIgnored(err, objMetadataOpIgnoredErrs) { if isErrIgnored(err, objMetadataOpIgnoredErrs...) {
continue continue
} }
break break
@@ -213,7 +213,7 @@ func (xl xlObjects) statPart(bucket, object, uploadID, partName string) (fileInf
} }
err = traceError(err) err = traceError(err)
// For any reason disk was deleted or goes offline we continue to next disk. // For any reason disk was deleted or goes offline we continue to next disk.
if isErrIgnored(err, objMetadataOpIgnoredErrs) { if isErrIgnored(err, objMetadataOpIgnoredErrs...) {
continue continue
} }
+4 -4
View File
@@ -76,7 +76,7 @@ func (xl xlObjects) listMultipartUploads(bucket, prefix, keyMarker, uploadIDMark
if err == nil { if err == nil {
break break
} }
if isErrIgnored(err, objMetadataOpIgnoredErrs) { if isErrIgnored(err, objMetadataOpIgnoredErrs...) {
continue continue
} }
break break
@@ -110,7 +110,7 @@ func (xl xlObjects) listMultipartUploads(bucket, prefix, keyMarker, uploadIDMark
// For any walk error return right away. // For any walk error return right away.
if walkResult.err != nil { if walkResult.err != nil {
// File not found or Disk not found is a valid case. // File not found or Disk not found is a valid case.
if isErrIgnored(walkResult.err, xlTreeWalkIgnoredErrs) { if isErrIgnored(walkResult.err, xlTreeWalkIgnoredErrs...) {
continue continue
} }
return ListMultipartsInfo{}, err return ListMultipartsInfo{}, err
@@ -147,14 +147,14 @@ func (xl xlObjects) listMultipartUploads(bucket, prefix, keyMarker, uploadIDMark
if err == nil { if err == nil {
break break
} }
if isErrIgnored(err, objMetadataOpIgnoredErrs) { if isErrIgnored(err, objMetadataOpIgnoredErrs...) {
continue continue
} }
break break
} }
entryLock.RUnlock() entryLock.RUnlock()
if err != nil { if err != nil {
if isErrIgnored(err, xlTreeWalkIgnoredErrs) { if isErrIgnored(err, xlTreeWalkIgnoredErrs...) {
continue continue
} }
return ListMultipartsInfo{}, err return ListMultipartsInfo{}, err
+3 -8
View File
@@ -35,7 +35,7 @@ func reduceErrs(errs []error, ignoredErrs []error) (maxCount int, maxErr error)
errorCounts := make(map[error]int) errorCounts := make(map[error]int)
errs = errorsCause(errs) errs = errorsCause(errs)
for _, err := range errs { for _, err := range errs {
if isErrIgnored(err, ignoredErrs) { if isErrIgnored(err, ignoredErrs...) {
continue continue
} }
errorCounts[err]++ errorCounts[err]++
@@ -83,12 +83,7 @@ func reduceWriteQuorumErrs(errs []error, ignoredErrs []error, writeQuorum int) (
} }
// List of all errors which are ignored while verifying quorum. // List of all errors which are ignored while verifying quorum.
var quorumIgnoredErrs = []error{ var quorumIgnoredErrs = append(baseIgnoredErrs, errDiskAccessDenied)
errFaultyDisk,
errFaultyRemoteDisk,
errDiskNotFound,
errDiskAccessDenied,
}
// Validates if we have quorum based on the errors related to disk only. // Validates if we have quorum based on the errors related to disk only.
// Returns 'true' if we have quorum, 'false' if we don't. // Returns 'true' if we have quorum, 'false' if we don't.
@@ -97,7 +92,7 @@ func isDiskQuorum(errs []error, minQuorumCount int) bool {
errs = errorsCause(errs) errs = errorsCause(errs)
for _, err := range errs { for _, err := range errs {
// Check if the error can be ignored for quorum verification. // Check if the error can be ignored for quorum verification.
if !isErrIgnored(err, quorumIgnoredErrs) { if !isErrIgnored(err, quorumIgnoredErrs...) {
count++ count++
} }
} }
+6 -8
View File
@@ -72,14 +72,7 @@ type xlObjects struct {
} }
// list of all errors that can be ignored in tree walk operation in XL // list of all errors that can be ignored in tree walk operation in XL
var xlTreeWalkIgnoredErrs = []error{ var xlTreeWalkIgnoredErrs = append(baseIgnoredErrs, errDiskAccessDenied, errVolumeNotFound, errFileNotFound)
errFileNotFound,
errVolumeNotFound,
errDiskNotFound,
errDiskAccessDenied,
errFaultyDisk,
errFaultyRemoteDisk,
}
// newXLObjects - initialize new xl object layer. // newXLObjects - initialize new xl object layer.
func newXLObjects(storageDisks []StorageAPI) (ObjectLayer, error) { func newXLObjects(storageDisks []StorageAPI) (ObjectLayer, error) {
@@ -119,6 +112,11 @@ func newXLObjects(storageDisks []StorageAPI) (ObjectLayer, error) {
objCacheEnabled: !objCacheDisabled, objCacheEnabled: !objCacheDisabled,
} }
// Initialize meta volume, if volume already exists ignores it.
if err = initMetaVolume(storageDisks); err != nil {
return nil, fmt.Errorf("Unable to initialize '.minio.sys' meta volume, %s", err)
}
// Figure out read and write quorum based on number of storage disks. // Figure out read and write quorum based on number of storage disks.
// READ and WRITE quorum is always set to (N/2) number of disks. // READ and WRITE quorum is always set to (N/2) number of disks.
xl.readQuorum = readQuorum xl.readQuorum = readQuorum
+83
View File
@@ -0,0 +1,83 @@
# Distributed Minio Quickstart Guide [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minio/minio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Go Report Card](https://goreportcard.com/badge/minio/minio)](https://goreportcard.com/report/minio/minio) [![Docker Pulls](https://img.shields.io/docker/pulls/minio/minio.svg?maxAge=604800)](https://hub.docker.com/r/minio/minio/) [![codecov](https://codecov.io/gh/minio/minio/branch/master/graph/badge.svg)](https://codecov.io/gh/minio/minio)
Minio in distributed mode lets you pool multiple drives (even on different machines) into a single object storage server. As drives are distributed across several nodes, distributed Minio can withstand multiple node failures and yet ensure full data protection.
## Why distributed Minio?
Minio in distributed mode can help you setup a highly-available storage system with a single object storage deployment. With distributed Minio, you can optimally use storage devices, irrespective of their location in a network.
### Data protection
Distributed Minio provides protection against multiple node/drive failures and [bit rot](https://github.com/minio/minio/blob/master/docs/erasure/README.md#what-is-bit-rot-protection) using [erasure code](https://docs.minio.io/docs/minio-erasure-code-quickstart-guide). As the minimum disks required for distributed Minio is 4 (same as minimum disks required for erasure coding), erasure code automatically kicks in as you launch distributed Minio.
### High availability
A stand-alone Minio server would go down if the server hosting the disks goes offline. In contrast, a distributed Minio setup with _n_ disks will have your data safe as long as _n/2_ or more disks are online. You'll need a minimum of _(n/2 + 1)_ [Quorum](https://github.com/minio/dsync#lock-process) disks to create new objects though.
For example, an 8-node distributed Minio setup, with 1 disk per node would stay put, even if upto 4 nodes are offline. But, you'll need atleast 5 nodes online to create new objects.
## Limitations
As with Minio in stand-alone mode, distributed Minio has a per tenant limit of minimum 4 and maximum 16 drives (imposed by erasure code). This helps maintain simplicity and yet remain scalable. If you need a multiple tenant setup, you can easily spin multiple Minio instances managed by orchestration tools like Kubernetes.
Note that with distributed Minio you can play around with the number of nodes and drives as long as the limits are adhered to. For example, you can have 2 nodes with 4 drives each, 4 nodes with 4 drives each, 8 nodes with 2 drives each, and so on.
# Get started
If you're aware of stand-alone Minio set up, the process remains largely the same, as the Minio server automatically switches to stand-alone or distributed mode, depending on the command line parameters.
## 1. Prerequisites
Install Minio - [Minio Quickstart Guide](https://docs.minio.io/docs/minio).
## 2. Run distributed Minio
To start a distributed Minio instance, you just need to pass drive locations as parameters to the minio server command. Then, youll need to run the same command on all the participating nodes.
It is important to note here that all the nodes running distributed Minio need to have same access key and secret key. Otherwise nodes won't connect. To achieve this, you need to export access key and secret key as environment variables on all the nodes before executing Minio server command.
Below examples will clarify further:
Example 1: Start distributed Minio instance with 1 drive each on 8 nodes, by running this command on all the 8 nodes.
```shell
$ export MINIO_ACCESS_KEY=<ACCESS_KEY>
$ export MINIO_SECRET_KEY=<SECRET_KEY>
$ minio server http://192.168.1.11/export1 http://192.168.1.12/export2 \
http://192.168.1.13/export3 http://192.168.1.14/export4 \
http://192.168.1.15/export5 http://192.168.1.16/export6 \
http://192.168.1.17/export7 http://192.168.1.18/export8
```
![Distributed Minio, 8 nodes with 1 disk each](https://raw.githubusercontent.com/minio/minio/master/docs/screenshots/Architecture-diagram_distributed_8.png)
Example 2: Start distributed Minio instance with 4 drives each on 4 nodes, by running this command on all the 4 nodes.
```shell
$ export MINIO_ACCESS_KEY=<ACCESS_KEY>
$ export MINIO_SECRET_KEY=<SECRET_KEY>
$ minio server http://192.168.1.11/export1 http://192.168.1.11/export2 \
http://192.168.1.11/export3 http://192.168.1.11/export4 \
http://192.168.1.12/export1 http://192.168.1.12/export2 \
http://192.168.1.12/export3 http://192.168.1.12/export4 \
http://192.168.1.13/export1 http://192.168.1.13/export2 \
http://192.168.1.13/export3 http://192.168.1.13/export4 \
http://192.168.1.14/export1 http://192.168.1.14/export2 \
http://192.168.1.14/export3 http://192.168.1.14/export4
```
![Distributed Minio, 4 nodes with 4 disks each](https://raw.githubusercontent.com/minio/minio/master/docs/screenshots/Architecture-diagram_distributed_16.png)
Note that these IP addresses and drive paths are for demonstration purposes only, you need to replace these with the actual IP addresses and drive paths.
## 3. Test your setup
To test this setup, access the Minio server via browser or [`mc`](https://docs.minio.io/docs/minio-client-quickstart-guide). Youll see the combined capacity of all the storage drives as the capacity of this drive.
## Explore Further
- [Minio Erasure Code QuickStart Guide](https://docs.minio.io/docs/minio-erasure-code-quickstart-guide)
- [Use `mc` with Minio Server](https://docs.minio.io/docs/minio-client-quickstart-guide)
- [Use `aws-cli` with Minio Server](https://docs.minio.io/docs/aws-cli-with-minio)
- [Use `s3cmd` with Minio Server](https://docs.minio.io/docs/s3cmd-with-minio)
- [Use `minio-go` SDK with Minio Server](https://docs.minio.io/docs/golang-client-quickstart-guide)
- [The Minio documentation website](https://docs.minio.io)
+9 -17
View File
@@ -2,36 +2,28 @@
## Install Minio service ## Install Minio service
Download and install the [Windows Server 2003 Resource Kit Tools](https://www.microsoft.com/en-us/download/details.aspx?id=17657). It NSSM is an opensource alternative to srvany. NSSM is still being updated, and works on Windows 10 as well.
is old, but still works on recent Windows versions. On the latest Windows versions you'll get a warning message, but you can run
it anyhow by clicking on "Run the program without getting help".
Start cmd.exe and install the Minio service: Download [NSSM](http://nssm.cc/download) and extract the 64 bit nssm.exe to a known path.
``` ```
sc create Minio binPath="C:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe" DisplayName="Minio Cloudstorage" c:\nssm.exe install Minio c:\bin\minio.exe server c:\data
``` ```
Now we need to configure srvany using regedit. Start regedit and go to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Minio and ### Configure startup type
create a new key called Parameters.
![](./screenshots/windows-configure-registry.png?raw=true)
Within the new key create a new String value called Application and enter the path of your Minio binary. (eg. C:\Minio\bin\minio.exe) And create
another String value called AppParameters with value `server c:\data` where c:\data will be the location of the data folder.
When you start services, look for the Minio service and start and stop (or make it automatically start at reboots) the service. When you start services, look for the Minio service and start and stop (or make it automatically start at reboots) the service.
![](./screenshots/windows-configure-startup-type.png?raw=true) ![Configure startup type](https://raw.githubusercontent.com/minio/minio/master/docs/screenshots/windows-configure-startup-type.png)
### Configure user
It is a good (and secure) practice to create a new user, assign rights to the data folder to this user and change the service Log On info to use the newly created user. It is a good (and secure) practice to create a new user, assign rights to the data folder to this user and change the service Log On info to use the newly created user.
![](./screenshots/windows-configure-user.png?raw=true) ![Configure user](https://raw.githubusercontent.com/minio/minio/master/docs/screenshots/windows-configure-user.png)
## Delete Minio service ## Delete Minio service
If you want to remove the Minio service, just enter the following command from the command line.
``` ```
sc delete Minio c:\nssm.exe remove Minio
``` ```
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 354 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB