Closed hicqu closed 7 years ago
The reason is we specify --dest-db-type=mysql
, but no connection arguments are passed so that Config.SyncerConfig.To
is a nullptr.
To fix it, we should pass host, port, username, password to drainer. I will add these command arguments:
--dest-mysql-host # default "localhost", used when --dest-db-type=mysql
--dest-mysql-port # default 3306
--dest-mysql-user # default "root"
--dest-mysql-password # default ""
--dest-pb-dir # default "${data-dir}/pb", used when --dest-db-type=pb
@GregoryIan , is that OK?
we had these parameters in the past, but I think there're too many arguments. How about just making up those argument in Parse()
?
I figure out that we must specify syncer.to
section in some.toml, and pass --config some.toml
to drainer. Without that, Config.SyncerConfig.To
will be a nullptr so that panic happends.
The default arguments like dest-mysql-host
doesn't matter here. So, I will just check Config.SyncerConfig.To
is a nullptr or not in Config.validate()
.
ok
Now I think we should let drainer running although cfg.to is nullptr
So we should add a default down-stream MySQL config? If so, we should also tell users what the default config is, show that in ./drainer --help
?
launch command and arguments:
error logs and stdout: