Merge pull request #5494 from influxdata/ignore-join-urls

Ignore join arguments on restart
pull/5498/head
Cory LaNou 2016-02-01 12:28:44 -06:00
commit 953584aa31
1 changed files with 8 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import (
"time"
"github.com/BurntSushi/toml"
"github.com/influxdb/influxdb"
)
const logo = `
@ -94,8 +95,13 @@ func (cmd *Command) Run(args ...string) error {
return fmt.Errorf("apply env config: %v", err)
}
if options.Join != "" {
config.Meta.JoinPeers = strings.Split(options.Join, ",")
// If we have a node ID, ignore the join argument
// 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.