Browse Source

filer: default to leveldb2

pull/997/head
Chris Lu 6 years ago
parent
commit
15ecf4e3bf
  1. 2
      docker/Dockerfile
  2. 2
      docker/Dockerfile.go_build
  3. 4
      docker/filer.toml
  4. 4
      weed/command/filer.go
  5. 5
      weed/server/filer_server.go

2
docker/Dockerfile

@ -33,7 +33,7 @@ EXPOSE 9333
# s3 server http port # s3 server http port
EXPOSE 8333 EXPOSE 8333
RUN mkdir -p /data/filerdb
RUN mkdir -p /data/filerldb2
VOLUME /data VOLUME /data

2
docker/Dockerfile.go_build

@ -16,7 +16,7 @@ EXPOSE 9333
# s3 server http port # s3 server http port
EXPOSE 8333 EXPOSE 8333
RUN mkdir -p /data/filerdb
RUN mkdir -p /data/filerldb2
VOLUME /data VOLUME /data

4
docker/filer.toml

@ -1,3 +1,3 @@
[leveldb]
[leveldb2]
enabled = true enabled = true
dir = "/data/filerdb"
dir = "/data/filerldb2"

4
weed/command/filer.go

@ -94,9 +94,9 @@ func (fo *FilerOptions) startFiler() {
publicVolumeMux = http.NewServeMux() publicVolumeMux = http.NewServeMux()
} }
defaultLevelDbDirectory := "./filerdb"
defaultLevelDbDirectory := "./filerldb2"
if fo.defaultLevelDbDirectory != nil { if fo.defaultLevelDbDirectory != nil {
defaultLevelDbDirectory = *fo.defaultLevelDbDirectory + "/filerdb"
defaultLevelDbDirectory = *fo.defaultLevelDbDirectory + "/filerldb2"
} }
fs, nfs_err := weed_server.NewFilerServer(defaultMux, publicVolumeMux, &weed_server.FilerOption{ fs, nfs_err := weed_server.NewFilerServer(defaultMux, publicVolumeMux, &weed_server.FilerOption{

5
weed/server/filer_server.go

@ -16,6 +16,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/filer2" "github.com/chrislusf/seaweedfs/weed/filer2"
_ "github.com/chrislusf/seaweedfs/weed/filer2/cassandra" _ "github.com/chrislusf/seaweedfs/weed/filer2/cassandra"
_ "github.com/chrislusf/seaweedfs/weed/filer2/leveldb" _ "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/memdb"
_ "github.com/chrislusf/seaweedfs/weed/filer2/mysql" _ "github.com/chrislusf/seaweedfs/weed/filer2/mysql"
_ "github.com/chrislusf/seaweedfs/weed/filer2/postgres" _ "github.com/chrislusf/seaweedfs/weed/filer2/postgres"
@ -69,8 +70,8 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
v := viper.GetViper() v := viper.GetViper()
if !util.LoadConfiguration("filer", false) { 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) _, err := os.Stat(option.DefaultLevelDbDir)
if os.IsNotExist(err) { if os.IsNotExist(err) {
os.MkdirAll(option.DefaultLevelDbDir, 0755) os.MkdirAll(option.DefaultLevelDbDir, 0755)

Loading…
Cancel
Save