lucene Solr正在运行,但systemctl状态为非活动

hfwmuf9z  于 2022-11-07  发布在  Lucene
关注(0)|答案(2)|浏览(216)

我已经使用Salt在Amazon Linux V2示例上安装了Solr,它运行良好:

[root@ip-10-231-93-23[gtndorctq-solrms-1-1-v2] ec2-user]# service solr status
su: warning: cannot change directory to /home/solr: No such file or directory

Found 1 Solr nodes: 

Solr process 15691 running on port 8983
{
  "solr_home":"/database/solr/data",
  "version":"6.6.3 d1e9bbd333ea55cfa0c75d324424606e857a775b - sarowe - 2018-03-02 15:09:34",
  "startTime":"2020-06-02T13:19:30.722Z",
  "uptime":"0 days, 0 hours, 35 minutes, 4 seconds",
  "memory":"50.6 MB (%10.3) of 490.7 MB"}

但是当我执行systemctl时,它会抛出错误:

[root@ip-10-231-93-23[gtndorctq-solrms-1-1-v2] ec2-user]# systemctl status solr
● solr.service - Apache SOLR
   Loaded: loaded (/etc/systemd/system/solr.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Tue 2020-06-02 13:19:44 UTC; 35min ago

Jun 02 13:19:44 ip-10-231-93-23.ade.gtncloud.com systemd[1]: solr.service: control process exited, code=exited status=1
Jun 02 13:19:44 ip-10-231-93-23.ade.gtncloud.com systemd[1]: Failed to start Apache SOLR.
Jun 02 13:19:44 ip-10-231-93-23.ade.gtncloud.com systemd[1]: Unit solr.service entered failed state.
Jun 02 13:19:44 ip-10-231-93-23.ade.gtncloud.com systemd[1]: solr.service failed.
Jun 02 13:19:44 ip-10-231-93-23.ade.gtncloud.com systemd[1]: solr.service holdoff time over, scheduling restart.
Jun 02 13:19:44 ip-10-231-93-23.ade.gtncloud.com systemd[1]: start request repeated too quickly for solr.service
Jun 02 13:19:44 ip-10-231-93-23.ade.gtncloud.com systemd[1]: Failed to start Apache SOLR.
Jun 02 13:19:44 ip-10-231-93-23.ade.gtncloud.com systemd[1]: Unit solr.service entered failed state.
Jun 02 13:19:44 ip-10-231-93-23.ade.gtncloud.com systemd[1]: solr.service failed.
[root@ip-10-231-93-23[gtndorctq-solrms-1-1-v2] ec2-user]# systemctl start solr
Job for solr.service failed because the control process exited with error code. See "systemctl status solr.service" and "journalctl -xe" for details.

有关失败的更多信息,当我运行journalctl -xe命令时,它显示端口8983正由进程15691使用,但这与由于我的安装而启动的进程是同一个:
我的systemd文件如下所示,其中状态start-solr失败。

solr-service-systemd-file:
  file.managed:
    - source: salt://config/solr.service
    - name: /etc/systemd/system/solr.service
    - mode: 0644
  module.run:
    - name: service.systemctl_reload
    - onchanges:
      - file: solr-service-systemd-file

start-solr:
  service.running:
    - name: solr
    - enable: True
    - watch:
      - file: solr-service-systemd-file
    - require:
      - file: solr-service-systemd-file
eqfvzcg8

eqfvzcg81#

是的,我注意到安装Solr后默认启动,所以我做了一个停止,然后通过Systemd启动,现在问题解决了。

tkclm6bt

tkclm6bt2#

看起来systemd已放弃启动您的服务,因为它尝试绑定到已占用的端口。可能您需要终止由于某种原因驻留在内存中的某个并发进程,以使systemd服务运行。
我怀疑你提到的进程15691不是由systemd控制的进程。

相关问题