|
@ -6,10 +6,13 @@ import ( |
|
|
"net/http" |
|
|
"net/http" |
|
|
"os" |
|
|
"os" |
|
|
"runtime" |
|
|
"runtime" |
|
|
|
|
|
"sort" |
|
|
|
|
|
"strings" |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
"google.golang.org/grpc/reflection" |
|
|
"google.golang.org/grpc/reflection" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/chrislusf/seaweedfs/weed/filer" |
|
|
"github.com/chrislusf/seaweedfs/weed/glog" |
|
|
"github.com/chrislusf/seaweedfs/weed/glog" |
|
|
"github.com/chrislusf/seaweedfs/weed/pb" |
|
|
"github.com/chrislusf/seaweedfs/weed/pb" |
|
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_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") |
|
|
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
|
|
|
//create or overwrite the file, the directories /path/to will be automatically created
|
|
|
POST /path/to/file |
|
|
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" |
|
|
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 { |
|
|
func runFiler(cmd *Command, args []string) bool { |
|
|