Elastic 的企业搜索安装指南甚至可以在本地启动该过程 - 这显然不是很稳定。
从.deb
或安装时.rpm
,服务实际上已设置并可供使用,但不幸的是,它似乎不起作用!?
当我启动服务时,我所能看到的是:
$ systemctl status enterprise-search
● enterprise-search.service - Elastic Enterprise Search
Loaded: loaded (/lib/systemd/system/enterprise-search.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-07-10 15:26:17 UTC; 3s ago
Docs: https://www.elastic.co/guide/en/enterprise-search/current/index.html
Main PID: 9144 (java)
Tasks: 19 (limit: 9536)
Memory: 209.0M
CGroup: /system.slice/enterprise-search.service
└─9144 java -cp /usr/share/enterprise-search/lib/war/lib/jruby-stdlib-9.2.13.0.jar:/usr/share/enterprise-search/lib/war/lib/jruby-core-9.2.13.0-complete.jar -Djruby.cli.warning.level=NIL -Djava.a>
Jul 10 15:26:17 ip-172-31 systemd[1]: Started Elastic Enterprise Search.
Jul 10 15:26:17 ip-172-31 enterprise-search[9144]: Found java executable in PATH
Jul 10 15:26:18 ip-172-31 enterprise-search[9144]: Java version detected: 11.0.11 (major version: 11)
Jul 10 15:26:18 ip-172-31 enterprise-search[9144]: Enterprise Search is starting...
Jul 10 15:26:18 ip-172-31 enterprise-search[9144]: Logs can be found in the location configured via the 'log_directory' setting (typically /var/log/enterprise-search)
但日志中没有任何新条目,也没有任何东西在定义的端口上监听。而像正常过程一样启动搜索
sudo /usr/share/enterprise-search/bin/enterprise-search
运行良好。
nohup
也没有帮助,这个过程在启动后不久就停止了,正如在这个帖子
我添加了评论转到该主题,但由于它已被标记为已解决,我不希望看到答案。提供的解决方案对我不起作用。
有什么建议么?
更新
journalctl -u enterprise-search.service
揭示了该服务目前因其自身日志的权限问题而失败。
例如
Jul 11 16:57:53 ip-172-31 enterprise-search[284346]: Unexpected exception while running Enterprise Search:
Jul 11 16:57:53 ip-172-31 enterprise-search[284346]: Error: Permission denied - /var/log/enterprise-search/stats.log at org/jruby/RubyIO.java:1237:in `sysopen'
将所有者更改enterprise-search
为以下:
app-server.log
connectors.log
filebeat
stats.log
system.log
worker.log
暂时解决了该问题,但是当日志轮换时该问题又会重新出现。
初始化现在失败,并显示:
enterprise-search[286929]: Unexpected exception while running Enterprise Search:
enterprise-search[286929]: NoMethodError: undefined method `join' for nil:NilClass
enterprise-search[286929]: run! at /usr/share/enterprise-search/lib/war/shared_togo/lib/shared_togo/cli.class:115
enterprise-search[286929]: <main> at bin/enterprise-search-internal:15
systemd[1]: enterprise-search.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: enterprise-search.service: Failed with result 'exit-code'.
我猜这仍然与权限有关,但我有点不知道我还需要更改什么。我也不知道如何确保日志enterprise-search
在轮换时始终跟随用户。
答案1
这个问题的最终解决方案是在更新问题时:更改日志文件的所有者以解决问题。上面提到的最后一个错误与启动时进程崩溃enterprise-search
有关。重新启动服务器解决了所有问题,现在一切都正常了。日志也在轮换。elasticsearch
enterprise-search