使用系统进行任何操作时Elasticsearch错误?

时间:2017-07-17 10:07:47

标签: python ubuntu elasticsearch kibana

我已经安装了Elasticsearch,现在由于我工作场所的其他人做了一些更改,在更新,安装新软件包以及弹性搜索无法正常工作等任何操作期​​间会出现一些错误。

附加错误日志以安装新软件包。

$ sudo apt-get install bash-completion

Reading package lists... Done
Building dependency tree
Reading state information... Done
bash-completion is already the newest version (1:2.1-4.2ubuntu1.1).
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up elasticsearch (5.5.0) ...
Failed to restart systemd-sysctl.service: No such method 'RestartUnit'
See system logs and 'systemctl status systemd-sysctl.service' for details.
dpkg: error processing package elasticsearch (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 elasticsearch
E: Sub-process /usr/bin/dpkg returned an error code (1)

我甚至试图从网上尝试不同的解决方案,比如试图从系统中完全删除弹性搜索。

我遵循的步骤。

sudo rm -rf / var / lib / elasticsearch sudo rm -rf / etc / elasticsearch sudo apt-get install -f

$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up elasticsearch (5.5.0) ...
Failed to restart systemd-sysctl.service: No such method 'RestartUnit'
See system logs and 'systemctl status systemd-sysctl.service' for details.
dpkg: error processing package elasticsearch (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 elasticsearch
E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo apt-get --purge autoremove elasticsearch

$ sudo apt-get --purge autoremove elasticsearch
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  elasticsearch*
0 upgraded, 0 newly installed, 1 to remove and 15 not upgraded.
1 not fully installed or removed.
After this operation, 37.3 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 329402 files and directories currently installed.)
Removing elasticsearch (5.5.0) ...
Stopping elasticsearch service...Failed to stop elasticsearch.service: Unknown unit: elasticsearch.service
See system logs and 'systemctl status elasticsearch.service' for details.
Failed to get load state of elasticsearch.service: No such property 'LoadState'
dpkg: error processing package elasticsearch (--purge):
 subprocess installed pre-removal script returned error exit status 1
Failed to restart systemd-sysctl.service: No such method 'RestartUnit'
See system logs and 'systemctl status systemd-sysctl.service' for details.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 elasticsearch
E: Sub-process /usr/bin/dpkg returned an error code (1)

我重新启动了系统,但错误不断出现。

有人提出如何解决这个问题的建议吗?

此命令也不提供任何内容

$ systemctl status systemd-sysctl.service
Failed to get properties: No such interface ''

2 个答案:

答案 0 :(得分:2)

在这个安装中是systemd你的init服务吗?这个linux的分布是什么?您的发行版的哪个版本?我目前正在考虑你可能没有使用systemd,但是弹性搜索包正以某种方式假设它。

如果您在elasticsearch repository中打开包含以上所有信息的错误报告,我们非常感谢,这需要对ES方面进行更多研究(免责声明:我是ES开发人员并且热衷于解决这个问题: - )。

另外:您可以尝试通过运行elasticsearch来完全删除dpkg -P elasticsearch包。

此外,您可以尝试将set -x添加到/var/lib/dpkg/info/elasticsearch.postinst并运行sh /var/lib/dpkg/info/elasticsearch.postinst configure  获得更多调试输出

答案 1 :(得分:2)

我遇到了同样的问题。 它与systemctl有关,而不是elasticsearch。 首先,你必须确定你是否正在使用它。

[[ `systemctl` =~ -\.mount ]] && echo yes || echo no

就我而言,答案是"没有"

所以你必须启用它。