Skip to content

Commit

Permalink
update: update config and code filed from ebsAddr to blobstore
Browse files Browse the repository at this point in the history
Signed-off-by: leonrayang <[email protected]>
  • Loading branch information
leonrayang committed Aug 19, 2022
1 parent eb3dda7 commit f93fbe3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion master/api_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (m *Server) getIPAddr(w http.ResponseWriter, r *http.Request) {
DataNodeDeleteLimitRate: limitRate,
DataNodeAutoRepairLimitRate: autoRepairRate,
Ip: strings.Split(r.RemoteAddr, ":")[0],
EbsAddr: m.ebsAddr,
EbsAddr: m.bStoreAddr,
ServicePath: m.servicePath,
}

Expand Down
16 changes: 11 additions & 5 deletions master/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const (
WalDir = "walDir"
StoreDir = "storeDir"
EbsAddrKey = "ebsAddr"
BStoreAddrKey = "bStoreAddr"
EbsServicePathKey = "ebsServicePath"
BStoreServicePathKey = "bStoreServicePath"
GroupID = 1
ModuleName = "master"
CfgRetainLogs = "retainLogs"
Expand Down Expand Up @@ -104,7 +106,7 @@ type Server struct {
port string
walDir string
storeDir string
ebsAddr string
bStoreAddr string
servicePath string
retainLogs uint64
tickInterval int
Expand Down Expand Up @@ -188,11 +190,15 @@ func (m *Server) checkConfig(cfg *config.Config) (err error) {
m.port = cfg.GetString(proto.ListenPort)
m.walDir = cfg.GetString(WalDir)
m.storeDir = cfg.GetString(StoreDir)
m.ebsAddr = cfg.GetString(EbsAddrKey)
m.servicePath = cfg.GetString(EbsServicePathKey)

m.bStoreAddr = cfg.GetString(BStoreAddrKey)
if m.bStoreAddr == "" {
m.bStoreAddr = cfg.GetString(EbsAddrKey)
}
m.servicePath = cfg.GetString(BStoreServicePathKey)
if m.servicePath == "" {
m.servicePath = cfg.GetString(EbsServicePathKey)
}
peerAddrs := cfg.GetString(cfgPeers)

if m.ip == "" || m.port == "" || m.walDir == "" || m.storeDir == "" || m.clusterName == "" || peerAddrs == "" {
return fmt.Errorf("%v,err:%v,%v,%v,%v,%v,%v,%v", proto.ErrInvalidCfg, "one of (ip,listen,walDir,storeDir,clusterName) is null",
m.ip, m.port, m.walDir, m.storeDir, m.clusterName, peerAddrs)
Expand Down

0 comments on commit f93fbe3

Please sign in to comment.