Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions config/tablet/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,32 @@ db:
user: vt_app # db_app_user
password: # db_app_password
useSsl: true # db_app_use_ssl
preferSocket: true
preferTcp: false
dba:
user: vt_dba # db_dba_user
password: # db_dba_password
useSsl: true # db_dba_use_ssl
preferSocket: true
preferTcp: false
filtered:
user: vt_filtered # db_filtered_user
password: # db_filtered_password
useSsl: true # db_filtered_use_ssl
preferSocket: true
preferTcp: false
repl:
user: vt_repl # db_repl_user
password: # db_repl_password
useSsl: true # db_repl_use_ssl
preferSocket: true
preferTcp: false
appdebug:
user: vt_appdebug # db_appdebug_user
password: # db_appdebug_password
useSsl: true # db_appdebug_use_ssl
preferSocket: true
preferTcp: false
allprivs:
user: vt_allprivs # db_allprivs_user
password: # db_allprivs_password
useSsl: true # db_allprivs_use_ssl
preferSocket: true
preferTcp: false

oltpReadPool:
size: 16 # queryserver-config-pool-size
Expand Down
5 changes: 1 addition & 4 deletions go/cmd/vtcombo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ func main() {
servenv.Init()
tabletenv.Init()

dbcfgs, err := dbconfigs.Init("")
if err != nil {
log.Warning(err)
}
dbcfgs := dbconfigs.GlobalDBConfigs.Init("")
mysqld := mysqlctl.NewMysqld(dbcfgs)
servenv.OnClose(mysqld.Close)

Expand Down
19 changes: 8 additions & 11 deletions go/cmd/vttablet/vttablet.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"io/ioutil"

"golang.org/x/net/context"
"sigs.k8s.io/yaml"
"vitess.io/vitess/go/vt/dbconfigs"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/mysqlctl"
Expand All @@ -34,6 +33,7 @@ import (
"vitess.io/vitess/go/vt/vttablet/tabletmanager"
"vitess.io/vitess/go/vt/vttablet/tabletserver"
"vitess.io/vitess/go/vt/vttablet/tabletserver/tabletenv"
"vitess.io/vitess/go/yaml2"
)

var (
Expand Down Expand Up @@ -67,12 +67,12 @@ func main() {
if err != nil {
log.Exitf("error reading config file %s: %v", *tabletConfig, err)
}
if err := yaml.Unmarshal(bytes, config); err != nil {
if err := yaml2.Unmarshal(bytes, config); err != nil {
log.Exitf("error parsing config file %s: %v", bytes, err)
}
gotBytes, _ := yaml.Marshal(config)
log.Infof("Loaded config file %s successfully:\n%s", *tabletConfig, gotBytes)
}
gotBytes, _ := yaml2.Marshal(config)
log.Infof("Loaded config file %s successfully:\n%s", *tabletConfig, gotBytes)

servenv.Init()

Expand All @@ -90,7 +90,7 @@ func main() {
// and use the socket from it. If connection parameters were specified,
// we assume that the mysql is not local, and we skip loading mycnf.
// This also means that backup and restore will not be allowed.
if !dbconfigs.HasConnectionParams() {
if !config.DB.HasGlobalSettings() {
var err error
if mycnf, err = mysqlctl.NewMycnfFromFlags(tabletAlias.Uid); err != nil {
log.Exitf("mycnf read failed: %v", err)
Expand All @@ -103,10 +103,7 @@ func main() {
// If connection parameters were specified, socketFile will be empty.
// Otherwise, the socketFile (read from mycnf) will be used to initialize
// dbconfigs.
dbcfgs, err := dbconfigs.Init(socketFile)
if err != nil {
log.Warning(err)
}
config.DB = config.DB.Init(socketFile)

if *tableACLConfig != "" {
// To override default simpleacl, other ACL plugins must set themselves to be default ACL factory
Expand All @@ -133,15 +130,15 @@ func main() {
// Create mysqld and register the health reporter (needs to be done
// before initializing the agent, so the initial health check
// done by the agent has the right reporter)
mysqld := mysqlctl.NewMysqld(dbcfgs)
mysqld := mysqlctl.NewMysqld(config.DB)
servenv.OnClose(mysqld.Close)

// Depends on both query and updateStream.
gRPCPort := int32(0)
if servenv.GRPCPort != nil {
gRPCPort = int32(*servenv.GRPCPort)
}
agent, err = tabletmanager.NewActionAgent(context.Background(), ts, mysqld, qsc, tabletAlias, dbcfgs, mycnf, int32(*servenv.Port), gRPCPort)
agent, err = tabletmanager.NewActionAgent(context.Background(), ts, mysqld, qsc, tabletAlias, config.DB, mycnf, int32(*servenv.Port), gRPCPort)
if err != nil {
log.Exitf("NewActionAgent() failed: %v", err)
}
Expand Down
Loading