Skip to content

Commit

Permalink
cluster/import: read enable_binlog from inventory (#652)
Browse files Browse the repository at this point in the history
Co-authored-by: july2993 <july2993@gmail.com>
  • Loading branch information
AstroProfundis and july2993 authored Aug 10, 2020
1 parent 80da63c commit aca7d01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/cluster/ansible/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"io"
"os"
"path/filepath"
"strconv"

"github.com/pingcap/errors"
"github.com/pingcap/tiup/pkg/cluster/spec"
Expand Down Expand Up @@ -76,10 +77,15 @@ func parseInventoryFile(invFile io.Reader) (string, *spec.ClusterMeta, *aini.Inv
if host.Vars["process_supervision"] != "systemd" {
return "", nil, inventory, errors.New("only support cluster deployed with systemd")
}
clsName = host.Vars["cluster_name"]

clsMeta.User = host.Vars["ansible_user"]
clsMeta.Topology.GlobalOptions.User = clsMeta.User
clsMeta.Version = host.Vars["tidb_version"]
clsName = host.Vars["cluster_name"]

if enableBinlog, err := strconv.ParseBool(host.Vars["enable_binlog"]); err == nil && enableBinlog {
clsMeta.Topology.ServerConfigs.TiDB["binlog.enable"] = enableBinlog
}

// only read the first host, all global vars should be the same
break
Expand Down

0 comments on commit aca7d01

Please sign in to comment.