Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Help in building heka for windows with sandbox plugins #1968

Open
vpriyada opened this issue Jul 29, 2016 · 8 comments
Open

Help in building heka for windows with sandbox plugins #1968

vpriyada opened this issue Jul 29, 2016 · 8 comments

Comments

@vpriyada
Copy link

Hi heka members,
I am trying to make heka work with windows server 2012 R2 version.
I downloaded heka source code from github and built it for windows.(followed the steps in https://hekad.readthedocs.io/en/v0.10.0/installing.html)
Now I try to run a toml file with sandbox encoders that was generated as a part of heka build for windows.(for eg : lua_encoders/es_payload.lua)

And when I try to run hekad heka does not start. It exits in the state “starting hekad”
Could you please suggest options if there is any specific way to build heka for windows to make it work with sandbox plugins?
Should it be built with plugin_loader.cmake even though I have the default sandbox encoders and decoders.

Sample toml file:
[LogstreamerInput]
log_directory = "C:/"
file_match = 'sample.txt'

[es_payload]
type = "SandboxEncoder"
filename = "lua_encoders/es_payload.lua"
[es_payload.config]
es_index_from_timestamp = true
index = "%{Logger}-%{%Y.%m.%d}"
type_name = "%{Type}-%{Hostname}"

[LogOutput]
message_matcher = "TRUE"
encoder = "es_payload"

Heka output screenshot:

heka

@SeeWei1985
Copy link

try to use "GODEBUG=cgocheck=0 hekad -config xx.toml "

@vpriyada
Copy link
Author

Thanks for the response SeeWei1986
I am getting this error 'GODEBUG' is not recognized as an internal or external command,
operable program or batch file.
Should I install GODEBUG?
I have only GO installed in my machine and have created a environement variable GOPATH and its value as C:\Go\bin and also include path of Go in PATH variable.

@SeeWei1985
Copy link

[xxx@ip-172-31-12-225 tomls]$ /usr/local/bin/hekad -config hekad.toml
2016/07/29 07:52:53 Pre-loading: [LogOutput]
2016/07/29 07:52:53 Pre-loading: [LogstreamerInput]
2016/07/29 07:52:53 Pre-loading: [es_payload]
2016/07/29 07:52:53 Pre-loading: [NullSplitter]
2016/07/29 07:52:53 Loading: [NullSplitter]
2016/07/29 07:52:53 Pre-loading: [ProtobufDecoder]
2016/07/29 07:52:53 Loading: [ProtobufDecoder]
2016/07/29 07:52:53 Pre-loading: [ProtobufEncoder]
2016/07/29 07:52:53 Loading: [ProtobufEncoder]
2016/07/29 07:52:53 Pre-loading: [TokenSplitter]
2016/07/29 07:52:53 Loading: [TokenSplitter]
2016/07/29 07:52:53 Pre-loading: [PatternGroupingSplitter]
2016/07/29 07:52:53 Loading: [PatternGroupingSplitter]
2016/07/29 07:52:53 Pre-loading: [HekaFramingSplitter]
2016/07/29 07:52:53 Loading: [HekaFramingSplitter]
2016/07/29 07:52:53 Loading: [es_payload]
2016/07/29 07:52:53 Loading: [LogstreamerInput]
2016/07/29 07:52:53 Loading: [LogOutput]
2016/07/29 07:52:53 Starting hekad...

Here, that is the output message when I execute your codes in my linux environment. It presents the same results like yours.

Thus, When I add prefix "GODEBUG=cgocheck=0 ", it works well.

2016/07/29 07:56:05 Pre-loading: [LogstreamerInput]
2016/07/29 07:56:05 Pre-loading: [es_payload]
2016/07/29 07:56:05 Pre-loading: [LogOutput]
2016/07/29 07:56:05 Pre-loading: [HekaFramingSplitter]
2016/07/29 07:56:05 Loading: [HekaFramingSplitter]
2016/07/29 07:56:05 Pre-loading: [NullSplitter]
2016/07/29 07:56:05 Loading: [NullSplitter]
2016/07/29 07:56:05 Pre-loading: [ProtobufDecoder]
2016/07/29 07:56:05 Loading: [ProtobufDecoder]
2016/07/29 07:56:05 Pre-loading: [ProtobufEncoder]
2016/07/29 07:56:05 Loading: [ProtobufEncoder]
2016/07/29 07:56:05 Pre-loading: [TokenSplitter]
2016/07/29 07:56:05 Loading: [TokenSplitter]
2016/07/29 07:56:05 Pre-loading: [PatternGroupingSplitter]
2016/07/29 07:56:05 Loading: [PatternGroupingSplitter]
2016/07/29 07:56:05 Loading: [es_payload]
2016/07/29 07:56:05 Loading: [LogstreamerInput]
2016/07/29 07:56:05 Loading: [LogOutput]
2016/07/29 07:56:05 Starting hekad...
2016/07/29 07:56:05 Output started: LogOutput
2016/07/29 07:56:05 MessageRouter started.
2016/07/29 07:56:05 Input started: LogstreamerInput
2016/07/29 07:56:05 {"index":{"_index":"LogstreamerInput-2016.07.29","_type":"logfile-xxxx"}}

The same issue about "GODEBUG=cgocheck=0" can be found #1881.

That can give some suggestions to you and you can explore the solutions for window environment.

@SeeWei1985
Copy link

The checks can be disabled by setting the environment variable GODEBUG=cgocheck=0, but note that the vast majority of code identified by the checks is subtly incompatible with garbage collection in one way or another. https://golang.org/doc/go1.6

" GODEBUG=cgocheck=0 "
it is a environment variable.

@vpriyada
Copy link
Author

Hi,
Could you tell me how to set this environment variable GODEBUG=cgocheck=0
I had Go installed in my windows not GODEBUG. So I did a git pull from "go get github.com/mailgun/godebug"
Now godebug is present in my windows machine.
After that if I give the command GODEBUG=cgocheck=0 -config=hekad.toml I get the following output:

**C:\etc>GODEBUG=cgocheck=0 hekad -config=hekad.toml
godebug is a tool for debugging Go programs.

Usage:

    godebug command [arguments]

The commands are:

build     compile a debug-ready Go program
run       compile, run, and debug a Go program
test      compile, run, and debug Go package tests

Use "godebug help [command]" for more information about a command.**

I did not get the output like yours.
Could you help me in this if you are aware of what I am missing.

Thanks.

@SeeWei1985
Copy link

I think it has nothing to do with the godebug command.... since it has not been installed in my linux.
In your window cmd shell and try like this as follow.

set GODEBUG=cgocheck=0
hekad -config xx.toml

@vpriyada
Copy link
Author

Hi SeeWei1986,
It just worked :-)
Thanks for your timely help and immediate response.
You just made my day :-):-):-) It is working fine now after setting the environment variable.

@SeeWei1985
Copy link

:-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants