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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
default to use os.TempDir() instead of hard coded "/tmp"
Chris Lu2e70cc8be77d
diff --git a/go/weed/master.go b/go/weed/master.goindex 6d01ef3bc6..2d7adef1f5 100644--- a/go/weed/master.go+++ b/go/weed/master.go@@ -10,6 +10,7 @@ import ("encoding/json""errors""net/http"+ "os""runtime""strconv""strings"@@ -32,7 +33,7 @@ var cmdMaster = &Command{var (mport = cmdMaster.Flag.Int("port", 9333, "http listen port")- metaFolder = cmdMaster.Flag.String("mdir", "/tmp", "data directory to store mappings")+ metaFolder = cmdMaster.Flag.String("mdir", os.TempDir(), "data directory to store mappings")volumeSizeLimitMB = cmdMaster.Flag.Uint("volumeSizeLimitMB", 32*1024, "Default Volume Size in MegaBytes")mpulse = cmdMaster.Flag.Int("pulseSeconds", 5, "number of seconds between heartbeats")confFile = cmdMaster.Flag.String("conf", "/etc/weedfs/weedfs.conf", "xml configuration file")diff --git a/go/weed/volume.go b/go/weed/volume.goindex 34c2bc30b4..3c4db7ff18 100644--- a/go/weed/volume.go+++ b/go/weed/volume.go@@ -31,7 +31,7 @@ var cmdVolume = &Command{var (vport = cmdVolume.Flag.Int("port", 8080, "http listen port")- volumeFolders = cmdVolume.Flag.String("dir", "/tmp", "directories to store data files. dir[,dir]...")+ volumeFolders = cmdVolume.Flag.String("dir", os.TempDir(), "directories to store data files. dir[,dir]...")maxVolumeCounts = cmdVolume.Flag.String("max", "7", "maximum numbers of volumes, count[,count]...")ip = cmdVolume.Flag.String("ip", "localhost", "ip or server name")publicUrl = cmdVolume.Flag.String("publicUrl", "", "Publicly accessible <ip|server_name>:<port>")