I have installed Solr on an Amazon Linux V2 instance using Salt and it is running fine:
[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"}
But when I do systemctl, it throws error:
[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.
For more info on failure, when I ran the journalctl -xe
command it says port 8983 is in use by process 15691, but that is the same process which started due to my installation:
My systemd file is as below out of which the state start-solr
fails.
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
Looks like systemd
gave up to start your service because it tries bind to already occupied port. Probably you need to kill some concurrent process that resides in memory by some reason to make your systemd service to run.
I suspect that process 15691, you've mentioned is not the one controlled by systemd
.