2013-04-18 06:01:33 +04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
|
2013-09-14 07:19:14 +04:00
|
|
|
"github.com/youtube/vitess/go/vt/servenv"
|
2013-07-19 05:18:20 +04:00
|
|
|
"github.com/youtube/vitess/go/vt/topo"
|
2015-12-10 02:18:21 +03:00
|
|
|
"github.com/youtube/vitess/go/vt/vtctld"
|
2013-04-18 06:01:33 +04:00
|
|
|
)
|
|
|
|
|
2014-06-17 02:27:45 +04:00
|
|
|
func init() {
|
|
|
|
servenv.RegisterDefaultFlags()
|
|
|
|
}
|
|
|
|
|
2013-07-27 02:04:47 +04:00
|
|
|
// used at runtime by plug-ins
|
2015-11-13 05:41:42 +03:00
|
|
|
var (
|
2015-12-10 01:03:32 +03:00
|
|
|
ts topo.Server
|
2015-11-13 05:41:42 +03:00
|
|
|
)
|
2013-05-14 22:37:08 +04:00
|
|
|
|
2013-04-18 06:01:33 +04:00
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
2013-09-14 07:19:14 +04:00
|
|
|
servenv.Init()
|
|
|
|
defer servenv.Close()
|
2013-05-17 00:16:22 +04:00
|
|
|
|
2014-08-21 01:54:26 +04:00
|
|
|
ts = topo.GetServer()
|
2013-07-18 02:52:34 +04:00
|
|
|
defer topo.CloseServers()
|
2013-07-03 04:02:37 +04:00
|
|
|
|
2015-12-10 01:19:48 +03:00
|
|
|
// Init the vtctld core
|
2015-12-10 02:18:21 +03:00
|
|
|
vtctld.InitVtctld(ts)
|
2015-01-05 01:25:46 +03:00
|
|
|
|
2015-11-13 05:41:42 +03:00
|
|
|
// Start schema manager service.
|
2015-12-10 01:10:14 +03:00
|
|
|
initSchema()
|
2015-11-13 05:41:42 +03:00
|
|
|
|
2015-12-10 01:10:14 +03:00
|
|
|
// And run the server.
|
2014-06-17 02:27:45 +04:00
|
|
|
servenv.RunDefault()
|
2013-04-18 06:01:33 +04:00
|
|
|
}
|