我已经安装了 Elasticsearch,现在由于我工作场所的其他人所做的一些更改,在更新、安装新软件包等任何操作期间不断弹出一些错误,而且 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)
我什至尝试了网上不同的解决方案,例如尝试从系统中完全删除elasticsearch。
我遵循的步骤。
sudo rm -rf/var/lib/elasticsearch 须藤 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 ''
最佳答案
systemd 是您在此安装中的初始化服务吗?另外这是什么linux发行版?您的发行版是哪个版本?我目前认为您可能没有使用 systemd,但 elasticsearch 包以某种方式假设了这一点。
如果您在 elasticsearch repository 中打开错误报告,我将不胜感激。有了上述所有信息,这需要在 ES 方面进行更多研究(免责声明:我是 ES 开发人员,并且渴望修复此问题:-)。
另外:您可以尝试通过运行 dpkg -P elasticsearch
来完全删除 elasticsearch
软件包。
此外,您可以尝试将 set -x
添加到 /var/lib/dpkg/info/elasticsearch.postinst
并运行 sh/var/lib/dpkg/info/elasticsearch.postinst 配置
获得更多调试输出
关于python - Elasticsearch 在对系统进行任何操作时出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45141383/