Merge pull request #5494 from influxdata/ignore-join-urls
Ignore join arguments on restartpull/5498/head
commit
953584aa31
|
@ -14,6 +14,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/BurntSushi/toml"
|
"github.com/BurntSushi/toml"
|
||||||
|
"github.com/influxdb/influxdb"
|
||||||
)
|
)
|
||||||
|
|
||||||
const logo = `
|
const logo = `
|
||||||
|
@ -94,8 +95,13 @@ func (cmd *Command) Run(args ...string) error {
|
||||||
return fmt.Errorf("apply env config: %v", err)
|
return fmt.Errorf("apply env config: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.Join != "" {
|
// If we have a node ID, ignore the join argument
|
||||||
config.Meta.JoinPeers = strings.Split(options.Join, ",")
|
// We are not using the reference to this node var, just checking
|
||||||
|
// to see if we have a node ID on disk
|
||||||
|
if node, _ := influxdb.LoadNode(config.Meta.Dir, config.Meta.HTTPBindAddress); node == nil || node.ID == 0 {
|
||||||
|
if options.Join != "" {
|
||||||
|
config.Meta.JoinPeers = strings.Split(options.Join, ",")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate the configuration.
|
// Validate the configuration.
|
||||||
|
|
Loading…
Reference in New Issue