日志:2024-01-19T11:21:10.028678+08:00 [error] crasher: initial call: ecpool_worker:init/1, pid: <0.5583.1>, registered_name: , exit: {{{badmatch,{error,econnrefused}},[{mysql_conn,connect_socket,1,[{file,“mysql_conn.erl”},{line,160}]},{mysql_conn,‘-connect/1-fun-0-’,2,[{file,“mysql_conn.erl”},{line,136}]}]},[{gen_server,init_it,6,[{file,“gen_server.erl”},{line,407}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [<0.5582.1>,<0.5580.1>,ecpool_sup,<0.2583.0>], message_queue_len: 0, messages: , links: [<0.5582.1>], dictionary: , trap_exit: true, status: running, heap_size: 610, stack_size: 28, reductions: 280; neighbours:
2024-01-19T11:21:10.031169+08:00 [error] msg: start_ecpool_error, mfa: emqx_resource_pool:start/3, line: 44, pool_name: <<“emqx_authn_mysql:24”>>, reason: {{badmatch,{error,econnrefused}},[{mysql_conn,connect_socket,1,[{file,“mysql_conn.erl”},{line,160}]},{mysql_conn,‘-connect/1-fun-0-’,2,[{file,“mysql_conn.erl”},{line,136}]}]}
2024-01-19T11:21:10.028099+08:00 [error] Error in process <0.5585.1> on node ‘emqx@127.0.0.1’ with exit value:, {{badmatch,{error,econnrefused}},[{mysql_conn,connect_socket,1,[{file,“mysql_conn.erl”},{line,160}]},{mysql_conn,‘-connect/1-fun-0-’,2,[{file,“mysql_conn.erl”},{line,136}]}]}
2024-01-19T11:21:10.031565+08:00 [warning] msg: start_resource_failed, mfa: emqx_resource_manager:start_resource/2, line: 464, id: <<“emqx_authn_mysql:24”>>, reason: {start_pool_failed,<<“emqx_authn_mysql:24”>>,{{badmatch,{error,econnrefused}},[{mysql_conn,connect_socket,1,[{file,“mysql_conn.erl”},{line,160}]},{mysql_conn,‘-connect/1-fun-0-’,2,[{file,“mysql_conn.erl”},{line,136}]}]}}
2024-01-19T11:22:10.053706+08:00 [error] Supervisor: {<0.5607.1>,ecpool_worker_sup}. Context: start_error. Reason: {{badmatch,{error,econnrefused}},[{mysql_conn,connect_socket,1,[{file,“mysql_conn.erl”},{line,160}]},{mysql_conn,‘-connect/1-fun-0-’,2,[{file,“mysql_conn.erl”},{line,136}]}]}. Offender: id={worker,1},pid=undefined.
2024-01-19T11:22:10.054692+08:00 [error] Supervisor: {<0.5605.1>,ecpool_pool_sup}. Context: start_error. Reason: {shutdown,{failed_to_start_child,{worker,1},{{badmatch,{error,econnrefused}},[{mysql_conn,connect_socket,1,[{file,“mysql_conn.erl”},{line,160}]},{mysql_conn,‘-connect/1-fun-0-’,2,[{file,“mysql_conn.erl”},{line,136}]}]}}}. Offender: id=worker_sup,pid=undefined.
2024-01-19T11:22:10.054084+08:00 [error] crasher: initial call: ecpool_worker:init/1, pid: <0.5608.1>, registered_name: , exit: {{{badmatch,{error,econnrefused}},[{mysql_conn,connect_socket,1,[{file,“mysql_conn.erl”},{line,160}]},{mysql_conn,‘-connect/1-fun-0-’,2,[{file,“mysql_conn.erl”},{line,136}]}]},[{gen_server,init_it,6,[{file,“gen_server.erl”},{line,407}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [<0.5607.1>,<0.5605.1>,ecpool_sup,<0.2583.0>], message_queue_len: 0, messages: , links: [<0.5607.1>], dictionary: , trap_exit: true, status: running, heap_size: 610, stack_size: 28, reductions: 280; neighbours:
2024-01-19T11:22:10.056262+08:00 [error] msg: start_ecpool_error, mfa: emqx_resource_pool:start/3, line: 44, pool_name: <<“emqx_authn_mysql:24”>>, reason: {{badmatch,{error,econnrefused}},[{mysql_conn,connect_socket,1,[{file,“mysql_conn.erl”},{line,160}]},{mysql_conn,‘-connect/1-fun-0-’,2,[{file,“mysql_conn.erl”},{line,136}]}]}
2024-01-19T11:22:10.056635+08:00 [warning] msg: start_resource_failed, mfa: emqx_resource_manager:start_resource/2, line: 464, id: <<“emqx_authn_mysql:24”>>, reason: {start_pool_failed,<<“emqx_authn_mysql:24”>>,{{badmatch,{error,econnrefused}},[{mysql_conn,connect_socket,1,[{file,“mysql_conn.erl”},{line,160}]},{mysql_conn,‘-connect/1-fun-0-’,2,[{file,“mysql_conn.erl”},{line,136}]}]}}
2024-01-19T11:22:10.053583+08:00 [error] Error in process <0.5610.1> on node ‘emqx@127.0.0.1’ with exit value:, {{badmatch,{error,econnrefused}},[{mysql_conn,connect_socket,1,[{file,“mysql_conn.erl”},{line,160}]},{mysql_conn,‘-connect/1-fun-0-’,2,[{file,“mysql_conn.erl”},{line,136}]}]}
日志里都是 mysql 连不上的问题,跟 Dashboard 登录失败没有关系。Dashboard 提示用户名密码错误,你可以用这个命令重置密码:
./bin/emqx ctl admins passwd admin abcd1234
密码重置过了,还是不行
打开浏览器的调试功能,看看服务端返回了什么错误。
如果 emqx 日志的确没有 dashboard 登录相关的错误的话,像是 NGINX 返回的 401。你可以在 emqx 节点上抓一个包试试看,emqx 返回是什么。
另外不走代理直连 emqx 会出问题吗?
直连不会出现问题
你好,这个问题没有解决办法