mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
filer add data center option
This commit is contained in:
parent
d0982cafa7
commit
50d351944f
|
@ -31,6 +31,7 @@ type FilerOptions struct {
|
||||||
maxMB *int
|
maxMB *int
|
||||||
secretKey *string
|
secretKey *string
|
||||||
dirListingLimit *int
|
dirListingLimit *int
|
||||||
|
dataCenter *string
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -47,6 +48,7 @@ func init() {
|
||||||
f.maxMB = cmdFiler.Flag.Int("maxMB", 32, "split files larger than the limit")
|
f.maxMB = cmdFiler.Flag.Int("maxMB", 32, "split files larger than the limit")
|
||||||
f.secretKey = cmdFiler.Flag.String("secure.secret", "", "secret to encrypt Json Web Token(JWT)")
|
f.secretKey = cmdFiler.Flag.String("secure.secret", "", "secret to encrypt Json Web Token(JWT)")
|
||||||
f.dirListingLimit = cmdFiler.Flag.Int("dirListLimit", 1000, "limit sub dir listing size")
|
f.dirListingLimit = cmdFiler.Flag.Int("dirListLimit", 1000, "limit sub dir listing size")
|
||||||
|
f.dataCenter = cmdFiler.Flag.String("dataCenter", "", "write to volumes in this data center")
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdFiler = &Command{
|
var cmdFiler = &Command{
|
||||||
|
@ -99,6 +101,7 @@ func (fo *FilerOptions) start() {
|
||||||
MaxMB: *f.maxMB,
|
MaxMB: *f.maxMB,
|
||||||
SecretKey: *f.secretKey,
|
SecretKey: *f.secretKey,
|
||||||
DirListingLimit: *f.dirListingLimit,
|
DirListingLimit: *f.dirListingLimit,
|
||||||
|
DataCenter: *f.dataCenter,
|
||||||
})
|
})
|
||||||
if nfs_err != nil {
|
if nfs_err != nil {
|
||||||
glog.Fatalf("Filer startup error: %v", nfs_err)
|
glog.Fatalf("Filer startup error: %v", nfs_err)
|
||||||
|
|
|
@ -110,6 +110,8 @@ func runServer(cmd *Command, args []string) bool {
|
||||||
master := *serverIp + ":" + strconv.Itoa(*masterPort)
|
master := *serverIp + ":" + strconv.Itoa(*masterPort)
|
||||||
filerOptions.ip = serverIp
|
filerOptions.ip = serverIp
|
||||||
|
|
||||||
|
filerOptions.dataCenter = serverDataCenter
|
||||||
|
|
||||||
if *filerOptions.defaultReplicaPlacement == "" {
|
if *filerOptions.defaultReplicaPlacement == "" {
|
||||||
*filerOptions.defaultReplicaPlacement = *masterDefaultReplicaPlacement
|
*filerOptions.defaultReplicaPlacement = *masterDefaultReplicaPlacement
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,6 +178,7 @@ func (fs *FilerServer) AssignVolume(ctx context.Context, req *filer_pb.AssignVol
|
||||||
Replication: req.Replication,
|
Replication: req.Replication,
|
||||||
Collection: req.Collection,
|
Collection: req.Collection,
|
||||||
Ttl: ttlStr,
|
Ttl: ttlStr,
|
||||||
|
DataCenter: fs.option.DataCenter,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("assign volume: %v", err)
|
return nil, fmt.Errorf("assign volume: %v", err)
|
||||||
|
|
|
@ -22,6 +22,7 @@ type FilerOption struct {
|
||||||
MaxMB int
|
MaxMB int
|
||||||
SecretKey string
|
SecretKey string
|
||||||
DirListingLimit int
|
DirListingLimit int
|
||||||
|
DataCenter string
|
||||||
}
|
}
|
||||||
|
|
||||||
type FilerServer struct {
|
type FilerServer struct {
|
||||||
|
|
Loading…
Reference in a new issue