add volume to master server
| | |
| | | oldPeers := GetOldPeers(config.Server.ScriptPath, StartServerScript) |
| | | newPeers := GetNewPeers() |
| | | UpdatePeers(config.Server.ScriptPath, StartServerScript, oldPeers, newPeers) |
| | | ReplaceLineContentBySearch(StartScriptAsVolume, config.Server.ScriptPath, StartServerScript) |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | |
| | | c.BindJSON(&body) |
| | | role := body.Role |
| | | if role == "master" { |
| | | AddNewMasterToPeers() |
| | | AsMaster() |
| | | util.ResponseFormat(c, code.AddSuccess, "加入节点成功") |
| | | return |
| | |
| | | |
| | | func (sc *SeaweedfsController) RoleOfVolumeToMasterController(c *gin.Context) { |
| | | AsMaster() |
| | | ReplaceLineContentBySearch(StartScriptAsMaster, config.Server.ScriptPath, StartServerScript) |
| | | } |
| | | |
| | | func (sc *SeaweedfsController) RestartMasterController(c *gin.Context) { |
| | |
| | | |
| | | //作为主节点加入(默认包含数据节点) |
| | | func AsMaster() bool { |
| | | AddNewMasterToPeers() |
| | | nowPeers := GetNowPeersList() |
| | | RequestMasterNodesOperation(nowPeers) |
| | | return true |