Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to Start rabbitmq server in centos 7 using systemctl

I am trying to start the rabbitmq server in centos 7. I installed erlang as it is a dependency to rabbitmq-server. Package erlang.x86_64 0:R16B-03.7.el7 .I then Installed rabbitmq using package rabbitmq-server-3.2.2-1.noarch.rpm. Installation was successful. I enabled management console uisng rabbitmq-plugins enable rabbitmq_management. But while starting the service rabbitmq-server it fails.

[root@tve-centos ~]# systemctl start rabbitmq-server.service
Job for rabbitmq-server.service failed. See 'systemctl status rabbitmq-server.service' and 'journalctl -xn' for details.
[root@tve-centos ~]# systemctl status rabbitmq-server.service
rabbitmq-server.service - LSB: Enable AMQP service provided by RabbitMQ broker
   Loaded: loaded (/etc/rc.d/init.d/rabbitmq-server)
   Active: failed (Result: exit-code) since Fri 2014-09-12 13:07:05 PDT; 8s ago
  Process: 20235 ExecStart=/etc/rc.d/init.d/rabbitmq-server start (code=exited, status=1/FAILURE)

Sep 12 13:07:04 tve-centos su[20245]: (to rabbitmq) root on none
Sep 12 13:07:05 tve-centos su[20296]: (to rabbitmq) root on none
Sep 12 13:07:05 tve-centos su[20299]: (to rabbitmq) root on none
Sep 12 13:07:05 tve-centos rabbitmq-server[20235]: Starting rabbitmq-server: FAILED - check /var/log/rabbitmq/startup_{log, _err}
Sep 12 13:07:05 tve-centos rabbitmq-server[20235]: rabbitmq-server.
Sep 12 13:07:05 tve-centos systemd[1]: rabbitmq-server.service: control process exited, code=exited status=1
Sep 12 13:07:05 tve-centos systemd[1]: Failed to start LSB: Enable AMQP service provided by RabbitMQ broker.
Sep 12 13:07:05 tve-centos systemd[1]: Unit rabbitmq-server.service entered failed state.

and logs shows /var/log/rabbitmq/startup_log BOOT FAILED ===========

Error description:
   {could_not_start,rabbitmq_management,
                    {could_not_start_listener,[{port,15672}],eacces}}

Log files (may contain more information):
   /var/log/rabbitmq/[email protected]
   /var/log/rabbitmq/[email protected]

but no process is using port 15672

But if I try to start it using /usr/sbin/rabbitmq-server .I successfully started the service. But my requirements are to start it using the systemctl.

like image 423
Vignesh Kumar Avatar asked Sep 12 '14 21:09

Vignesh Kumar


3 Answers

Better answer would be to actually fix SELinux and the firewall.

Open the port:

firewall-cmd --permanent --add-port=5672/tcp
firewall-cmd --reload
setsebool -P nis_enabled 1

That works for me.

like image 193
chriscowley Avatar answered Nov 07 '22 14:11

chriscowley


It looks like a port issue. To confirm that

systemctl stop firewalld
systemctl disable firewalld 

And disable SELinux for the time being in /etc/selinux/config file

SELINUX=disabled

Try reboot your machine and see whether the issue persists.

like image 27
cucucool Avatar answered Nov 07 '22 13:11

cucucool


After running this command:

[root@gcp-hehe-amqp ~]# /sbin/service rabbitmq-server start

And getting the error:

Redirecting to /bin/systemctl start rabbitmq-server.service
Job for rabbitmq-server.service failed because the control process exited with error code. See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details"

After many attempts, I solved the error by following this:

  1. run command: firewall-cmd --permanent --add-port=5672/tcp
  2. then: firewall-cmd --reload
  3. change this: SELINUX=disabled at /etc/selinux/config
  4. Enable the proxy protocol to true at /etc/rabbitmq/rabbitmq.conf

    proxy_protocol = true

like image 1
Jeanne Y. Avatar answered Nov 07 '22 14:11

Jeanne Y.