请选择 进入手机版 | 继续访问电脑版
 找回密码
 注册
首页 ≡≡网络技术≡≡ 服务器 泛微E10(e-cology)运维管理平台安装周边服务rabbitmq启 ...

泛微E10(e-cology)运维管理平台安装周边服务rabbitmq启动失败

灰儿 2024-2-1 13:42:14
泛微E10(e-cology)运维管理平台安装周边服务消息队列rabbitmq启动失败解决办法
服务器:Ubuntu 22.04.3 LTS
泛微ECOLOGY运维管理平台: e-monitor-V5.0.6.020230917-RC        

因为泛微E10运维管理平台对ubuntu 22.04版本兼容不好,安装之前,编辑rabbitmq自动化运维(ansible)安装包:/opt/e-monitor/ecology/tools/ansible-rabbitmq-3.7.7.zip修改后,安装的对应版本为:
Erlang版本:Erlang 24.2.1
RabbitMQ版本:RabbitMQ 3.8.16

安装周边服务时,提示消息队列rabbitmq安装失败,如图:

周边服务_rabbitmq安装失败.png

原因及解决方法:
查看/opt/e-monitor/package/ansible-rabbitmq/ansible-rabbitmq 自动化运维记录文件,发现执行到启动rabbitmq-server服务时,提示任务失败,相关执行记录如下:
  1. TASK [weaver.rabbitmq : Start service rabbitmq-server, if not started] *********
  2. fatal: [mqeef76]: FAILED! => {"changed": false, "msg": "Unable to restart service rabbitmq-server: Job for rabbitmq-server.service failed because the control process exited with error code.\nSee "systemctl status rabbitmq-server.service" and "journalctl -xeu rabbitmq-server.service" for details.\n"}
  3. NO MORE HOSTS LEFT *************************************************************
  4. PLAY RECAP *********************************************************************
  5. mqeef76                    : ok=27   changed=7    unreachable=0    failed=1    skipped=12   rescued=0    ignored=1   
复制代码
错误日志.png

根据运行记录,发现是在启动 rabbitmq 服务时出现在错误,于是我们在手工运行一次启动命令:
  1. service rabbitmq-server start
  2. systemctl start rabbitmq-server
复制代码

发现果然启动错误,我们根据提示,执行了 journalctl -xe ,定位到详细的报错日志信息;
  1. journalctl -xe
复制代码

通过这个执行到命令行后,会打印出非常多的问题信息,让我们继续往下定位到ERROR处:
  1. Feb 13 15:37:50 mqeef76 rabbitmq-server[26481]: Configuring logger redirection
  2. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: 15:37:51.676 [error] Error parsing configuration:
  3. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: 15:37:51.689 [error] File operation error: eacces. Target: /etc/rabbitmq/rabbitmq.conf. Function: get_file. Process: rabbit_prelaunch_sup.
  4. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: 15:37:51.695 [error]   - Could not open file (/etc/rabbitmq/rabbitmq.conf) for Reason undefined
  5. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: 15:37:51.695 [error] Are these files using the Cuttlefish format?
  6. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: 15:37:51.698 [error]
  7. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: 15:37:51.698 [error] BOOT FAILED
  8. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: BOOT FAILED
  9. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: 15:37:51.698 [error] ===========
  10. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: ===========
  11. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: 15:37:51.698 [error] Error during startup: {error,failed_to_parse_configuration_file}
  12. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: Error during startup: {error,failed_to_parse_configuration_file}
  13. Feb 13 15:37:51 mqeef76 rabbitmq-server[26481]: 15:37:51.698 [error]
复制代码

查看打印出来的前四条错误信息为:
  1. [error] Error parsing configuration:
  2. [error] File operation error: eacces. Target: /etc/rabbitmq/rabbitmq.conf. Function: get_file. Process: rabbit_prelaunch_sup.
  3. [error]   - Could not open file (/etc/rabbitmq/rabbitmq.conf) for Reason undefined
  4. [error] Are these files using the Cuttlefish format?
复制代码

