mirror of
https://github.com/minio/minio.git
synced 2025-11-25 20:16:10 -05:00
distributed-XL: Support to run one minio process per export even on the same machine. (#2999)
fixes #2983
This commit is contained in:
committed by
Harshavardhana
parent
41f9ab1c69
commit
32c3a558e9
@@ -23,8 +23,6 @@ import (
|
||||
"path"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/minio/minio-go/pkg/set"
|
||||
)
|
||||
|
||||
type s3Peers struct {
|
||||
@@ -38,9 +36,9 @@ type s3Peers struct {
|
||||
peers []string
|
||||
}
|
||||
|
||||
func initGlobalS3Peers(disks []string) {
|
||||
func initGlobalS3Peers(eps []storageEndPoint) {
|
||||
// Get list of de-duplicated peers.
|
||||
peers := getAllPeers(disks)
|
||||
peers := getAllPeers(eps)
|
||||
|
||||
// Initialize global state.
|
||||
globalS3Peers = s3Peers{
|
||||
@@ -112,23 +110,10 @@ func (s3p *s3Peers) Close() error {
|
||||
|
||||
// returns the network addresses of all Minio servers in the cluster
|
||||
// in `host:port` format.
|
||||
func getAllPeers(disks []string) []string {
|
||||
func getAllPeers(eps []storageEndPoint) []string {
|
||||
res := []string{}
|
||||
// use set to de-duplicate
|
||||
sset := set.NewStringSet()
|
||||
for _, disk := range disks {
|
||||
netAddr, _, err := splitNetPath(disk)
|
||||
if err != nil || netAddr == "" {
|
||||
errorIf(err, "Unexpected error - most likely a bug.")
|
||||
continue
|
||||
}
|
||||
if !sset.Contains(netAddr) {
|
||||
res = append(
|
||||
res,
|
||||
fmt.Sprintf("%s:%d", netAddr, globalMinioPort),
|
||||
)
|
||||
sset.Add(netAddr)
|
||||
}
|
||||
for _, ep := range eps {
|
||||
res = append(res, fmt.Sprintf("%s:%d", ep.host, ep.port))
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user