[REV] update discover eventlog server config

This commit is contained in:
barnett 2018-05-14 11:53:06 +08:00
parent c295b48e3b
commit e52785a300
4 changed files with 19 additions and 7 deletions

View File

@ -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 {

View File

@ -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()

View File

@ -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()

View File

@ -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()