@ -41,6 +41,7 @@ type VolumeServerOptions struct {
folderMaxLimits [ ] int32
folderMaxLimits [ ] int32
idxFolder * string
idxFolder * string
ip * string
ip * string
id * string
publicUrl * string
publicUrl * string
bindIp * string
bindIp * string
mastersString * string
mastersString * string
@ -78,6 +79,7 @@ func init() {
v . portGrpc = cmdVolume . Flag . Int ( "port.grpc" , 0 , "grpc listen port" )
v . portGrpc = cmdVolume . Flag . Int ( "port.grpc" , 0 , "grpc listen port" )
v . publicPort = cmdVolume . Flag . Int ( "port.public" , 0 , "port opened to public" )
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 . 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 . 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 . 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" )
v . mastersString = cmdVolume . Flag . String ( "master" , "localhost:9333" , "comma-separated master servers" )
@ -253,8 +255,14 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v
volumeNeedleMapKind = storage . NeedleMapLevelDbLarge
volumeNeedleMapKind = storage . NeedleMapLevelDbLarge
}
}
// Determine volume server ID: if not specified, use ip:port
volumeServerId := * v . id
if volumeServerId == "" {
volumeServerId = util . JoinHostPort ( * v . ip , * v . port )
}
volumeServer := weed_server . NewVolumeServer ( volumeMux , publicVolumeMux ,
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 . folders , v . folderMaxLimits , minFreeSpaces , diskTypes ,
* v . idxFolder ,
* v . idxFolder ,
volumeNeedleMapKind ,
volumeNeedleMapKind ,