sunty
2020-04-13 c9d1acd4b7c0993b9a665e22489949ac227a2717
add volume to master server
1个文件已修改
4 ■■■■ 已修改文件
controllers/swfsControllers.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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