From f8b1aa69a132b7899b369291610e9f9129fb0451 Mon Sep 17 00:00:00 2001 From: Cory LaNou Date: Mon, 1 Feb 2016 12:47:15 -0500 Subject: [PATCH] ignore join arguments on restart --- cmd/influxd/run/command.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/influxd/run/command.go b/cmd/influxd/run/command.go index 47e9bf6659..5ef967e389 100644 --- a/cmd/influxd/run/command.go +++ b/cmd/influxd/run/command.go @@ -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.