open-falcon trend 部署

目的

trend 用于预聚合
搭建 open-falcon trend

修改版本信息

vim modules/trend/g/g.go

const (
        VERSION         = "20200818"
        TREND_INTERVALS = 3600 //聚合区间为1小时
)

编译

# make trend
go build -o bin/trend/falcon-trend ./modules/trend

创建目录

mkdir /apps/svr/falcon-plus/trend/{bin,config,logs} -p

配置

{
    "log_level": "info",
    "gauge": true,
    "http": {
        "enabled": true,
        "listen": "0.0.0.0:6991"
    },
    "rpc": {
        "enabled": true,
        "listen": "0.0.0.0:6990"
    },
    "db": {
        "dsn": "falcon:falcontest@tcp(ns-yun-020021.133.com:3306)/vip_falcon_aggregator?loc=Local&parseTime=true",
        "batch": 200,
        "batchInterval": 60,
        "concurrent": 1,
        "maxIdle": 4
    }
}

启动测试

[root@ns-yun-020021 trend]# ./bin/falcon-trend -c config/cfg.json
2020/08/18 15:41:21 cfg.go:75: g.ParseConfig ok, file  config/cfg.json
2020/08/18 15:41:21 http.go:38: http.startHttpServer ok, listening 0.0.0.0:6991
2020/08/18 15:41:21 rpc.go:54: rpc.Start ok, listening on 0.0.0.0:6990
2020/08/18 15:41:21 main.go:20: 2094 register signal notify

启动文件

/usr/lib/systemd/system/falcon-trend.service

[Unit]
Description=falcon trend
After=network-online.target
Before=shutdown.target

[Service]
Type=simple
User=apps
Group=apps
LimitNOFILE=65535
ExecStart=/apps/svr/falcon-plus/trend/bin/falcon-trend -c /apps/svr/falcon-plus/trend/config/cfg.json
Restart=always
StandardOutput=journal

启动服务

[root@ns-yun-020021 trend]# systemctl  daemon-reload
[root@ns-yun-020021 trend]# systemctl start falcon-trend
[root@ns-yun-020021 trend]# systemctl status falcon-trend
● falcon-trend.service - falcon trend
   Loaded: loaded (/usr/lib/systemd/system/falcon-trend.service; static; vendor preset: disabled)
   Active: active (running) since Tue 2020-08-18 15:47:06 CST; 8s ago
 Main PID: 2168 (falcon-trend)
   Memory: 8.5M
   CGroup: /system.slice/falcon-trend.service
           └─2168 /apps/svr/falcon-plus/trend/bin/falcon-trend -c /apps/svr/falcon-plus/trend/config/cfg.json
Aug 18 15:47:06 ns-yun-020021.vclound.com systemd[1]: Started falcon trend.
Aug 18 15:47:06 ns-yun-020021.vclound.com systemd[1]: Starting falcon trend...
Aug 18 15:47:06 ns-yun-020021.vclound.com falcon-trend[2168]: 2020/08/18 15:47:06 cfg.go:75: g.ParseConfig ok, file  /a...json
Aug 18 15:47:06 ns-yun-020021.vclound.com falcon-trend[2168]: 2020/08/18 15:47:06 http.go:38: http.startHttpServer ok, ...6991
Aug 18 15:47:06 ns-yun-020021.vclound.com falcon-trend[2168]: 2020/08/18 15:47:06 rpc.go:54: rpc.Start ok, listening on...6990
Aug 18 15:47:06 ns-yun-020021.vclound.com falcon-trend[2168]: 2020/08/18 15:47:06 main.go:20: 2168 register signal notify
Hint: Some lines were ellipsized, use -l to show in full.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Terry_Tsang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值