From 15ecf4e3bff305e8142351007f96436d54e07976 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 30 Jun 2019 00:44:57 -0700 Subject: [PATCH] filer: default to leveldb2 --- docker/Dockerfile | 2 +- docker/Dockerfile.go_build | 2 +- docker/filer.toml | 4 ++-- weed/command/filer.go | 4 ++-- weed/server/filer_server.go | 5 +++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index f3afa88fd..38117a3dc 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,7 +33,7 @@ EXPOSE 9333 # s3 server http port EXPOSE 8333 -RUN mkdir -p /data/filerdb +RUN mkdir -p /data/filerldb2 VOLUME /data diff --git a/docker/Dockerfile.go_build b/docker/Dockerfile.go_build index 2f1948070..85cbb6143 100644 --- a/docker/Dockerfile.go_build +++ b/docker/Dockerfile.go_build @@ -16,7 +16,7 @@ EXPOSE 9333 # s3 server http port EXPOSE 8333 -RUN mkdir -p /data/filerdb +RUN mkdir -p /data/filerldb2 VOLUME /data diff --git a/docker/filer.toml b/docker/filer.toml index 5bf809cd8..a11e5de2b 100644 --- a/docker/filer.toml +++ b/docker/filer.toml @@ -1,3 +1,3 @@ -[leveldb] +[leveldb2] enabled = true -dir = "/data/filerdb" +dir = "/data/filerldb2" diff --git a/weed/command/filer.go b/weed/command/filer.go index 0288fa59f..b1ceb46f5 100644 --- a/weed/command/filer.go +++ b/weed/command/filer.go @@ -94,9 +94,9 @@ func (fo *FilerOptions) startFiler() { publicVolumeMux = http.NewServeMux() } - defaultLevelDbDirectory := "./filerdb" + defaultLevelDbDirectory := "./filerldb2" if fo.defaultLevelDbDirectory != nil { - defaultLevelDbDirectory = *fo.defaultLevelDbDirectory + "/filerdb" + defaultLevelDbDirectory = *fo.defaultLevelDbDirectory + "/filerldb2" } fs, nfs_err := weed_server.NewFilerServer(defaultMux, publicVolumeMux, &weed_server.FilerOption{ diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go index 50d90817b..b9e6aa23d 100644 --- a/weed/server/filer_server.go +++ b/weed/server/filer_server.go @@ -16,6 +16,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/filer2" _ "github.com/chrislusf/seaweedfs/weed/filer2/cassandra" _ "github.com/chrislusf/seaweedfs/weed/filer2/leveldb" + _ "github.com/chrislusf/seaweedfs/weed/filer2/leveldb2" _ "github.com/chrislusf/seaweedfs/weed/filer2/memdb" _ "github.com/chrislusf/seaweedfs/weed/filer2/mysql" _ "github.com/chrislusf/seaweedfs/weed/filer2/postgres" @@ -69,8 +70,8 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption) v := viper.GetViper() if !util.LoadConfiguration("filer", false) { - v.Set("leveldb.enabled", true) - v.Set("leveldb.dir", option.DefaultLevelDbDir) + v.Set("leveldb2.enabled", true) + v.Set("leveldb2.dir", option.DefaultLevelDbDir) _, err := os.Stat(option.DefaultLevelDbDir) if os.IsNotExist(err) { os.MkdirAll(option.DefaultLevelDbDir, 0755)