open-falcon kafka-consumer 部署

作用

官方文档中没有说明
发现生产环境中使用到该服务
后续需要源代码分析再更新其他信息

创建目录

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

配置文件

/apps/svr/falcon-plus/kafka_consumer/config/cfg.json

{
    "log_level": "info",
    "http": {
        "enabled": true,
        "listen": "0.0.0.0:6850"
    },
    "consumer": {
        "kafkaVersion": "low",
        "topics": ["vipfalcon"],
        "group": "vipfalcon_trend_20190517",
        "offset": "newest",
        "offsetTimeout": 10,
        "concurrent": 32,
        "zookeeper": "ns-yun-020022.133.com:2181,ns-yun-020023.133.com:2181,ns-yun-020024.133.com:2181",
        "kafka": ["ns-yun-020022.133.com:9092","ns-yun-020023.133.com:9092","ns-yun-020024.133.com:9092"]
    },
    "trend": {
        "enabled": true,
        "batch": 200,
        "connTimeout": 1000,
        "callTimeout": 5000,
        "maxConns": 32,
        "maxIdle": 32,
        "replicas": 500,
        "cluster": {
            "trend-00" : "xx.xxx.xx.21:6990",
            "trend-01" : "xx.xxx.xx.22:6990",
            "trend-02" : "xx.xxx.xx.23:6990",
            "trend-03" : "xx.xxx.xx.24:6990"
        }
    },
    "transfer": {
        "enabled": true,
        "batch": 200,
        "retry": 1,
        "connTimeout": 1000,
        "callTimeout": 5000,
        "maxConns": 32,
        "maxIdle": 32,
        "cluster": {
            "transfer-00": "xx.xxx.xx.29:8443"
        }
    },
    "percent_check": {
        "cpu.idle": true,
        "cpu.user": true,
        "cpu.nice": true,
        "cpu.system": true,
        "cpu.iowait": true,
        "cpu.irq": true,
        "cpu.softirq": true,
        "cpu.steal": true,
        "cpu.guest": true
    },
    "ignore_host": {
        "localhost": true,
        "localhost.example": true,
        "localhost.localdomain": true,
        "local_host": true
    }
}

启动测试

[root@ns-yun-020026 kafka_consumer]# bin/falcon-kafka_consumer -c config/cfg.json
2020/08/24 09:00:00 cfg.go:102: g.ParseConfig ok, file  config/cfg.json
2020/08/24 09:00:00 proc.go:29: proc.Start, ok
INFO[0000] send.Start, ok
INFO[0000] start to init consumer group of low version kafka
2020/08/24 09:00:00 http.go:39: http.startHttpServer ok, listening 0.0.0.0:6850
2020/08/24 09:00:00 structs.go:21: Connected to xx.xxx.xx.22:2181
2020/08/24 09:00:00 structs.go:21: Authenticated: id=72057612521898042, timeout=4000
2020/08/24 09:00:00 structs.go:21: Re-submitting `0` credentials after reconnect
2020/08/24 09:00:01 main.go:20: 186155 register signal notify

启动文件

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

[Unit]
Description=falcon kafka_consumer
After=network-online.target
Before=shutdown.target
[Service]
Type=simple
User=apps
Group=apps
LimitNOFILE=65535
ExecStart=/apps/svr/falcon-plus/kafka_consumer/bin/falcon-kafka_consumer -c /apps/svr/falcon-plus/kafka_consumer/config/cfg.json
Restart=always
StandardOutput=journal

启动

[root@ns-yun-020026 system]# systemctl  status falcon-kafka_consumer.service
● falcon-kafka_consumer.service - falcon kafka_consumer
   Loaded: loaded (/usr/lib/systemd/system/falcon-kafka_consumer.service; static; vendor preset: disabled)
   Active: active (running) since Mon 2020-08-24 09:02:23 CST; 3s ago
 Main PID: 186269 (falcon-kafka_co)
   Memory: 3.6M
   CGroup: /system.slice/falcon-kafka_consumer.service
           └─186269 /apps/svr/falcon-plus/kafka_consumer/bin/falcon-kafka_consumer -c /apps/svr/falcon-plus/kafka_consumer/...
Aug 24 09:02:23 ns-yun-020026.133.com falcon-kafka_consumer[186269]: 2020/08/24 09:02:23 cfg.go:102: g.ParseConfig o...son
Aug 24 09:02:23 ns-yun-020026.133.com falcon-kafka_consumer[186269]: 2020/08/24 09:02:23 proc.go:29: proc.Start, ok
Aug 24 09:02:23 ns-yun-020026.133.com falcon-kafka_consumer[186269]: time="2020-08-24T09:02:23+08:00" level=info msg...ok"
Aug 24 09:02:23 ns-yun-020026.133.com falcon-kafka_consumer[186269]: time="2020-08-24T09:02:23+08:00" level=info msg...ka"
Aug 24 09:02:23 ns-yun-020026.133.com falcon-kafka_consumer[186269]: 2020/08/24 09:02:23 http.go:39: http.startHttpS...850
Aug 24 09:02:23 ns-yun-020026.133.com falcon-kafka_consumer[186269]: 2020/08/24 09:02:23 structs.go:21: Connected to...181
Aug 24 09:02:23 ns-yun-020026.133.com falcon-kafka_consumer[186269]: 2020/08/24 09:02:23 structs.go:21: Authenticate...000
Aug 24 09:02:23 ns-yun-020026.133.com falcon-kafka_consumer[186269]: 2020/08/24 09:02:23 structs.go:21: Re-submittin...ect
Aug 24 09:02:23 ns-yun-020026.133.com falcon-kafka_consumer[186269]: 2020/08/24 09:02:23 main.go:20: 186269 register...ify
Aug 24 09:02:25 ns-yun-020026.133.com falcon-kafka_consumer[186269]: time="2020-08-24T09:02:25+08:00" level=error ms...76"
Hint: Some lines were ellipsized, use -l to show in full.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Terry_Tsang

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

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

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

打赏作者

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

抵扣说明:

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

余额充值