You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
627 B
34 lines
627 B
package app
|
|
|
|
import (
|
|
"log"
|
|
"time"
|
|
)
|
|
|
|
func init() {
|
|
log.SetFlags(log.LstdFlags | log.Lshortfile | log.Lmicroseconds)
|
|
}
|
|
func Start() {
|
|
// 启动 master 服务
|
|
master := NewETMaster()
|
|
go master.StartRPCServer()
|
|
|
|
// 设置 Kafka 消费者配置信息
|
|
master.InitKafkaDataSource()
|
|
|
|
//等待node注册
|
|
master.WaitNodeRegister()
|
|
println("=======")
|
|
|
|
// 发布数据
|
|
go master.AggDataPublishing()
|
|
go master.RawDataPublishing()
|
|
time.Sleep(2 * time.Second)
|
|
|
|
// Kafka 数据消费与处理
|
|
go master.dataSource.RawDataProducer()
|
|
go master.dataSource.AggDataProducer()
|
|
|
|
// 监控系统关闭
|
|
master.MonitorShutdown()
|
|
}
|
|
|