泛微E10(e-cology)运维管理平台周边服务rabbitmq安装失败解决办法
服务器:Ubuntu 22.04.3 LTS
泛微ECOLOGY运维管理平台: e-monitor-V5.0.6.020230917-RC
由于泛微Ecology10.0.2309.02_forLinux.wes版本内的ansible-rabbitmq-3.7.7.zip工具对ubuntu 22.04兼容不好,安装前,先替换 /e-monitor/ecology/tools/ansible-rabbitmq-3.7.7.zip 压缩包文件,原文件大小为66.5 MB,替换后的ansible-rabbitmq-3.7.7.zip文件大小为95.5 MB,新工具包内的对应RabbitMQ版本为:Erlang版本:Erlang 24.2.1
RabbitMQ版本:RabbitMQ 3.8.16
安装周边服务时,提示消息队列rabbitmq安装失败,如图:
原因分析:
查看/opt/e-monitor/package/ansible-rabbitmq/ansible-rabbitmq 自动化运维记录文件,发现执行到启动rabbitmq-server服务时,提示任务失败,相关执行记录如下:
- TASK [weaver.rabbitmq : Install rabbitmq-server dependencies] ******************
- [DEPRECATION WARNING]: Invoking "apt" only once while using a loop via
- squash_actions is deprecated. Instead of using a loop to supply multiple items
- and specifying `name: "{{ item }}"`, please use `name: ['socat', 'erlang-base',
- 'erlang-asn1', 'erlang-crypto', 'erlang-eldap', 'erlang-ftp', 'erlang-inets',
- 'erlang-mnesia', 'erlang-os-mon', 'erlang-parsetools', 'erlang-public-key',
- 'erlang-runtime-tools', 'erlang-snmp', 'erlang-ssl', 'erlang-syntax-tools',
- 'erlang-tftp', 'erlang-tools', 'erlang-xmerl']` and remove the loop. This
- feature will be removed in version 2.11. Deprecation warnings can be disabled
- by setting deprecation_warnings=False in ansible.cfg.
- changed: [mqdc871] => (item=['socat', 'erlang-base', 'erlang-asn1', 'erlang-crypto', 'erlang-eldap', 'erlang-ftp', 'erlang-inets', 'erlang-mnesia', 'erlang-os-mon', 'erlang-parsetools', 'erlang-public-key', 'erlang-runtime-tools', 'erlang-snmp', 'erlang-ssl', 'erlang-syntax-tools', 'erlang-tftp', 'erlang-tools', 'erlang-xmerl'])
- TASK [weaver.rabbitmq : install rabbitmq server for ubuntu 20.04] **************
- skipping: [mqdc871]
- TASK [weaver.rabbitmq : install rabbitmq server for ubuntu 20.04] **************
- fatal: [mqdc871]: FAILED! => {"changed": true, "cmd": ["dpkg", "-i", "/tmp/rabbitmq-server_3.8.16-1_all.deb"], "delta": "0:00:00.013163", "end": "2024-02-20 16:28:56.411903", "msg": "non-zero return code", "rc": 2, "start": "2024-02-20 16:28:56.398740", "stderr": "dpkg: error: dpkg frontend lock was locked by another process with pid 171507\nNote: removing the lock file is always wrong, and can end up damaging the\nlocked area and the entire system. See <https://wiki.debian.org/Teams/Dpkg/FAQ>.", "stderr_lines": ["dpkg: error: dpkg frontend lock was locked by another process with pid 171507", "Note: removing the lock file is always wrong, and can end up damaging the", "locked area and the entire system. See <https://wiki.debian.org/Teams/Dpkg/FAQ>."], "stdout": "", "stdout_lines": []}
- NO MORE HOSTS LEFT *************************************************************
- PLAY RECAP *********************************************************************
- mqdc871 : ok=20 changed=7 unreachable=0 failed=1 skipped=9 rescued=0 ignored=2
复制代码
在安装日志发现一段错误提示代码,内容如下:- dpkg: error: dpkg frontend lock was locked by another process with pid 171507"
复制代码
这个错误意味着dpkg正被另一个进程锁住,无法获取锁来执行操作。
有几个可能的原因:
1. 另一个包管理工具如apt或aptitude正在运行,导致dpkg无法获取锁。等待它们执行完成即可。
2. 之前的dpkg或其他包管理工具异常退出,没有释放锁。可以使用:sudo rm /var/lib/dpkg/lock手动删除锁文件。
3. 也有可能是软件包数据库损坏,可以尝试:sudo dpkg --configure -a来尝试修复。
4. 也可以检查是否有相关进程占用着锁,使用:sudo lsof /var/lib/dpkg/lock查看。
5. 在极少数情况下,也可能是权限问题,可以尝试切换到root用户再操作。
解决方法:
基本上确保没有其他包管理工具正在运行,手动删除锁文件,程序安装rabbitmq,顺利解决了问题。
|
|