Rabbitmq

在全新安裝 Redhat8 時,在新 EC2 實例上,RabbitMQ 失敗,failed_to_start_child

  • March 5, 2022

更新:

如果我做:

yum upgrade

我懂了:

Skip Packages With Broken Dependencies When 

我該如何解決?

舊帖:

我在這裡找到了文件erl_crash.dump

/var/lib/rabbitmq/erl_crash.dump 

如果我這樣做:

head -n 50 /var/lib/rabbitmq/erl_crash.dump

我得到:

=erl_crash_dump:0.5
Tue Mar  1 20:00:36 2022
Slogan: Kernel pid terminated (application_controller) ({application_start_failure,credentials_obfuscation,{{shutdown,{failed_to_start_child,credentials_obfuscaton_svc,{undef,[{crypto,macN,[hmac,sha256,<<185,
System version: Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1]
Compiled: Fri Sep  6 18:47:55 2019
Taints: crypto
Atoms: 13923
Calling Thread: scheduler:1
=scheduler:1
Scheduler Sleep Info Flags: 
Scheduler Sleep Info Aux Work: THR_PRGR_LATER_OP
Current Port: 
Run Queue Max Length: 0
Run Queue High Length: 0
Run Queue Normal Length: 0
Run Queue Low Length: 0
Run Queue Port Length: 0
Run Queue Flags: OUT_OF_WORK | HALFTIME_OUT_OF_WORK | NONEMPTY | EXEC
Current Process: <0.0.0>
Current Process State: Running
Current Process Internal State: ACT_PRIO_NORMAL | USR_PRIO_NORMAL | PRQ_PRIO_NORMAL | ACTIVE | RUNNING
Current Process Program counter: 0x0000ffff5cd5d020 (init:printable_list/1 + 24)
Current Process CP: 0x0000ffff5cd5dcc8 (init:boot_loop/2 + 1944)
Current Process Limited Stack Trace:
0x0000ffff5a93b9f0:SReturn addr 0xACD16DC0 (<terminate process normally>)

我不知道怎麼讀這個。是failed_to_start_child錯誤嗎?如果是,那是什麼意思?我如何解決它?

我有一個新的 EC2 實例和一個全新的 Redhat8 安裝,所有東西都安裝了yumordnf但我在 RabbitMQ 上不斷收到錯誤,它試圖啟動但立即失敗。如果我做:

tail -n 500 /var/log/messages

然後我看到這條消息,一遍又一遍地重複:

Mar  1 18:23:47 ip-172-31-56-22 rabbitmq-server[350248]: {"Kernel pid terminated",application_controller,"{application_start_failure,credentials_obfuscation,{{shutdown,{failed_to_start_child,credentials_obfuscaton_svc,{undef,[{crypto,macN,[hmac,sha256,<<80,84,120,32,178,183,28,70,220,34,20,13,145,69,180,207,145,18,30,76,255,205,110,198,166,173,68,94,39,2,201,5,116,139,211,47,32,125,29,33,161,98,58,78,127,162,252,146,192,110,153,88,149,58,190,136,74,66,191,238,168,79,190,2,120,197,45,101,48,216,168,33,102,142,44,160,25,38,229,27,132,117,91,23,171,84,244,84,230,129,67,131,57,152,36,238,207,222,137,164,79,90,128,114,75,111,48,205,252,239,253,68,193,32,61,190,149,117,145,224,144,191,59,109,247,145,102,240>>,[<<167,114,26,126,33,160,146,70,65,253,176,24,5,41,155,193>>,<<0,0,0,1>>],32],[]},{credentials_obfuscation_pbe,xor_sum,7,[{file,\"src/credentials_obfuscation_pbe.erl\"},{line,160}]},{credentials_obfuscation_pbe,blocks,10,[{file,\"src/credentials_obfuscation_pbe.erl\"},{line,152}]},{credentials_obfuscation_pbe,make_key,5,[{file,\"src/credentials_obfuscation_pbe.erl\"},{line,94}]},{credentials_obfuscation_pbe,encrypt,5,[{file,\"src/credentials_obfuscation_pbe.erl\"},{line,76}]},{credentials_obfuscation_svc,check,3,[{file,\"src/credentials_obfuscation_svc.erl\"},{line,163}]},{credentials_obfuscation_svc,init_state,0,[{file,\"src/credentials_obfuscation_svc.erl\"},{line,133}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,374}]}]}}},{credentials_obfuscation_app,start,[normal,[]]}}}"}
Mar  1 18:23:47 ip-172-31-56-22 rabbitmq-server[350248]: Kernel pid terminated (application_controller) ({application_start_failure,credentials_obfuscation,{{shutdown,{failed_to_start_child,credentials_obfuscaton_svc,{undef,[{crypto,macN,[hmac,sha256,<<80,8
Mar  1 18:23:47 ip-172-31-56-22 rabbitmq-server[350248]: #015
Mar  1 18:23:47 ip-172-31-56-22 rabbitmq-server[350248]: Crash dump is being written to: erl_crash.dump...done
Mar  1 18:23:47 ip-172-31-56-22 systemd[1]: rabbitmq-server.service: Main process exited, code=exited, status=1/FAILURE
Mar  1 18:23:47 ip-172-31-56-22 systemd[1]: rabbitmq-server.service: Failed with result 'exit-code'.
Mar  1 18:23:47 ip-172-31-56-22 systemd[1]: Failed to start RabbitMQ broker.

我正在努力思考問題所在。我相信我已經打開了所有必要的埠。

Crash dump is being written to: erl_crash.dump...done

我讀過這個:

https://stackoverflow.com/questions/63053451/distribution-failed-failed-to-start-child-rabbitmq-docker-compose-issue

我已經在安全組上打開了 4369 埠,但這並沒有幫助。

如果我執行:

epmd -names

我得到:

epmd: up and running on port 4369 with data

所以這是有效的,但 RabbitMQ 不是。

如果我這樣做:

rabbitmqctl start_app 

我得到:

Starting node rabbit@ip-172-31-56-22 ...
Error: unable to perform an operation on node 'rabbit@ip-172-31-56-22'. Please see diagnostics information and suggestions below.

Most common reasons for this are:

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

In addition to the diagnostics info below:

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

DIAGNOSTICS
===========

attempted to contact: ['rabbit@ip-172-31-56-22']

rabbit@ip-172-31-56-22:
 * connected to epmd (port 4369) on ip-172-31-56-22
 * epmd reports: node 'rabbit' not running at all
                 no other nodes on ip-172-31-56-22
 * suggestion: start the node

Current node details:
* node name: 'rabbitmqcli-871-rabbit@ip-12-131-56-22'
* effective user's home directory: /var/lib/rabbitmq
* Erlang cookie hash: Gug6Jfak+f3/k+ww6vhA==

我的印像是安裝失敗。每當我使用時,我都會看到一些關於 RabbitMQ 的資訊,即使我的命令與 RabbitMQ 無關。例如,我這樣做:

sudo yum install screen

部分輸出是:

rabbitmq_rabbitmq-server                                                                    5.2 kB/s | 1.8 kB     00:00    

rabbitmq_rabbitmq-server-source                                                                   3.4 kB/s | 951  B     00:00 

每當我使用時,我都會看到這兩行yum install,每次使用都會提到 RabbitMQ,yum install就好像有一些奇怪的記憶體失敗問題一樣,這讓我感到不安。

我也看到了這個:

[/usr/lib/tmpfiles.d/rabbitmq-server.conf:1] Line references path below legacy directory /var/run/, updating /var/run/rabbitmq → /run/rabbitmq; please update the tmpfiles.d/ drop-in file accordingly.

顯然有些安裝出錯了。執行時我注意到此消息yum install

“跳過依賴項損壞的包”

我無法解決這個問題。我不得不放棄那個 EC2 實例並重新開始一個新的 EC2 實例。

基於我發現的幾件事:

似乎升級 RabbitMQ 可能會解決這個問題:https ://www.rabbitmq.com/install-rpm.html

引用自:https://serverfault.com/questions/1095100