-1

How do I install multiple instances of logstash on a linux machine? I want 2 different services (each one will have its own config) running at the same time?

(this might be a simple question but just because I'm a noob on linux I couldn't figure it out)

BornToCode
  • 9,495
  • 9
  • 66
  • 83
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306) – jww Jun 15 '17 at 16:17
  • 1
    https://discuss.elastic.co/t/multiple-logstash-instances-on-single-server/28947/2 – fylie Jun 15 '17 at 19:44

1 Answers1

0

The link that @fylie posted is quite useful but still needed some tweaks.

Here's my new insights - make a copy of /etc/init.d/logstash and adjust the name variable near the top of the file - I didn't know but just making a copy of this file was enough in linux for a service to be created. If I copied it into a file named "logstash2" I could now run "service logstash2 start" and it worked.

I've edited the new /etc/init.d/logstash2 and changed the values of LS_CONF_DIR and LS_LOG_DIRto new folders I've created. But it didn't work until I ranchown -R logstash:logstash /var/log/logstash2` on my newly created "logstash2" dir.

It was also possible to override the LS_CONF_DIR and LS_LOG_DIR etc. by creating a file in /etc/sysconfig with the service name (logstash2) and uncommenting the relevant lines.

Then to make it run as a startup service I had to run: chkconfig --add logstash2

BornToCode
  • 9,495
  • 9
  • 66
  • 83