Merge branch 'master' into resurrect
This commit is contained in:
commit
776c8d3b8b
@ -89,6 +89,8 @@ type MigrationContext struct {
|
|||||||
ConfigFile string
|
ConfigFile string
|
||||||
CliUser string
|
CliUser string
|
||||||
CliPassword string
|
CliPassword string
|
||||||
|
CliMasterUser string
|
||||||
|
CliMasterPassword string
|
||||||
|
|
||||||
HeartbeatIntervalMilliseconds int64
|
HeartbeatIntervalMilliseconds int64
|
||||||
defaultNumRetries int64
|
defaultNumRetries int64
|
||||||
|
@ -50,6 +50,8 @@ func main() {
|
|||||||
flag.IntVar(&migrationContext.InspectorConnectionConfig.Key.Port, "port", 3306, "MySQL port (preferably a replica, not the master)")
|
flag.IntVar(&migrationContext.InspectorConnectionConfig.Key.Port, "port", 3306, "MySQL port (preferably a replica, not the master)")
|
||||||
flag.StringVar(&migrationContext.CliUser, "user", "", "MySQL user")
|
flag.StringVar(&migrationContext.CliUser, "user", "", "MySQL user")
|
||||||
flag.StringVar(&migrationContext.CliPassword, "password", "", "MySQL password")
|
flag.StringVar(&migrationContext.CliPassword, "password", "", "MySQL password")
|
||||||
|
flag.StringVar(&migrationContext.CliMasterUser, "master-user", "", "MySQL user on master, if different from that on replica. Requires --assume-master-host")
|
||||||
|
flag.StringVar(&migrationContext.CliMasterPassword, "master-password", "", "MySQL password on master, if different from that on replica. Requires --assume-master-host")
|
||||||
flag.StringVar(&migrationContext.ConfigFile, "conf", "", "Config file")
|
flag.StringVar(&migrationContext.ConfigFile, "conf", "", "Config file")
|
||||||
askPass := flag.Bool("ask-pass", false, "prompt for MySQL password")
|
askPass := flag.Bool("ask-pass", false, "prompt for MySQL password")
|
||||||
|
|
||||||
@ -170,8 +172,11 @@ func main() {
|
|||||||
}
|
}
|
||||||
log.Warning("--test-on-replica-skip-replica-stop enabled. We will not stop replication before cut-over. Ensure you have a plugin that does this.")
|
log.Warning("--test-on-replica-skip-replica-stop enabled. We will not stop replication before cut-over. Ensure you have a plugin that does this.")
|
||||||
}
|
}
|
||||||
if migrationContext.AssumeMasterHostname != "" && !migrationContext.AllowedMasterMaster && !migrationContext.IsTungsten {
|
if migrationContext.CliMasterUser != "" && migrationContext.AssumeMasterHostname == "" {
|
||||||
log.Fatalf("--assume-master-host requires either --allow-master-master or --tungsten")
|
log.Fatalf("--master-user requires --assume-master-host")
|
||||||
|
}
|
||||||
|
if migrationContext.CliMasterPassword != "" && migrationContext.AssumeMasterHostname == "" {
|
||||||
|
log.Fatalf("--master-password requires --assume-master-host")
|
||||||
}
|
}
|
||||||
|
|
||||||
switch *cutOver {
|
switch *cutOver {
|
||||||
|
@ -681,6 +681,12 @@ func (this *Migrator) initiateInspector() (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
this.migrationContext.ApplierConnectionConfig = this.migrationContext.InspectorConnectionConfig.DuplicateCredentials(*key)
|
this.migrationContext.ApplierConnectionConfig = this.migrationContext.InspectorConnectionConfig.DuplicateCredentials(*key)
|
||||||
|
if this.migrationContext.CliMasterUser != "" {
|
||||||
|
this.migrationContext.ApplierConnectionConfig.User = this.migrationContext.CliMasterUser
|
||||||
|
}
|
||||||
|
if this.migrationContext.CliMasterPassword != "" {
|
||||||
|
this.migrationContext.ApplierConnectionConfig.Password = this.migrationContext.CliMasterPassword
|
||||||
|
}
|
||||||
log.Infof("Master forced to be %+v", *this.migrationContext.ApplierConnectionConfig.ImpliedKey)
|
log.Infof("Master forced to be %+v", *this.migrationContext.ApplierConnectionConfig.ImpliedKey)
|
||||||
}
|
}
|
||||||
// validate configs
|
// validate configs
|
||||||
|
Loading…
Reference in New Issue
Block a user