MCPcopy
hub / github.com/cubefs/cubefs / stopDatanodeInSpecificNode

Function stopDatanodeInSpecificNode

deploy/cmd/datanode.go:182–202  ·  view source on GitHub ↗
(node string)

Source from the content-addressed store, hash-verified

180}
181
182func stopDatanodeInSpecificNode(node string) error {
183 config, err := readConfig()
184 if err != nil {
185 return err
186 }
187 for id, n := range config.DeployHostsList.DataNode {
188 if n.Hosts == node {
189 status, err := stopContainerOnNode(RemoteUser, node, DataNodeName+strconv.Itoa(id+1))
190 if err != nil {
191 return err
192 }
193 log.Println(status)
194 status, err = rmContainerOnNode(RemoteUser, node, DataNodeName+strconv.Itoa(id+1))
195 if err != nil {
196 return err
197 }
198 log.Println(status)
199 }
200 }
201 return nil
202}
203
204func stopAllDataNode() error {
205 files, err := ioutil.ReadDir(ConfDir)

Callers 2

stop.goFile · 0.85
restart.goFile · 0.85

Calls 4

readConfigFunction · 0.85
stopContainerOnNodeFunction · 0.85
rmContainerOnNodeFunction · 0.85
PrintlnMethod · 0.65

Tested by

no test coverage detected