接下来,我们来检查RabbitMQ配置文件中是否存在任何错误。你可以使用以下命令检查配置文件的语法是否正确:
  1. rabbitmqctl eval 'file:consult([{config_file}, {silent, true}]).'
复制代码
或者查看 rabbitmq 状态
  1. rabbitmqctl status
复制代码
运行这两条命令显示结果相同,显示内容如下:
  1. Error: unable to perform an operation on node 'rabbit@mqeef76'. Please see diagnostics information and suggestions below.

  2. Most common reasons for this are:

  3. * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
  4. * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
  5. * Target node is not running

  6. In addition to the diagnostics info below:

  7. * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
  8. * Consult server logs on node rabbit@mqeef76
  9. * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

  10. DIAGNOSTICS
  11. ===========

  12. attempted to contact: [rabbit@mqeef76]

  13. rabbit@mqeef76:
  14.   * connected to epmd (port 4369) on mqeef76
  15.   * epmd reports: node 'rabbit' not running at all
  16.                   no other nodes on mqeef76
  17.   * suggestion: start the node

  18. Current node details:
  19. * node name: 'rabbitmqcli-24-rabbit@mqeef76'
  20. * effective user's home directory: /opt/weaver/rabbitmq
  21. * Erlang cookie hash: uwA6pPy2Z6X3QNPinvgy9w==
复制代码
通过以上错误信息,检查 /etc/rabbitmq/rabbitmq.conf 配置文件有没有错误,发现abbitmq.conf文件权限为640,把权限改为644,再次运行“service rabbitmq-server start”命令启动服务,发现已启动正常。

重新安装rabbitmq办法:
删除上次安装目录和信息残留,即删除rabbitmq目录和已有 mnesia 信息
  1. rm -rf /opt/weaver/rabbitmq
  2. rm -rf /var/lib/rabbitmq
复制代码

注:
安装日志文件:/opt/e-monitor/package//logs/install.log
rabbitmq账号密码文件:
/opt/e-monitor/package/ansible-rabbitmq/rabbitmq.yml  
/opt/e-monitor/package/config/db.properties

相关命令:
# 查看erlang版本
erl -version
Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 12.2.1

# 查看RabbitMQ版本号:
进入在escript目录下可以获取到版本号
  1. # cd /usr/lib/rabbitmq/lib/rabbitmq_server-3.8.16/escript/
  2. # rabbitmqctl version
  3. 3.8.16
复制代码

# 检查RabbitMQ运行状态
rabbitmqctl status

# 查找RabbitMQ的安装路径
whereis rabbitmq
rabbitmq: /usr/lib/rabbitmq /etc/rabbitmq

# 启动 rabbitmq 服务
service rabbitmq-server start
systemctl start rabbitmq-server

# 关闭 rabbitmq 服务
service rabbitmq-server stop

# 重启 rabbitmq 服务
service rabbitmq-server restart

# 查看 rabbitmq 状态
service rabbitmq-server status

# 查看 rabbitmq 进程
我们可以通过ps -ef|grep rabbitmq命令来看 rabbitmq服务是否是启动
ps -ef | grep rabbitmq

灰儿 楼主 2024-2-1 14:40:24
http://www.admin365.cn/thread-112600-1-1.html   泛微_Ecology_10_运维管理平台手动部署方式安装过程
http://www.admin365.cn/thread-112697-1-1.html  泛微E10运维管理平台周边服务rabbitmq安装失败解决办法
http://www.admin365.cn/thread-112671-1-1.html  RabbitMQ启动报错的常见原因和解决方法
http://www.admin365.cn/thread-112659-1-1.html  RabbitMQ启动报错,journalctl日志:Error parsing configuration
http://www.admin365.cn/thread-112670-1-1.html  RabbitMQ启动报错,journalctl日志:gen_server,init_it,6

您需要登录后才可以回帖 登录 | 注册
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。
学习中心
站长自定义文字内容,利用碎片时间,随时随地获取优质内容。
Q设计语言 了解更多
Q Design 提供商家设计所需的指导与资源,帮商家快速完成产品设计、降低生产成本。