aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-12-10 11:11:02 -0800
committerChris Lu <chris.lu@gmail.com>2020-12-10 11:11:02 -0800
commit83078ac6ce128b190c980cc7134b2c0c33b3d364 (patch)
tree30049ef4c57f36413d9ecfda2e7b279e60ab151f
parent26731694f88dbe28f5e088adaa6436fe7417fc72 (diff)
downloadseaweedfs-83078ac6ce128b190c980cc7134b2c0c33b3d364.tar.xz
seaweedfs-83078ac6ce128b190c980cc7134b2c0c33b3d364.zip
filer: change to /etc/seaweedfs folder on filer
fix https://github.com/chrislusf/seaweedfs/issues/1666
-rw-r--r--weed/filer/filer_conf.go11
-rw-r--r--weed/filer/filer_on_meta_event.go4
-rw-r--r--weed/server/filer_server_handlers_write_autochunk.go2
-rw-r--r--weed/shell/command_fs_configure.go4
4 files changed, 11 insertions, 10 deletions
diff --git a/weed/filer/filer_conf.go b/weed/filer/filer_conf.go
index 6a746f7ba..18ed37abd 100644
--- a/weed/filer/filer_conf.go
+++ b/weed/filer/filer_conf.go
@@ -13,10 +13,11 @@ import (
)
const (
- DirectoryEtc = "/etc"
- FilerConfName = "filer.conf"
- IamConfigDirecotry = "/etc/iam"
- IamIdentityFile = "identity.json"
+ DirectoryEtcRoot = "/etc"
+ DirectoryEtcSeaweedFS = "/etc/seaweedfs"
+ FilerConfName = "filer.conf"
+ IamConfigDirecotry = "/etc/iam"
+ IamIdentityFile = "identity.json"
)
type FilerConf struct {
@@ -31,7 +32,7 @@ func NewFilerConf() (fc *FilerConf) {
}
func (fc *FilerConf) loadFromFiler(filer *Filer) (err error) {
- filerConfPath := util.NewFullPath(DirectoryEtc, FilerConfName)
+ filerConfPath := util.NewFullPath(DirectoryEtcSeaweedFS, FilerConfName)
entry, err := filer.FindEntry(context.Background(), filerConfPath)
if err != nil {
if err == filer_pb.ErrNotFound {
diff --git a/weed/filer/filer_on_meta_event.go b/weed/filer/filer_on_meta_event.go
index 3de27da6e..d93a7e9e3 100644
--- a/weed/filer/filer_on_meta_event.go
+++ b/weed/filer/filer_on_meta_event.go
@@ -11,8 +11,8 @@ import (
// onMetadataChangeEvent is triggered after filer processed change events from local or remote filers
func (f *Filer) onMetadataChangeEvent(event *filer_pb.SubscribeMetadataResponse) {
- if DirectoryEtc != event.Directory {
- if DirectoryEtc != event.EventNotification.NewParentPath {
+ if DirectoryEtcSeaweedFS != event.Directory {
+ if DirectoryEtcSeaweedFS != event.EventNotification.NewParentPath {
return
}
}
diff --git a/weed/server/filer_server_handlers_write_autochunk.go b/weed/server/filer_server_handlers_write_autochunk.go
index 02c747225..0f6d0dc47 100644
--- a/weed/server/filer_server_handlers_write_autochunk.go
+++ b/weed/server/filer_server_handlers_write_autochunk.go
@@ -237,7 +237,7 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque
}
}
- if chunkOffset < fs.option.CacheToFilerLimit || strings.HasPrefix(r.URL.Path, filer.DirectoryEtc) && chunkOffset < 4*1024 {
+ if chunkOffset < fs.option.CacheToFilerLimit || strings.HasPrefix(r.URL.Path, filer.DirectoryEtcRoot) && chunkOffset < 4*1024 {
smallContent = content
}
return fileChunks, md5Hash, chunkOffset, nil, smallContent
diff --git a/weed/shell/command_fs_configure.go b/weed/shell/command_fs_configure.go
index 565e6c66e..497ef4f9e 100644
--- a/weed/shell/command_fs_configure.go
+++ b/weed/shell/command_fs_configure.go
@@ -62,7 +62,7 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io
var buf bytes.Buffer
if err = commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
- return filer.ReadEntry(commandEnv.MasterClient, client, filer.DirectoryEtc, filer.FilerConfName, &buf)
+ return filer.ReadEntry(commandEnv.MasterClient, client, filer.DirectoryEtcSeaweedFS, filer.FilerConfName, &buf)
}); err != nil && err != filer_pb.ErrNotFound {
return err
}
@@ -116,7 +116,7 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io
if *apply {
- if err := filer.SaveAs(commandEnv.option.FilerHost, int(commandEnv.option.FilerPort), filer.DirectoryEtc, filer.FilerConfName, "text/plain; charset=utf-8", &buf); err != nil {
+ if err := filer.SaveAs(commandEnv.option.FilerHost, int(commandEnv.option.FilerPort), filer.DirectoryEtcSeaweedFS, filer.FilerConfName, "text/plain; charset=utf-8", &buf); err != nil {
return err
}