当前位置:   article > 正文

linux下安装rabbitmq可能会遇到的问题_rabbitmq main process existed,code=existed,status

rabbitmq main process existed,code=existed,status =127

linux下安装rabbitmq遇到的问题大多数是rabbitmq版本和erlang版本不兼容问题

问题1:erlang版本要求

erlang >= 21.0 is needed by rabbitmq-server-3.8.12-1.el7.noarch
解决方法:
去官网下载要求的版本

问题2:erlang版本已经下载了要求的版本还是出现问题2的错误

解决方法:
加上–nodeps参数

[root@slave2 local]# rpm -ivh --nodeps rabbitmq-server-3.8.12-1.el7.noarch.rpm 
  • 1

问题3:启动rabbitmq报错

[root@slave2 rabbitmq]# systemctl start rabbitmq-server
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.
  • 1
  • 2

解决方法:
查看日志

[root@slave2 rabbitmq]# journalctl -xe
Feb 19 07:15:52 slave2 systemd[1]: Failed to start RabbitMQ broker.
-- Subject: Unit rabbitmq-server.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
   Unit rabbitmq-server.service has failed.
-- 
-- The result is failed.
Feb 19 07:15:52 slave2 systemd[1]: Unit rabbitmq-server.service entered failed state.
Feb 19 07:15:52 slave2 systemd[1]: rabbitmq-server.service failed.
Feb 19 07:16:01 slave2 polkitd[902]: Registered Authentication Agent for unix-process:52647:403980 (system bus name :1.27 [/usr/bin/pk
Feb 19 07:16:02 slave2 systemd[1]: rabbitmq-server.service holdoff time over, scheduling restart.
Feb 19 07:16:02 slave2 systemd[1]: Stopped RabbitMQ broker.
-- Subject: Unit rabbitmq-server.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit rabbitmq-server.service has finished shutting down.
Feb 19 07:16:02 slave2 systemd[1]: Starting RabbitMQ broker...
-- Subject: Unit rabbitmq-server.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit rabbitmq-server.service has begun starting up.
Feb 19 07:16:02 slave2 rabbitmq-server[52652]: /usr/lib/rabbitmq/bin/rabbitmq-server: line 82: exec: erl: not found
Feb 19 07:16:02 slave2 systemd[1]: rabbitmq-server.service: main process exited, code=exited, status=127/n/a
Feb 19 07:16:02 slave2 systemd[1]: Failed to start RabbitMQ broker.
-- Subject: Unit rabbitmq-server.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit rabbitmq-server.service has failed.
-- 
-- The result is failed.
Feb 19 07:16:02 slave2 systemd[1]: Unit rabbitmq-server.service entered failed state.
Feb 19 07:16:02 slave2 systemd[1]: rabbitmq-server.service failed.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

发现错误提示,找不到erl环境

Feb 19 07:16:02 slave2 rabbitmq-server[52652]: /usr/lib/rabbitmq/bin/rabbitmq-server: line 82: exec: erl: not found
  • 1

修改rabbitmq-server启动脚本(启动脚本位置可以在报错日志里面拿到我的是上面报错提示的/usr/lib/rabbitmq/bin/rabbitmq-server)在set -e下面添加两行

#erlang
export PATH=$PATH:/usr/local/erlang/bin
  • 1
  • 2
[root@slave2 rabbitmq]# vim /usr/lib/rabbitmq/bin/rabbitmq-server 
#!/bin/sh
# vim:sw=4:et:
##  The contents of this file are subject to the Mozilla Public License
##  Version 1.1 (the "License"); you may not use this file except in
##  compliance with the License. You may obtain a copy of the License
##  at https://www.mozilla.org/MPL/
##
##  Software distributed under the License is distributed on an "AS IS"
##  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
##  the License for the specific language governing rights and
##  limitations under the License.
##
##  The Original Code is RabbitMQ.
##
##  The Initial Developer of the Original Code is GoPivotal, Inc.
##  Copyright (c) 2007-2021 VMware, Inc. or its affiliates.  All rights reserved.
##

set -e
#erlang
export PATH=$PATH:/usr/local/erlang/bin
# Get default settings with user overrides for (RABBITMQ_)<var_name>
# Non-empty defaults should be set in rabbitmq-env
SCRIPTS_DIR=$(dirname "$0")
. "$SCRIPTS_DIR/rabbitmq-env"

[ "$NOTIFY_SOCKET" ] && RUNNING_UNDER_SYSTEMD=true

RABBITMQ_DEFAULT_ALLOC_ARGS="+MBas ageffcbf +MHas ageffcbf +MBlmbcs 512 +MHlmbcs 512 +MMmcs 30"

# Bump ETS table limit to 50000
if [ "x" = "x$ERL_MAX_ETS_TABLES" ]; then
    ERL_MAX_ETS_TABLES=50000
fi

check_start_params() {
    check_not_empty RABBITMQ_BOOT_MODULE
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/木道寻08/article/detail/928334
推荐阅读
相关标签
  

闽ICP备14008679号