diff --git a/api/db/db.go b/api/db/db.go index c8b5eca5d..98f4f0429 100644 --- a/api/db/db.go +++ b/api/db/db.go @@ -77,7 +77,10 @@ func CreateEventManager(conf option.Config) error { var err error for tryTime < 4 { tryTime++ - if err = event.NewManager(event.EventConfig{EventLogServers: conf.EventLogServers}); err != nil { + if err = event.NewManager(event.EventConfig{ + EventLogServers: conf.EventLogServers, + DiscoverAddress: conf.EtcdEndpoint, + }); err != nil { logrus.Errorf("get event manager failed, try time is %v,%s", tryTime, err.Error()) time.Sleep((5 + tryTime*10) * time.Second) } else { diff --git a/cmd/api/server/server.go b/cmd/api/server/server.go index 2964f00fc..62d2e29e1 100644 --- a/cmd/api/server/server.go +++ b/cmd/api/server/server.go @@ -24,13 +24,13 @@ import ( "os/signal" "syscall" - "github.com/goodrain/rainbond/cmd/api/option" "github.com/goodrain/rainbond/api/controller" "github.com/goodrain/rainbond/api/db" "github.com/goodrain/rainbond/api/discover" "github.com/goodrain/rainbond/api/handler" "github.com/goodrain/rainbond/api/server" "github.com/goodrain/rainbond/appruntimesync/client" + "github.com/goodrain/rainbond/cmd/api/option" "github.com/goodrain/rainbond/event" "github.com/Sirupsen/logrus" @@ -53,7 +53,10 @@ func Run(s *option.APIServer) error { logrus.Debugf("create event manager error, %v", err) } - if err := event.NewManager(event.EventConfig{EventLogServers: s.Config.EventLogServers}); err != nil { + if err := event.NewManager(event.EventConfig{ + EventLogServers: s.Config.EventLogServers, + DiscoverAddress: s.Config.EtcdEndpoint, + }); err != nil { return err } defer event.CloseManager() diff --git a/cmd/builder/server/server.go b/cmd/builder/server/server.go index 150b31ff0..e65be48be 100644 --- a/cmd/builder/server/server.go +++ b/cmd/builder/server/server.go @@ -23,9 +23,9 @@ import ( "os/signal" "syscall" - "github.com/goodrain/rainbond/cmd/builder/option" "github.com/goodrain/rainbond/builder/discover" "github.com/goodrain/rainbond/builder/exector" + "github.com/goodrain/rainbond/cmd/builder/option" "github.com/goodrain/rainbond/db" "github.com/goodrain/rainbond/db/config" "github.com/goodrain/rainbond/event" @@ -49,7 +49,10 @@ func Run(s *option.Builder) error { if err := db.CreateManager(dbconfig); err != nil { return err } - if err := event.NewManager(event.EventConfig{EventLogServers: s.Config.EventLogServers}); err != nil { + if err := event.NewManager(event.EventConfig{ + EventLogServers: s.Config.EventLogServers, + DiscoverAddress: s.Config.EtcdEndPoints, + }); err != nil { return err } defer event.CloseManager() diff --git a/cmd/worker/server/server.go b/cmd/worker/server/server.go index 3bf60359d..6c65465b4 100644 --- a/cmd/worker/server/server.go +++ b/cmd/worker/server/server.go @@ -24,9 +24,9 @@ import ( "os/signal" "syscall" - "github.com/goodrain/rainbond/cmd/worker/option" "github.com/goodrain/rainbond/appruntimesync" "github.com/goodrain/rainbond/appruntimesync/client" + "github.com/goodrain/rainbond/cmd/worker/option" "github.com/goodrain/rainbond/db" "github.com/goodrain/rainbond/db/config" "github.com/goodrain/rainbond/event" @@ -56,7 +56,10 @@ func Run(s *option.Worker) error { } defer db.CloseManager() - if err := event.NewManager(event.EventConfig{EventLogServers: s.Config.EventLogServers}); err != nil { + if err := event.NewManager(event.EventConfig{ + EventLogServers: s.Config.EventLogServers, + DiscoverAddress: s.Config.EtcdEndPoints, + }); err != nil { return err } defer event.CloseManager()