aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/scaffold/filer.toml18
-rw-r--r--weed/command/server.go1
-rw-r--r--weed/command/volume.go7
3 files changed, 25 insertions, 1 deletions
diff --git a/weed/command/scaffold/filer.toml b/weed/command/scaffold/filer.toml
index 61a7ced6d..9261591c4 100644
--- a/weed/command/scaffold/filer.toml
+++ b/weed/command/scaffold/filer.toml
@@ -201,8 +201,11 @@ table = "seaweedfs"
[redis2]
enabled = false
address = "localhost:6379"
+username = ""
password = ""
database = 0
+# prefix for filer redis keys
+keyPrefix = ""
enable_tls = false
ca_cert_path = ""
client_cert_path = ""
@@ -217,6 +220,8 @@ masterName = "master"
username = ""
password = ""
database = 0
+# prefix for filer redis keys
+keyPrefix = ""
enable_tls = false
ca_cert_path = ""
client_cert_path = ""
@@ -232,7 +237,10 @@ addresses = [
"localhost:30005",
"localhost:30006",
]
+username = ""
password = ""
+# prefix for filer redis keys
+keyPrefix = ""
enable_tls = false
ca_cert_path = ""
client_cert_path = ""
@@ -248,8 +256,11 @@ superLargeDirectories = []
[redis_lua]
enabled = false
address = "localhost:6379"
+username = ""
password = ""
database = 0
+# prefix for filer redis keys
+keyPrefix = ""
enable_tls = false
ca_cert_path = ""
client_cert_path = ""
@@ -264,6 +275,8 @@ masterName = "master"
username = ""
password = ""
database = 0
+# prefix for filer redis keys
+keyPrefix = ""
enable_tls = false
ca_cert_path = ""
client_cert_path = ""
@@ -279,7 +292,10 @@ addresses = [
"localhost:30005",
"localhost:30006",
]
+username = ""
password = ""
+# prefix for filer redis keys
+keyPrefix = ""
enable_tls = false
ca_cert_path = ""
client_cert_path = ""
@@ -373,8 +389,10 @@ dialTimeOut = 10
enabled = false
location = "/tmp/"
address = "localhost:6379"
+username = ""
password = ""
database = 1
+keyPrefix = ""
[tikv]
enabled = false
diff --git a/weed/command/server.go b/weed/command/server.go
index 52f47ec32..ebd9f359a 100644
--- a/weed/command/server.go
+++ b/weed/command/server.go
@@ -134,6 +134,7 @@ func init() {
serverOptions.v.port = cmdServer.Flag.Int("volume.port", 8080, "volume server http listen port")
serverOptions.v.portGrpc = cmdServer.Flag.Int("volume.port.grpc", 0, "volume server grpc listen port")
serverOptions.v.publicPort = cmdServer.Flag.Int("volume.port.public", 0, "volume server public port")
+ serverOptions.v.id = cmdServer.Flag.String("volume.id", "", "volume server id. If empty, default to ip:port")
serverOptions.v.indexType = cmdServer.Flag.String("volume.index", "memory", "Choose [memory|leveldb|leveldbMedium|leveldbLarge] mode for memory~performance balance.")
serverOptions.v.diskType = cmdServer.Flag.String("volume.disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")
serverOptions.v.fixJpgOrientation = cmdServer.Flag.Bool("volume.images.fix.orientation", false, "Adjust jpg orientation when uploading.")
diff --git a/weed/command/volume.go b/weed/command/volume.go
index e21437e9a..514553172 100644
--- a/weed/command/volume.go
+++ b/weed/command/volume.go
@@ -41,6 +41,7 @@ type VolumeServerOptions struct {
folderMaxLimits []int32
idxFolder *string
ip *string
+ id *string
publicUrl *string
bindIp *string
mastersString *string
@@ -78,6 +79,7 @@ func init() {
v.portGrpc = cmdVolume.Flag.Int("port.grpc", 0, "grpc listen port")
v.publicPort = cmdVolume.Flag.Int("port.public", 0, "port opened to public")
v.ip = cmdVolume.Flag.String("ip", util.DetectedHostAddress(), "ip or server name, also used as identifier")
+ v.id = cmdVolume.Flag.String("id", "", "volume server id. If empty, default to ip:port")
v.publicUrl = cmdVolume.Flag.String("publicUrl", "", "Publicly accessible address")
v.bindIp = cmdVolume.Flag.String("ip.bind", "", "ip address to bind to. If empty, default to same as -ip option.")
v.mastersString = cmdVolume.Flag.String("master", "localhost:9333", "comma-separated master servers")
@@ -253,8 +255,11 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v
volumeNeedleMapKind = storage.NeedleMapLevelDbLarge
}
+ // Determine volume server ID: if not specified, use ip:port
+ volumeServerId := util.GetVolumeServerId(*v.id, *v.ip, *v.port)
+
volumeServer := weed_server.NewVolumeServer(volumeMux, publicVolumeMux,
- *v.ip, *v.port, *v.portGrpc, *v.publicUrl,
+ *v.ip, *v.port, *v.portGrpc, *v.publicUrl, volumeServerId,
v.folders, v.folderMaxLimits, minFreeSpaces, diskTypes,
*v.idxFolder,
volumeNeedleMapKind,