lusis / chef-logstash

Semi-official Logstash cookbook
Other
271 stars 353 forks source link

Logstash 2.3.4, 2.3.3 service fails #459

Open imewish opened 8 years ago

imewish commented 8 years ago

Hi,

I have tried to install logstash 2.3.4 with this cookbook with test kitchen and EC2. The installation went well but i couldn't see the logstash services running.

root@ip-10-11-19-240:/tmp# /etc/init.d/logstash_server status
down: logstash_server: 1s, normally up, want up; run: log: (pid 10338) 2558s

Tried in both unbuntu 16.04,14.04 with java 8 and 7. no luck.

Logstash 1.5.4 which is default in this cookbook worked fine.

helps would be appreciated.

praveenuchiha commented 8 years ago

Same issue, doesnt work for me either with LS 2.3.4 and ubuntu 14.04. Also @imewish when you run the cookbook does [apt-get-update-periodic] execute without fail? I think it bugs out when there is user/group associated with logstash and throws "Ran apt-get update returned 100" error.

Update: Fixed the service issue by following #452 The apt-get-update still throws "Returned 100 error"

Update 2: Fixed the apt-get-update issue. The problem was with my VM.

eyalzek commented 8 years ago

I faced the same issue, the problem was with the service definition as far as I can tell. To fix it I had to change the following line: https://github.com/lusis/chef-logstash/blob/master/templates/default/sv-logstash-run.erb#L12 and name the env variable LS_JAVA_OPTS instead of just JAVA_OPTS.

I created 2 files in my local cookbook's templates folder; sv-logstash-run.erb & sv-logstash-log-run.erb, both are the same as the files that you can find here: https://github.com/lusis/chef-logstash/tree/master/templates/default

The only change being the renaming of the aforementioned environment variable. Then, in order to use these templates instead of the ones coming from the cookbook, set this attribute in your recipe: node.default['logstash']['instance_default']['service_templates_cookbook'] = cookbook_name

imewish commented 8 years ago

@eyalzek Your fix worked :) Thanks man .. thanks alot

eyalzek commented 8 years ago

@imewish I wouldn't close this issue just yet, it should be fixed on the cookbook level.

imewish commented 8 years ago

Okay.

imewish commented 8 years ago

@eyalzek BTW, i came across new problem with thiscookbook. How can we use custom config templates with with this cookbook? instead of these. https://github.com/lusis/chef-logstash/tree/master/templates/default/config

eyalzek commented 8 years ago

@imewish set node.default['logstash']['instance_default']['config_templates_cookbook'] to your wrapper cookbook's name. Besides that, you have to configure config_templates and pass variables if you need them.

Use this as reference: https://github.com/rackspace-cookbooks/elkstack/blob/master/recipes/logstash.rb#L45 https://github.com/rackspace-cookbooks/elkstack/blob/master/attributes/logstash.rb#L33

imewish commented 8 years ago

Thanks man :)

imewish commented 8 years ago

@eyalzek did you face a time lag while installing plugins? when use the resource provider logstash_plugins for plugin installation?