sunty
2020-04-13 c9d1acd4b7c0993b9a665e22489949ac227a2717
controllers/swfsControllers.go
@@ -30,7 +30,6 @@
   oldPeers := GetOldPeers(config.Server.ScriptPath, StartServerScript)
   newPeers := GetNewPeers()
   UpdatePeers(config.Server.ScriptPath, StartServerScript, oldPeers, newPeers)
   ReplaceLineContentBySearch(StartScriptAsVolume, config.Server.ScriptPath, StartServerScript)
}
// @Security ApiKeyAuth
@@ -48,7 +47,6 @@
   c.BindJSON(&body)
   role := body.Role
   if role == "master" {
      AddNewMasterToPeers()
      AsMaster()
      util.ResponseFormat(c, code.AddSuccess, "加入节点成功")
      return
@@ -70,6 +68,7 @@
func (sc *SeaweedfsController) RoleOfVolumeToMasterController(c *gin.Context) {
   AsMaster()
   ReplaceLineContentBySearch(StartScriptAsMaster, config.Server.ScriptPath, StartServerScript)
}
func (sc *SeaweedfsController) RestartMasterController(c *gin.Context) {
@@ -189,6 +188,7 @@
//作为主节点加入(默认包含数据节点)
func AsMaster() bool {
   AddNewMasterToPeers()
   nowPeers := GetNowPeersList()
   RequestMasterNodesOperation(nowPeers)
   return true