|
@ -8,6 +8,7 @@ import ( |
|
|
"pkg/replication" |
|
|
"pkg/replication" |
|
|
"pkg/storage" |
|
|
"pkg/storage" |
|
|
"pkg/topology" |
|
|
"pkg/topology" |
|
|
|
|
|
"runtime" |
|
|
"strconv" |
|
|
"strconv" |
|
|
"strings" |
|
|
"strings" |
|
|
"time" |
|
|
"time" |
|
@ -35,6 +36,7 @@ var ( |
|
|
confFile = cmdMaster.Flag.String("conf", "/etc/weedfs/weedfs.conf", "xml configuration file") |
|
|
confFile = cmdMaster.Flag.String("conf", "/etc/weedfs/weedfs.conf", "xml configuration file") |
|
|
defaultRepType = cmdMaster.Flag.String("defaultReplicationType", "000", "Default replication type if not specified.") |
|
|
defaultRepType = cmdMaster.Flag.String("defaultReplicationType", "000", "Default replication type if not specified.") |
|
|
mReadTimeout = cmdMaster.Flag.Int("readTimeout", 5, "connection read timeout in seconds") |
|
|
mReadTimeout = cmdMaster.Flag.Int("readTimeout", 5, "connection read timeout in seconds") |
|
|
|
|
|
mMaxCpu = cmdVolume.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs") |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
var topo *topology.Topology |
|
|
var topo *topology.Topology |
|
@ -133,6 +135,10 @@ func volumeGrowHandler(w http.ResponseWriter, r *http.Request) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func runMaster(cmd *Command, args []string) bool { |
|
|
func runMaster(cmd *Command, args []string) bool { |
|
|
|
|
|
if *mMaxCpu < 1 { |
|
|
|
|
|
*mMaxCpu = runtime.NumCPU() |
|
|
|
|
|
} |
|
|
|
|
|
runtime.GOMAXPROCS(*mMaxCpu) |
|
|
topo = topology.NewTopology("topo", *confFile, *metaFolder, "weed", uint64(*volumeSizeLimitMB)*1024*1024, *mpulse) |
|
|
topo = topology.NewTopology("topo", *confFile, *metaFolder, "weed", uint64(*volumeSizeLimitMB)*1024*1024, *mpulse) |
|
|
vg = replication.NewDefaultVolumeGrowth() |
|
|
vg = replication.NewDefaultVolumeGrowth() |
|
|
log.Println("Volume Size Limit is", *volumeSizeLimitMB, "MB") |
|
|
log.Println("Volume Size Limit is", *volumeSizeLimitMB, "MB") |
|
|