aboutsummaryrefslogtreecommitdiff
path: root/weed/filer2/configuration.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-05-27 11:52:26 -0700
committerChris Lu <chris.lu@gmail.com>2018-05-27 11:52:26 -0700
commit458ada173ed6df2933c35fe0d3e3dd9457d3a975 (patch)
tree30f174c167b3299eedde32419ad1894f43cd544d /weed/filer2/configuration.go
parent8647191bee2027232105b20b5c110ffda225f9ba (diff)
downloadseaweedfs-458ada173ed6df2933c35fe0d3e3dd9457d3a975.tar.xz
seaweedfs-458ada173ed6df2933c35fe0d3e3dd9457d3a975.zip
go fmt
Diffstat (limited to 'weed/filer2/configuration.go')
-rw-r--r--weed/filer2/configuration.go20
1 files changed, 9 insertions, 11 deletions
diff --git a/weed/filer2/configuration.go b/weed/filer2/configuration.go
index 16c0f3fd0..46ed9e056 100644
--- a/weed/filer2/configuration.go
+++ b/weed/filer2/configuration.go
@@ -3,8 +3,8 @@ package filer2
import (
"os"
- "github.com/spf13/viper"
"github.com/chrislusf/seaweedfs/weed/glog"
+ "github.com/spf13/viper"
)
const (
@@ -20,12 +20,11 @@ enabled = false
enabled = false
dir = "." # directory to store level db files
-[mysql]
+####################################################
# multiple filers on shared storage, fairly scalable
-#
-# need to choose or create a database.
-# need to manually create a table "filemeta".
-#
+####################################################
+
+[mysql]
# CREATE TABLE IF NOT EXISTS filemeta (
# dirhash BIGINT COMMENT 'first 64 bits of MD5 hash value of directory field',
# name VARCHAR(1000) COMMENT 'directory or file name',
@@ -33,7 +32,6 @@ dir = "." # directory to store level db files
# meta BLOB,
# PRIMARY KEY (dirhash, name)
# ) DEFAULT CHARSET=utf8;
-#
enabled = true
hostname = "localhost"
port = 3306
@@ -90,10 +88,10 @@ var (
func (f *Filer) LoadConfiguration() {
// find a filer store
- viper.SetConfigName("filer") // name of config file (without extension)
- viper.AddConfigPath(".") // optionally look for config in the working directory
- viper.AddConfigPath("$HOME/.seaweedfs") // call multiple times to add many search paths
- viper.AddConfigPath("/etc/seaweedfs/") // path to look for the config file in
+ viper.SetConfigName("filer") // name of config file (without extension)
+ viper.AddConfigPath(".") // optionally look for config in the working directory
+ viper.AddConfigPath("$HOME/.seaweedfs") // call multiple times to add many search paths
+ viper.AddConfigPath("/etc/seaweedfs/") // path to look for the config file in
if err := viper.ReadInConfig(); err != nil { // Handle errors reading the config file
glog.Fatalf("Failed to load filer.toml file from current directory, or $HOME/.seaweedfs/, or /etc/seaweedfs/" +
"\n\nPlease follow this example and add a filer.toml file to " +