Burrow 服务的安装部署
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
最近协助开发的同时帮忙把10个topic的数据使用5个topic的来工作。结果发现数据flume在手机数据时存在延迟消费的问题。因此遇到了不少坑,要是有个专门监控kafka consumer lag的开源软件就好了!当然我们通过kafka-consumer-groups.sh这个命令也可以查看到相应的参数,但每次都需要敲击命令行。无意间听网友说有LinkedIn公司开源有一款叫做Burrow都软件,专门是对kafka消费这延迟检查。
一.Burrow概述
1>.什么是Burrow
Burrow是Apache Kafka的监控伴侣,它将消费者滞后检查作为服务提供,无需指定阈值。它监控所有消费者的承诺抵消额,并根据需要计算这些消费者的状态。提供HTTP端点以按需请求状态,以及提供其他Kafka群集信息。还有可配置的通知程序可以通过电子邮件或HTTP调用将状态发送到另一个服务。
2>.Burrow特征
没有门槛!通过滑动窗口评估组。
多个Kafka群集支持
使用Kafka提交的偏移自动监视所有使用者
可配置支持Zookeeper提交的偏移量
可配置支持Storm-committed offsets
消费者组状态的HTTP端点,以及代理和消费者信息
可配置的电子邮件程序,用于发送特定组的警报
可配置的HTTP客户端,用于向所有组的另一个系统发送警报
3>.先决条件
Burrow是用Go编写的,所以在开始之前,你应该安装并设置Go。
二.安装Golang环境
1>.下载 go 的安装包
[root@node101.yinzhengjie.org.cn ~/Downloads]# wget https://dl.google.com/go/go1.12.1.linux-amd64.tar.gz
---- ::-- https://dl.google.com/go/go1.12.1.linux-amd64.tar.gz
Resolving dl.google.com (dl.google.com)... 203.208.41.70, 203.208.41.72, 203.208.41.65, ...
Connecting to dl.google.com (dl.google.com)|203.208.41.70|:... connected.
HTTP request sent, awaiting response... OK
Length: (122M) [application/octet-stream]
Saving to: ‘go1.12.1.linux-amd64.tar.gz’ %[=========================================================================================================================================================================>] ,, .27MB/s in 54s -- :: (2.28 MB/s) - ‘go1.12.1.linux-amd64.tar.gz’ saved [/] [root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]# wget https://dl.google.com/go/go1.12.1.linux-amd64.tar.gz
2>.解压go的安装包到指定目录
[root@node101.yinzhengjie.org.cn ~/Downloads]# tar -zxf go1.12.1.linux-amd64.tar.gz -C /yinzhengjie/softwares/
[root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]# ll /yinzhengjie/softwares/go/
total
drwxr-xr-x. root root Mar : api
-rw-r--r--. root root Mar : AUTHORS
drwxr-xr-x. root root Mar : bin
-rw-r--r--. root root Mar : CONTRIBUTING.md
-rw-r--r--. root root Mar : CONTRIBUTORS
drwxr-xr-x. root root Mar : doc
-rw-r--r--. root root Mar : favicon.ico
drwxr-xr-x. root root Mar : lib
-rw-r--r--. root root Mar : LICENSE
drwxr-xr-x. root root Mar : misc
-rw-r--r--. root root Mar : PATENTS
drwxr-xr-x. root root Mar : pkg
-rw-r--r--. root root Mar : README.md
-rw-r--r--. root root Mar : robots.txt
drwxr-xr-x. root root Mar : src
drwxr-xr-x. root root Mar : test
-rw-r--r--. root root Mar : VERSION
[root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]# tar -zxf go1.12.1.linux-amd64.tar.gz -C /yinzhengjie/softwares/
3>.配置go到环境变量
[root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]# mkdir /yinzhengjie/goproject
[root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]# tail - /etc/profile
#ADD GO_PATH
export GO_HOME=/yinzhengjie/softwares/go
export PATH=$PATH:$GO_HOME/bin
export GOPATH=/yinzhengjie/goproject [root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]# tail -5 /etc/profile
[root@node101.yinzhengjie.org.cn ~/Downloads]# source /etc/profile
[root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]# go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/yinzhengjie/goproject"
GOPROXY=""
GORACE=""
GOROOT="/yinzhengjie/softwares/go"
GOTMPDIR=""
GOTOOLDIR="/yinzhengjie/softwares/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED=""
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build685793832=/tmp/go-build -gno-record-gcc-switches"
[root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]#
[root@node101.yinzhengjie.org.cn ~/Downloads]# go env
三.Burrow安装
1>.Burrow的github地址(https://github.com/linkedin/Burrow)
2>.安装git工具
[root@node101.yinzhengjie.org.cn ~]# yum -y install git
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 :1.8.3.1-.el7 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-.el7 for package: git-1.8.3.1-.el7.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-.el7.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-.el7.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-.el7.x86_64
--> Running transaction check
---> Package perl-Error.noarch :0.17020-.el7 will be installed
---> Package perl-Git.noarch :1.8.3.1-.el7 will be installed
---> Package perl-TermReadKey.x86_64 :2.30-.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ===================================================================================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================================================================================
Installing:
git x86_64 1.8.3.1-.el7 updates 4.4 M
Installing for dependencies:
perl-Error noarch :0.17020-.el7 base k
perl-Git noarch 1.8.3.1-.el7 updates k
perl-TermReadKey x86_64 2.30-.el7 base k Transaction Summary
===================================================================================================================================================================================================================
Install Package (+ Dependent packages) Total download size: 4.5 M
Installed size: M
Downloading packages:
(/): perl-Error-0.17020-.el7.noarch.rpm | kB ::
perl-TermReadKey-2.30-.el7.x FAILED
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/Packages/perl-TermReadKey-2.30-20.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error" 0 B --:--:-- ETA
Trying other mirror.
(/): perl-TermReadKey-2.30-.el7.x86_64.rpm | kB ::
perl-Git-1.8.3.1-.el7.noarch FAILED
http://mirrors.cloud.aliyuncs.com/centos/7/updates/x86_64/Packages/perl-Git-1.8.3.1-20.el7.noarch.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error" 0 B --:--:-- ETA
Trying other mirror.
(/): git-1.8.3.1-.el7.x86_64.rpm | 4.4 MB ::
(/): perl-Git-1.8.3.1-.el7.noarch.rpm | kB ::
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.1 MB/s | 4.5 MB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : :perl-Error-0.17020-.el7.noarch /
Installing : perl-TermReadKey-2.30-.el7.x86_64 /
Installing : git-1.8.3.1-.el7.x86_64 /
Installing : perl-Git-1.8.3.1-.el7.noarch /
Verifying : perl-Git-1.8.3.1-.el7.noarch /
Verifying : :perl-Error-0.17020-.el7.noarch /
Verifying : git-1.8.3.1-.el7.x86_64 /
Verifying : perl-TermReadKey-2.30-.el7.x86_64 / Installed:
git.x86_64 :1.8.3.1-.el7 Dependency Installed:
perl-Error.noarch :0.17020-.el7 perl-Git.noarch :1.8.3.1-.el7 perl-TermReadKey.x86_64 :2.30-.el7 Complete!
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# yum -y install git
2>.
3>.
4>.
5>.