导航

Heka 的编译

Posted on 2014-10-26 12:16  蝈蝈俊  阅读(715)  评论(0编辑  收藏  举报

Heka是Mozilla开源的,基于Go语言实现的,插件式log收集和分析系统。

已经编译好的 release 版本可以在下面地址下载:

https://github.com/mozilla-services/heka/releases 

 

如果我们想自行编译,以windows下为例,如下:

 

下载源码:

C:\>go get github.com/mozilla-services/heka
package github.com/mozilla-services/heka
        imports github.com/mozilla-services/heka
        imports github.com/mozilla-services/heka: no buildable Go source files in d:\mycodes\golang\src\github.com\mozilla-services\heka

 

编译时,需要

D:\mycodes\golang\src\github.com\mozilla-services\heka>build.bat
'cmake' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
'mingw32-make' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

 

编译的需要:

Prerequisites (all systems):

Prerequisites (Unix):

  • make
  • gcc
  • patch
  • dpkg (optional)
  • rpmbuild (optional)
  • packagemaker (optional)

Prerequisites (Windows):

 

Git 和 Mercurial 的安装请参考:

http://www.cnblogs.com/ghj1976/p/4049786.html

 

CMake 的默认选项变更

image

 

MinGW

MinGW安装时,几个特殊的选项如下:

image

 

image

 

 

这些相关工具配置好后, 在下载的目录下执行 build.bat 就开始编译了。

如果没有任何依赖库需要下载,就类似下面的提示:

 

D:\mycodes\golang\src\github.com\mozilla-services\heka>build.bat
-- GeoIP.h was not found, GeoIP functionality will not be included in this build
.
-- sphinx-build was not found, the documentation will not be generated.
-- Configuring done
-- Generating done
-- Build files have been written to: D:/mycodes/golang/src/github.com/mozilla-se
rvices/heka/build
[  5%] Built target gogoprotobuf
[ 10%] Built target gomock
[ 15%] Built target go-simplejson
[ 20%] Built target whisper-go
[ 25%] Built target go-notify
[ 30%] Built target toml
[ 35%] Built target raw
[ 39%] Built target amqp
[ 44%] Built target slices
[ 49%] Built target sets
[ 54%] Built target goamz
[ 59%] Built target g2s
[ 64%] Built target gospec
[ 69%] Built target xmlpath
[ 74%] Built target go-ircevent
[ 79%] Built target go-uuid
[ 79%] Built target GoPackages
[ 84%] Built target lua_sandbox
Install dll's for the mock generation and unit tests
[ 84%] Built target heka_source
[ 84%] Built target message_matcher_parser
[100%] Built target mocks
[100%] Built target hekad
[100%] Built target flood
[100%] Built target heka-cat
[100%] Built target inject
[100%] Built target logstreamer
[100%] Built target sbmgr
[100%] Built target sbmgrload

D:\mycodes\golang\src\github.com\mozilla-services\heka\build>

 

 

相关参考资料:

http://hekad.readthedocs.org/en/latest/installing.html