mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-25 16:58:57 +08:00
textual changes
This commit is contained in:
parent
bd1c0735e0
commit
cd8a3b99bb
@ -32,6 +32,12 @@ func (c *commandVolumeFixReplication) Help() string {
|
|||||||
volume.fix.replication -n # do not take action
|
volume.fix.replication -n # do not take action
|
||||||
volume.fix.replication # actually copying the volume files and mount the volume
|
volume.fix.replication # actually copying the volume files and mount the volume
|
||||||
|
|
||||||
|
Note:
|
||||||
|
* each time this will only add back one replica for one volume id. If there are multiple replicas
|
||||||
|
are missing, e.g. multiple volume servers are new, you may need to run this multiple times.
|
||||||
|
* do not run this too quick within seconds, since the new volume replica may take a few seconds
|
||||||
|
to register itself to the master.
|
||||||
|
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/chrislusf/seaweedfs/weed/wdclient"
|
"github.com/chrislusf/seaweedfs/weed/wdclient"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
line *liner.State
|
line *liner.State
|
||||||
historyPath = "/tmp/weed-shell"
|
historyPath = path.Join(os.TempDir(), "weed-shell")
|
||||||
)
|
)
|
||||||
|
|
||||||
func RunShell(options ShellOptions) {
|
func RunShell(options ShellOptions) {
|
||||||
@ -26,9 +27,9 @@ func RunShell(options ShellOptions) {
|
|||||||
line.SetCtrlCAborts(true)
|
line.SetCtrlCAborts(true)
|
||||||
|
|
||||||
setCompletionHandler()
|
setCompletionHandler()
|
||||||
loadHisotry()
|
loadHistory()
|
||||||
|
|
||||||
defer saveHisotry()
|
defer saveHistory()
|
||||||
|
|
||||||
reg, _ := regexp.Compile(`'.*?'|".*?"|\S+`)
|
reg, _ := regexp.Compile(`'.*?'|".*?"|\S+`)
|
||||||
|
|
||||||
@ -129,14 +130,14 @@ func setCompletionHandler() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadHisotry() {
|
func loadHistory() {
|
||||||
if f, err := os.Open(historyPath); err == nil {
|
if f, err := os.Open(historyPath); err == nil {
|
||||||
line.ReadHistory(f)
|
line.ReadHistory(f)
|
||||||
f.Close()
|
f.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func saveHisotry() {
|
func saveHistory() {
|
||||||
if f, err := os.Create(historyPath); err != nil {
|
if f, err := os.Create(historyPath); err != nil {
|
||||||
fmt.Printf("Error writing history file: %v\n", err)
|
fmt.Printf("Error writing history file: %v\n", err)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user