Win10(Ubuntu18.04)环境下安装Logstash7.6.2报错System has not been booted with systemd as init system

因为建设一个数据共享交换平台,设计用ES做全文检索,按照官网教程依次安装Elasticsearch、Kibana、Logstash,前两个都能顺利通过sudo -i service xxxx start,但是这个logstash在安装的时候总是提示System has not been booted with systemd as init system (PID 1). Can't operate.

起初从百度搜索相关答案基本上都相关性不大,也去StackOverflow找,一样没有太靠谱的。大概是程序员还很少会用Windows10的Ubuntu系统吧。

后来,研究了一下system-install文件,发现上面有提示:

Usage: system-install [OPTIONSFILE] [STARTUPTYPE] [VERSION]

NOTE: These arguments are ordered, and co-dependent

OPTIONSFILE: Full path to a startup.options file
OPTIONSFILE is required if STARTUPTYPE is specified, but otherwise looks first
in /usr/share/logstash/config/startup.options and then /etc/logstash/startup.options
Last match wins

STARTUPTYPE: e.g. sysv, upstart, systemd, etc.
OPTIONSFILE is required to specify a STARTUPTYPE.

VERSION: The specified version of STARTUPTYPE to use.  The default is usually
preferred here, so it can safely be omitted.
Both OPTIONSFILE & STARTUPTYPE are required to specify a VERSION.

意思就是说可以选择启动的方式,众所周知这个ubuntu是不支持systemd方式的,那么不如试一下指定sysv(Debian默认)。

于是就安装成功了。具体的这个sysv、upstat几个区别可以参考这篇文章:

https://www.ibm.com/developerworks/cn/linux/1407_liuming_init1/index.html


版权声明:本文为michaelwrong原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。