Rabbitmq 小记:docker迁移数据之后无法启动,Cookie file varlibrabbitmq.erlang.cookie must be accessible by owne

Rabbitmq 小记:docker迁移数据之后无法启动,Cookie file varlibrabbitmq.erlang.cookie must be accessible by owne,第1张

Rabbitmq 小记:docker迁移数据之后无法启动,Cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owne 1-1:环境描述

ubuntu:20.04docker-compose: 2.2.2docker: Docker version 20.10.12, build e91ed57rabbitmq: RabbitMQ 3.9.11 1-2:问题重现

(base) ➜  rabbitmq_test2 docker-compose up 
[+] Running 2/2
 ⠿ Network rabbitmq_test2_default  Cre...                                  0.0s
 ⠿ Container rabbitmq1             Created                                 0.7s
Attaching to rabbitmq1
rabbitmq1  | 2022-01-16 15:07:46.501437+00:00 [erro] <0.145.0> cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>     supervisor: {local,net_sup}
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>     errorContext: start_error
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>     reason: {"cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only",
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>              [{auth,init_no_setcookie,0,[{file,"auth.erl"},{line,293}]},
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>               {auth,init,1,[{file,"auth.erl"},{line,144}]},
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>               {gen_server,init_it,2,[{file,"gen_server.erl"},{line,423}]},
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>               {gen_server,init_it,6,[{file,"gen_server.erl"},{line,390}]},
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>               {proc_lib,init_p_do_apply,3,
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>                         [{file,"proc_lib.erl"},{line,226}]}]}
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>     offender: [{pid,undefined},
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>                {id,auth},
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>                {mfargs,{auth,start_link,[]}},
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>                {restart_type,permanent},
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>                {significant,false},
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>                {shutdown,2000},
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0>                {child_type,worker}]
rabbitmq1  | 2022-01-16 15:07:46.506942+00:00 [erro] <0.143.0> 
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>   crasher:
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     initial call: auth:init/1
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     pid: <0.145.0>
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     registered_name: []
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     exception error: "cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only"
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>       in function  auth:init_no_setcookie/0 (auth.erl, line 293)
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>       in call from auth:init/1 (auth.erl, line 144)
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>       in call from gen_server:init_it/2 (gen_server.erl, line 423)
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>       in call from gen_server:init_it/6 (gen_server.erl, line 390)
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     ancestors: [net_sup,kernel_sup,<0.47.0>]
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     message_queue_len: 0
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     messages: []
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     links: [<0.143.0>]
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     dictionary: []
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     trap_exit: true
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     status: running
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     heap_size: 610
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     stack_size: 29
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>     reductions: 2016
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0>   neighbours:
rabbitmq1  | 2022-01-16 15:07:46.507008+00:00 [erro] <0.145.0> 
rabbitmq1  | 
rabbitmq1  | BOOT FAILED
rabbitmq1  | ===========
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0> 
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0> BOOT FAILED
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0> ===========
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0> Exception during startup:
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0> 
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0> error:{badmatch,{error,{{shutdown,{failed_to_start_child,auth,{"cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only",[{auth,init_no_setcookie,0,[{file,"auth.erl"},{line,293}]},{auth,init,1,[{file,"auth.erl"},{line,144}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,423}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,390}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[[rabbit_prelaunch_21@localhost,shortnames],false,net_sup_dynamic]},permanent,false,1000,supervisor,[erl_distribution]}}}}
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0> 
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0>     rabbit_prelaunch_dist:duplicate_node_check/1, line 78
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0>     rabbit_prelaunch_dist:setup/1, line 23
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0>     rabbit_prelaunch:do_run/0, line 115
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0>     rabbit_prelaunch:run_prelaunch_first_phase/0, line 32
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0>     supervisor:do_start_child_i/3, line 414
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0>     supervisor:do_start_child/2, line 400
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0>     supervisor:-start_children/2-fun-0-/3, line 384
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0>     supervisor:children_map/4, line 1250
rabbitmq1  | 2022-01-16 15:07:46.510413+00:00 [erro] <0.130.0> 
rabbitmq1  | Exception during startup:
rabbitmq1  | 
rabbitmq1  | error:{badmatch,{error,{{shutdown,{failed_to_start_child,auth,{"cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only",[{auth,init_no_setcookie,0,[{file,"auth.erl"},{line,293}]},{auth,init,1,[{file,"auth.erl"},{line,144}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,423}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,390}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[[rabbit_prelaunch_21@localhost,shortnames],false,net_sup_dynamic]},permanent,false,1000,supervisor,[erl_distribution]}}}}
rabbitmq1  | 
rabbitmq1  |     rabbit_prelaunch_dist:duplicate_node_check/1, line 78
rabbitmq1  |     rabbit_prelaunch_dist:setup/1, line 23
rabbitmq1  |     rabbit_prelaunch:do_run/0, line 115
rabbitmq1  |     rabbit_prelaunch:run_prelaunch_first_phase/0, line 32
rabbitmq1  |     supervisor:do_start_child_i/3, line 414
rabbitmq1  |     supervisor:do_start_child/2, line 400
rabbitmq1  |     supervisor:-start_children/2-fun-0-/3, line 384
rabbitmq1  |     supervisor:children_map/4, line 1250
rabbitmq1  | 
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>     supervisor: {local,rabbit_prelaunch_sup}
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>     errorContext: start_error
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>     reason: {badmatch,
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                 {error,
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                     {{shutdown,
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                          {failed_to_start_child,auth,
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                              {"cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only",
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                               [{auth,init_no_setcookie,0,
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                                    [{file,"auth.erl"},{line,293}]},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                                {auth,init,1,[{file,"auth.erl"},{line,144}]},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                                {gen_server,init_it,2,
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                                    [{file,"gen_server.erl"},{line,423}]},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                                {gen_server,init_it,6,
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                                    [{file,"gen_server.erl"},{line,390}]},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                                {proc_lib,init_p_do_apply,3,
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                                    [{file,"proc_lib.erl"},{line,226}]}]}}},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                      {child,undefined,net_sup_dynamic,
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                          {erl_distribution,start_link,
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                              [[rabbit_prelaunch_21@localhost,shortnames],
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                               false,net_sup_dynamic]},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                          permanent,false,1000,supervisor,
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                          [erl_distribution]}}}}
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>     offender: [{pid,undefined},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                {id,prelaunch},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                {mfargs,{rabbit_prelaunch,run_prelaunch_first_phase,[]}},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                {restart_type,transient},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                {significant,false},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                {shutdown,5000},
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0>                {child_type,worker}]
rabbitmq1  | 2022-01-16 15:07:47.513680+00:00 [erro] <0.130.0> 
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>   crasher:
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     initial call: application_master:init/4
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     pid: <0.128.0>
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     registered_name: []
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     exception exit: {{shutdown,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                       {failed_to_start_child,prelaunch,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                        {badmatch,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                         {error,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                          {{shutdown,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                            {failed_to_start_child,auth,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                             {"cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only",
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                              [{auth,init_no_setcookie,0,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                                [{file,"auth.erl"},{line,293}]},
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                               {auth,init,1,[{file,"auth.erl"},{line,144}]},
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                               {gen_server,init_it,2,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                                [{file,"gen_server.erl"},{line,423}]},
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                               {gen_server,init_it,6,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                                [{file,"gen_server.erl"},{line,390}]},
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                               {proc_lib,init_p_do_apply,3,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                                [{file,"proc_lib.erl"},{line,226}]}]}}},
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                           {child,undefined,net_sup_dynamic,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                            {erl_distribution,start_link,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                             [[rabbit_prelaunch_21@localhost,shortnames],
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                              false,net_sup_dynamic]},
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                            permanent,false,1000,supervisor,
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                            [erl_distribution]}}}}}},
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>                      {rabbit_prelaunch_app,start,[normal,[]]}}
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>       in function  application_master:init/4 (application_master.erl, line 142)
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     ancestors: [<0.127.0>]
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     message_queue_len: 1
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     messages: [{'EXIT',<0.129.0>,normal}]
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     links: [<0.127.0>,<0.44.0>]
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     dictionary: []
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     trap_exit: true
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     status: running
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     heap_size: 610
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     stack_size: 29
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>     reductions: 205
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0>   neighbours:
rabbitmq1  | 2022-01-16 15:07:47.514892+00:00 [erro] <0.128.0> 
rabbitmq1  | 2022-01-16 15:07:47.516859+00:00 [noti] <0.44.0> Application rabbitmq_prelaunch exited with reason: {{shutdown,{failed_to_start_child,prelaunch,{badmatch,{error,{{shutdown,{failed_to_start_child,auth,{"cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only",[{auth,init_no_setcookie,0,[{file,"auth.erl"},{line,293}]},{auth,init,1,[{file,"auth.erl"},{line,144}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,423}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,390}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[[rabbit_prelaunch_21@localhost,shortnames],false,net_sup_dynamic]},permanent,false,1000,supervisor,[erl_distribution]}}}}}},{rabbit_prelaunch_app,start,[normal,[]]}}
rabbitmq1  | {"Kernel pid terminated",application_controller,"{application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{badmatch,{error,{{shutdown,{failed_to_start_child,auth,{"cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only",[{auth,init_no_setcookie,0,[{file,"auth.erl"},{line,293}]},{auth,init,1,[{file,"auth.erl"},{line,144}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,423}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,390}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[[rabbit_prelaunch_21@localhost,shortnames],false,net_sup_dynamic]},permanent,false,1000,supervisor,[erl_distribution]}}}}}},{rabbit_prelaunch_app,start,[normal,[]]}}}"}
rabbitmq1  | Kernel pid terminated (application_controller) ({application_start_failure,rabbitmq_prelaunch,{{shutdown,{failed_to_start_child,prelaunch,{badmatch,{error,{{shutdown,{failed_to_start_child,auth,{"cookie file /var/lib/rabbitmq/.erlang.cookie must be accessible by owner only",[{auth,init_no_setcookie,0,[{file,"auth.erl"},{line,293}]},{auth,init,1,[{file,"auth.erl"},{line,144}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,423}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,390}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}}},{child,undefined,net_sup_dynamic,{erl_distribution,start_link,[[rabbit_prelaunch_21@localhost,shortnames],false,net_sup_dynamic]},permanent,false,1000,supervisor,[erl_distribution]}}}}}},{rabbit_prelaunch_app,start,[normal,[]]}}})
rabbitmq1  | 
rabbitmq1 exited with code 0
1-3:问题解决

归根到底是数据迁移之后权限的问题,迁移之后,docker挂载该文件时,挂载的文件权限不是400(所有者读)/600(所有者读写)/700(所有者读写执)会报错。我一直以为777总不会出现问题了吧,但实际上,777还真不行= =,700我解决了这个问题。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5704820.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存