mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
main: use node name as default dir
We use nodeID as the default dir previously. It works fine before we do dynamic nodeID generation (introducing time). After the change the dynamic nodeID will change every time we restart the etcd process. If the user does not provide the data dir, the default dir will change every time. It is not the desired behavior. In this commit, we change the default data dir to node name. If the user changes the node name and does provide the data dir, etcd still cannot recover from previous state. But it is much better than using nodeID. And it is actually a doucmentation issue. Conflicts: main.go
This commit is contained in:
2
main.go
2
main.go
@@ -134,7 +134,7 @@ func startEtcd() {
|
||||
}
|
||||
|
||||
if *dir == "" {
|
||||
*dir = fmt.Sprintf("%v_etcd_data", self.ID)
|
||||
*dir = fmt.Sprintf("%v_etcd_data", self.Name)
|
||||
log.Printf("etcd: no data-dir provided, using default data-dir ./%s", *dir)
|
||||
}
|
||||
if err := os.MkdirAll(*dir, privateDirMode); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user