Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster/import: read enable_binlog from inventory #652

Merged
merged 2 commits into from
Aug 10, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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