如何在 linux 台机器上安装多个 logstash 实例?
How to install multiple logstash instances on a linux machine?
如何在 linux 机器上安装多个 logstash 实例?我同时想要 2 个不同的服务(每个服务都有自己的配置)运行?
(这可能是一个简单的问题,但只是因为我是 linux 的菜鸟,所以我无法弄明白)
@fylie 发布的 link 非常有用,但仍需要一些调整。
这是我的新见解 -
make a copy of /etc/init.d/logstash and adjust the name variable near the top of the file
- 我不知道,但在 linux 中复制此文件就足以创建服务。如果我将它复制到一个名为 "logstash2" 的文件中,我现在可以 运行 "service logstash2 start" 并且它起作用了。
我编辑了新的 /etc/init.d/logstash2 并更改了 LS_CONF_DIR
和 LS_LOG_DIRto new folders I've created.
But it didn't work until I ran
chown -R logstash:logstash 的值] /var/log/logstash2` 在我新创建的 "logstash2" 目录中。
也可以覆盖 LS_CONF_DIR 和 LS_LOG_DIR 等,方法是在 /etc/sysconfig 中使用服务名称 (logstash2) 创建文件并取消注释相关行。
然后为了使其 运行 作为启动服务,我必须 运行:
chkconfig --add logstash2
如何在 linux 机器上安装多个 logstash 实例?我同时想要 2 个不同的服务(每个服务都有自己的配置)运行?
(这可能是一个简单的问题,但只是因为我是 linux 的菜鸟,所以我无法弄明白)
@fylie 发布的 link 非常有用,但仍需要一些调整。
这是我的新见解 -
make a copy of /etc/init.d/logstash and adjust the name variable near the top of the file
- 我不知道,但在 linux 中复制此文件就足以创建服务。如果我将它复制到一个名为 "logstash2" 的文件中,我现在可以 运行 "service logstash2 start" 并且它起作用了。
我编辑了新的 /etc/init.d/logstash2 并更改了 LS_CONF_DIR
和 LS_LOG_DIRto new folders I've created.
But it didn't work until I ran
chown -R logstash:logstash 的值] /var/log/logstash2` 在我新创建的 "logstash2" 目录中。
也可以覆盖 LS_CONF_DIR 和 LS_LOG_DIR 等,方法是在 /etc/sysconfig 中使用服务名称 (logstash2) 创建文件并取消注释相关行。
然后为了使其 运行 作为启动服务,我必须 运行:
chkconfig --add logstash2