Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

Add publicUrl for master server

chrislusfeff83a87d126
diff --git a/go/util/constants.go b/go/util/constants.go
index 1aa59d634c..ca801574c6 100644
--- a/go/util/constants.go
+++ b/go/util/constants.go
@@ -1,5 +1,5 @@
package util
const (
- VERSION = "0.68"
+ VERSION = "0.69 beta"
)
diff --git a/go/weed/master.go b/go/weed/master.go
index 690662e1c4..1e2a6f0afc 100644
--- a/go/weed/master.go
+++ b/go/weed/master.go
@@ -29,8 +29,9 @@ var cmdMaster = &Command{
var (
mport = cmdMaster.Flag.Int("port", 9333, "http listen port")
- masterIp = cmdMaster.Flag.String("ip", "", "master listening ip address, default to listen on all network interfaces")
+ masterIp = cmdMaster.Flag.String("ip", "localhost", "master <ip>|<server> address")
masterBindIp = cmdMaster.Flag.String("ip.bind", "0.0.0.0", "ip address to bind to")
+ mPublicUrl = cmdMaster.Flag.String("publicUrl", "", "peer accessible <ip>|<server_name>:port")
metaFolder = cmdMaster.Flag.String("mdir", os.TempDir(), "data directory to store meta data")
masterPeers = cmdMaster.Flag.String("peers", "", "other master nodes in comma separated ip:port list")
volumeSizeLimitMB = cmdMaster.Flag.Uint("volumeSizeLimitMB", 30*1000, "Master stops directing writes to oversized volumes.")
@@ -75,10 +76,10 @@ func runMaster(cmd *Command, args []string) bool {
go func() {
time.Sleep(100 * time.Millisecond)
- if *masterIp == "" {
- *masterIp = "localhost"
- }
myMasterAddress := *masterIp + ":" + strconv.Itoa(*mport)
+ if *mPublicUrl != "" {
+ myMasterAddress = *mPublicUrl
+ }
var peers []string
if *masterPeers != "" {
peers = strings.Split(*masterPeers, ",")
diff --git a/go/weed/server.go b/go/weed/server.go
index e86d0ba757..a758f887f1 100644
--- a/go/weed/server.go
+++ b/go/weed/server.go
@@ -47,7 +47,7 @@ var cmdServer = &Command{
}
var (
- serverIp = cmdServer.Flag.String("ip", "", "ip or server name")
+ serverIp = cmdServer.Flag.String("ip", "localhost", "ip or server name")
serverPublicUrl = cmdServer.Flag.String("publicUrl", "", "publicly accessible address")
serverBindIp = cmdServer.Flag.String("ip.bind", "0.0.0.0", "ip address to bind to")
serverMaxCpu = cmdServer.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs")
@@ -99,10 +99,6 @@ func runServer(cmd *Command, args []string) bool {
defer pprof.StopCPUProfile()
}
- if *serverIp == "" {
- *serverIp = "localhost"
- }
-
if *filerOptions.redirectOnRead {
*isStartingFiler = true
}