Not able to Start rabbitmq server in centos 7 using systemctl

Vignesh Kumar picture Vignesh Kumar · Sep 12, 2014 · Viewed 36.2k times · Source

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.

Answer

chriscowley picture chriscowley · Nov 16, 2014

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.