-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
41 lines (30 loc) · 663 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"shumin-project/elk-server/elk/es"
"shumin-project/elk-server/elk/etcd"
"shumin-project/elk-server/elk/kafka"
"shumin-project/elk-server/elk/taillog"
)
func main() {
// 初始化etcd
etcd.Init()
//加载es配置
es.LoadEsConfig()
//初始化es
es.Init()
//加载Kafka配置
kafka.LoadConfig()
//初始化消费者
kafka.InitConsumer()
//初始化生产者
kafka.InitProducer()
//etcd 获取日志收集的path和kafka的topic
LogConf:=etcd.GetConf()
//开启任务
taillog.Init(LogConf)
//etcd watch
newConfChan :=taillog.PushConfToChan()
go etcd.WatchConf(newConfChan)
ch :=make(chan struct{},1)
<- ch
}