mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-27 20:59:42 +08:00
using fixed bootstrap from peer filer
This commit is contained in:
parent
fbe1316c92
commit
ac6fd36c06
@ -63,7 +63,6 @@ type FilerOptions struct {
|
|||||||
diskType *string
|
diskType *string
|
||||||
allowedOrigins *string
|
allowedOrigins *string
|
||||||
exposeDirectoryData *bool
|
exposeDirectoryData *bool
|
||||||
joinExistingFiler *bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -96,7 +95,6 @@ func init() {
|
|||||||
f.diskType = cmdFiler.Flag.String("disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")
|
f.diskType = cmdFiler.Flag.String("disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")
|
||||||
f.allowedOrigins = cmdFiler.Flag.String("allowedOrigins", "*", "comma separated list of allowed origins")
|
f.allowedOrigins = cmdFiler.Flag.String("allowedOrigins", "*", "comma separated list of allowed origins")
|
||||||
f.exposeDirectoryData = cmdFiler.Flag.Bool("exposeDirectoryData", true, "whether to return directory metadata and content in Filer UI")
|
f.exposeDirectoryData = cmdFiler.Flag.Bool("exposeDirectoryData", true, "whether to return directory metadata and content in Filer UI")
|
||||||
f.joinExistingFiler = cmdFiler.Flag.Bool("joinExistingFiler", false, "enable if new filer wants to join existing cluster")
|
|
||||||
|
|
||||||
// start s3 on filer
|
// start s3 on filer
|
||||||
filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway")
|
filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway")
|
||||||
@ -264,7 +262,6 @@ func (fo *FilerOptions) startFiler() {
|
|||||||
DownloadMaxBytesPs: int64(*fo.downloadMaxMBps) * 1024 * 1024,
|
DownloadMaxBytesPs: int64(*fo.downloadMaxMBps) * 1024 * 1024,
|
||||||
DiskType: *fo.diskType,
|
DiskType: *fo.diskType,
|
||||||
AllowedOrigins: strings.Split(*fo.allowedOrigins, ","),
|
AllowedOrigins: strings.Split(*fo.allowedOrigins, ","),
|
||||||
JoinExistingFiler: *fo.joinExistingFiler,
|
|
||||||
})
|
})
|
||||||
if nfs_err != nil {
|
if nfs_err != nil {
|
||||||
glog.Fatalf("Filer startup error: %v", nfs_err)
|
glog.Fatalf("Filer startup error: %v", nfs_err)
|
||||||
|
@ -119,7 +119,6 @@ func init() {
|
|||||||
filerOptions.downloadMaxMBps = cmdServer.Flag.Int("filer.downloadMaxMBps", 0, "download max speed for each download request, in MB per second")
|
filerOptions.downloadMaxMBps = cmdServer.Flag.Int("filer.downloadMaxMBps", 0, "download max speed for each download request, in MB per second")
|
||||||
filerOptions.diskType = cmdServer.Flag.String("filer.disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")
|
filerOptions.diskType = cmdServer.Flag.String("filer.disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")
|
||||||
filerOptions.exposeDirectoryData = cmdServer.Flag.Bool("filer.exposeDirectoryData", true, "expose directory data via filer. If false, filer UI will be innaccessible.")
|
filerOptions.exposeDirectoryData = cmdServer.Flag.Bool("filer.exposeDirectoryData", true, "expose directory data via filer. If false, filer UI will be innaccessible.")
|
||||||
filerOptions.joinExistingFiler = cmdServer.Flag.Bool("filer.joinExistingFiler", false, "enable if new filer wants to join existing cluster")
|
|
||||||
|
|
||||||
serverOptions.v.port = cmdServer.Flag.Int("volume.port", 8080, "volume server http listen port")
|
serverOptions.v.port = cmdServer.Flag.Int("volume.port", 8080, "volume server http listen port")
|
||||||
serverOptions.v.portGrpc = cmdServer.Flag.Int("volume.port.grpc", 0, "volume server grpc listen port")
|
serverOptions.v.portGrpc = cmdServer.Flag.Int("volume.port.grpc", 0, "volume server grpc listen port")
|
||||||
|
@ -74,7 +74,6 @@ type FilerOption struct {
|
|||||||
DiskType string
|
DiskType string
|
||||||
AllowedOrigins []string
|
AllowedOrigins []string
|
||||||
ExposeDirectoryData bool
|
ExposeDirectoryData bool
|
||||||
JoinExistingFiler bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type FilerServer struct {
|
type FilerServer struct {
|
||||||
@ -198,9 +197,6 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
|
|||||||
|
|
||||||
existingNodes := fs.filer.ListExistingPeerUpdates(context.Background())
|
existingNodes := fs.filer.ListExistingPeerUpdates(context.Background())
|
||||||
startFromTime := time.Now().Add(-filer.LogFlushInterval)
|
startFromTime := time.Now().Add(-filer.LogFlushInterval)
|
||||||
if option.JoinExistingFiler {
|
|
||||||
startFromTime = time.Time{}
|
|
||||||
}
|
|
||||||
if isFresh {
|
if isFresh {
|
||||||
glog.V(0).Infof("%s bootstrap from peers %+v", option.Host, existingNodes)
|
glog.V(0).Infof("%s bootstrap from peers %+v", option.Host, existingNodes)
|
||||||
if err := fs.filer.MaybeBootstrapFromOnePeer(option.Host, existingNodes, startFromTime); err != nil {
|
if err := fs.filer.MaybeBootstrapFromOnePeer(option.Host, existingNodes, startFromTime); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user