diff options
Diffstat (limited to 'weed/command')
| -rw-r--r-- | weed/command/filer.go | 26 | ||||
| -rw-r--r-- | weed/command/filer_sync.go | 4 | ||||
| -rw-r--r-- | weed/command/imports.go | 2 | ||||
| -rw-r--r-- | weed/command/master.go | 5 | ||||
| -rw-r--r-- | weed/command/mount.go | 2 | ||||
| -rw-r--r-- | weed/command/scaffold/filer.toml | 10 | ||||
| -rw-r--r-- | weed/command/update_full.go | 4 |
7 files changed, 41 insertions, 12 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go index c9f9a1956..7e0e92d4a 100644 --- a/weed/command/filer.go +++ b/weed/command/filer.go @@ -6,10 +6,13 @@ import ( "net/http" "os" "runtime" + "sort" + "strings" "time" "google.golang.org/grpc/reflection" + "github.com/chrislusf/seaweedfs/weed/filer" "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" @@ -114,10 +117,8 @@ func init() { filerIamOptions.port = cmdFiler.Flag.Int("iam.port", 8111, "iam server http listen port") } -var cmdFiler = &Command{ - UsageLine: "filer -port=8888 -master=<ip:port>[,<ip:port>]*", - Short: "start a file server that points to a master server, or a list of master servers", - Long: `start a file server which accepts REST operation for any files. +func filerLongDesc() string { + desc := `start a file server which accepts REST operation for any files. //create or overwrite the file, the directories /path/to will be automatically created POST /path/to/file @@ -133,7 +134,22 @@ var cmdFiler = &Command{ The example filer.toml configuration file can be generated by "weed scaffold -config=filer" -`, +Supported Filer Stores: +` + + storeNames := make([]string, len(filer.Stores)) + for i, store := range filer.Stores { + storeNames[i] = "\t" + store.GetName() + } + sort.Strings(storeNames) + storeList := strings.Join(storeNames, "\n") + return desc + storeList +} + +var cmdFiler = &Command{ + UsageLine: "filer -port=8888 -master=<ip:port>[,<ip:port>]*", + Short: "start a file server that points to a master server, or a list of master servers", + Long: filerLongDesc(), } func runFiler(cmd *Command, args []string) bool { diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go index b7da1baf9..1550d155a 100644 --- a/weed/command/filer_sync.go +++ b/weed/command/filer_sync.go @@ -215,10 +215,10 @@ func doSubscribeFilerMetaChanges(clientId int32, grpcDialOption grpc.DialOption, return persistEventFn(resp) } - var lastLogTsNs = time.Now().Nanosecond() + var lastLogTsNs = time.Now().UnixNano() var clientName = fmt.Sprintf("syncFrom_%s_To_%s", string(sourceFiler), string(targetFiler)) processEventFnWithOffset := pb.AddOffsetFunc(processEventFn, 3*time.Second, func(counter int64, lastTsNs int64) error { - now := time.Now().Nanosecond() + now := time.Now().UnixNano() glog.V(0).Infof("sync %s to %s progressed to %v %0.2f/sec", sourceFiler, targetFiler, time.Unix(0, lastTsNs), float64(counter)/(float64(now-lastLogTsNs)/1e9)) lastLogTsNs = now // collect synchronous offset diff --git a/weed/command/imports.go b/weed/command/imports.go index 04079b162..afdbc5a10 100644 --- a/weed/command/imports.go +++ b/weed/command/imports.go @@ -5,7 +5,6 @@ import ( _ "github.com/chrislusf/seaweedfs/weed/remote_storage/azure" _ "github.com/chrislusf/seaweedfs/weed/remote_storage/gcs" - _ "github.com/chrislusf/seaweedfs/weed/remote_storage/hdfs" _ "github.com/chrislusf/seaweedfs/weed/remote_storage/s3" _ "github.com/chrislusf/seaweedfs/weed/replication/sink/azuresink" @@ -32,5 +31,6 @@ import ( _ "github.com/chrislusf/seaweedfs/weed/filer/redis2" _ "github.com/chrislusf/seaweedfs/weed/filer/redis3" _ "github.com/chrislusf/seaweedfs/weed/filer/sqlite" + _ "github.com/chrislusf/seaweedfs/weed/filer/tikv" _ "github.com/chrislusf/seaweedfs/weed/filer/ydb" ) diff --git a/weed/command/master.go b/weed/command/master.go index 9587df055..ab8466d47 100644 --- a/weed/command/master.go +++ b/weed/command/master.go @@ -1,9 +1,11 @@ package command import ( + "fmt" "golang.org/x/exp/slices" "net/http" "os" + "path" "strings" "time" @@ -151,11 +153,12 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) { } // start raftServer + metaDir := path.Join(*masterOption.metaFolder, fmt.Sprintf("m%d", *masterOption.port)) raftServerOption := &weed_server.RaftServerOption{ GrpcDialOption: security.LoadClientTLS(util.GetViper(), "grpc.master"), Peers: masterPeers, ServerAddr: myMasterAddress, - DataDir: util.ResolvePath(*masterOption.metaFolder), + DataDir: util.ResolvePath(metaDir), Topo: ms.Topo, RaftResumeState: *masterOption.raftResumeState, HeartbeatInterval: *masterOption.heartbeatInterval, diff --git a/weed/command/mount.go b/weed/command/mount.go index 0e32a53e8..0046ca03d 100644 --- a/weed/command/mount.go +++ b/weed/command/mount.go @@ -86,7 +86,7 @@ var cmdMount = &Command{ This uses github.com/seaweedfs/fuse, which enables writing FUSE file systems on Linux, and OS X. - On OS X, it requires OSXFUSE (http://osxfuse.github.com/). + On OS X, it requires OSXFUSE (https://osxfuse.github.io/). `, } diff --git a/weed/command/scaffold/filer.toml b/weed/command/scaffold/filer.toml index 595fb2e62..c82de8da0 100644 --- a/weed/command/scaffold/filer.toml +++ b/weed/command/scaffold/filer.toml @@ -327,3 +327,13 @@ location = "/tmp/" address = "localhost:6379" password = "" database = 1 + +[tikv] +enabled = false +# If you have many pd address, use ',' split then: +# pdaddrs = "pdhost1:2379, pdhost2:2379, pdhost3:2379" +pdaddrs = "localhost:2379" +# Concurrency for TiKV delete range +deleterange_concurrency = 1 +# Enable 1PC +enable_1pc = false diff --git a/weed/command/update_full.go b/weed/command/update_full.go index 529f38219..185203aee 100644 --- a/weed/command/update_full.go +++ b/weed/command/update_full.go @@ -1,5 +1,5 @@ -//go:build elastic && ydb && gocdk && hdfs -// +build elastic,ydb,gocdk,hdfs +//go:build elastic && ydb && gocdk && tikv +// +build elastic,ydb,gocdk,tikv package command |
