k8s部署emqx,使用mysql插件进行认证,连接mysql超时

以下是容器启动后的日志:

EMQX_LOADED_PLUGINS=emqx_auth_mysql

acl_nomatch = “deny”

allow_anonymous = “false”

listener.ssl.external.acceptors = “32”

listener.ssl.external.max_connections = “102400”

listener.tcp.external.acceptors = “64”

listener.tcp.external.max_connections = “1024000”

listener.ws.external.acceptors = “16”

listener.ws.external.max_connections = “102400”

listener.wss.external.acceptors = “16”

listener.wss.external.max_connections = “102400”

log.level = “debug”

log.to = “console”

node.max_ets_tables = “2097152”

node.max_ports = “1048576”

node.name = “emqx-0@10.233.113.108

node.process_limit = “2097152”

rpc.port_discovery = “manual”

2022-03-22T15:29:04.430954+08:00 [info] event=server_setup_successfully driver=tcp socket="#Port<0.11>"

2022-03-22T15:29:04.431227+08:00 [info] event=start

Starting emqx on node emqx-0@10.233.113.108

Start mqtt:tcp:internal listener on 127.0.0.1:11883 successfully.

Start mqtt:tcp:external listener on 0.0.0.0:1883 successfully.

Start mqtt:ws:external listener on 0.0.0.0:8083 successfully.

Start mqtt:ssl:external listener on 0.0.0.0:8883 successfully.

Start mqtt:wss:external listener on 0.0.0.0:8084 successfully.

2022-03-22T15:29:04.611348+08:00 [debug] Adding Defaults

2022-03-22T15:29:04.611465+08:00 [debug] Right Hand Side Substitutions

2022-03-22T15:29:04.611526+08:00 [debug] Applying Datatypes

2022-03-22T15:29:04.612219+08:00 [debug] Validation

2022-03-22T15:29:04.612408+08:00 [debug] Applied 1:1 Mappings

2022-03-22T15:29:04.612453+08:00 [debug] “emqx_management.application” in Translations to drop…

2022-03-22T15:29:04.612622+08:00 [debug] Running translation for emqx_management.listeners

2022-03-22T15:29:04.613351+08:00 [debug] Applied Translations

Start http:management listener on 8081 successfully.

2022-03-22T15:29:04.619673+08:00 [info] [Plugins] Started plugins: [xmerl,jiffy,minirest,emqx_management]

2022-03-22T15:29:04.619758+08:00 [info] [Plugins] Load plugin emqx_management successfully

2022-03-22T15:29:04.641886+08:00 [debug] Adding Defaults

2022-03-22T15:29:04.641984+08:00 [debug] Right Hand Side Substitutions

2022-03-22T15:29:04.642041+08:00 [debug] Applying Datatypes

2022-03-22T15:29:04.642448+08:00 [debug] Validation

2022-03-22T15:29:04.642546+08:00 [debug] Applied 1:1 Mappings

2022-03-22T15:29:04.642636+08:00 [debug] Running translation for emqx_dashboard.listeners

2022-03-22T15:29:04.643248+08:00 [debug] Applied Translations

Start http:dashboard listener on 18083 successfully.

2022-03-22T15:29:04.647973+08:00 [info] [Plugins] Started plugins: [emqx_dashboard]

2022-03-22T15:29:04.648057+08:00 [info] [Plugins] Load plugin emqx_dashboard successfully

2022-03-22T15:29:04.649464+08:00 [debug] Adding Defaults

2022-03-22T15:29:04.649522+08:00 [debug] Right Hand Side Substitutions

2022-03-22T15:29:04.649575+08:00 [debug] Applying Datatypes

2022-03-22T15:29:04.649617+08:00 [debug] Validation

2022-03-22T15:29:04.649659+08:00 [debug] Applied 1:1 Mappings

2022-03-22T15:29:04.649702+08:00 [debug] Applied Translations

2022-03-22T15:29:04.650101+08:00 [info] [Plugins] Started plugins: [recon,emqx_recon]

2022-03-22T15:29:04.650168+08:00 [info] [Plugins] Load plugin emqx_recon successfully

2022-03-22T15:29:04.655887+08:00 [debug] Adding Defaults

2022-03-22T15:29:04.655974+08:00 [debug] Right Hand Side Substitutions

2022-03-22T15:29:04.656032+08:00 [debug] Applying Datatypes

2022-03-22T15:29:04.656225+08:00 [debug] Validation

2022-03-22T15:29:04.656303+08:00 [debug] Applied 1:1 Mappings

2022-03-22T15:29:04.656353+08:00 [debug] Applied Translations

2022-03-22T15:29:04.663300+08:00 [info] [Plugins] Started plugins: [emqx_retainer]

2022-03-22T15:29:04.663382+08:00 [info] [Plugins] Load plugin emqx_retainer successfully

2022-03-22T15:29:04.668279+08:00 [debug] Adding Defaults

2022-03-22T15:29:04.668368+08:00 [debug] Right Hand Side Substitutions

2022-03-22T15:29:04.668460+08:00 [debug] Applying Datatypes

2022-03-22T15:29:04.668751+08:00 [debug] Validation

2022-03-22T15:29:04.668830+08:00 [debug] Applied 1:1 Mappings

2022-03-22T15:29:04.668904+08:00 [debug] Applied Translations

2022-03-22T15:29:04.671963+08:00 [info] [Plugins] Started plugins: [emqx_telemetry]

2022-03-22T15:29:04.672061+08:00 [info] [Plugins] Load plugin emqx_telemetry successfully

2022-03-22T15:29:04.680564+08:00 [debug] Adding Defaults

2022-03-22T15:29:04.680636+08:00 [debug] Right Hand Side Substitutions

2022-03-22T15:29:04.680696+08:00 [debug] Applying Datatypes

2022-03-22T15:29:04.680973+08:00 [debug] Validation

2022-03-22T15:29:04.681017+08:00 [debug] Applied 1:1 Mappings

2022-03-22T15:29:04.681094+08:00 [debug] Running translation for emqx_rule_engine.events

2022-03-22T15:29:04.681574+08:00 [debug] Applied Translations

2022-03-22T15:29:04.686527+08:00 [info] [Plugins] Started plugins: [rulesql,getopt,emqx_rule_engine]

2022-03-22T15:29:04.686595+08:00 [info] [Plugins] Load plugin emqx_rule_engine successfully

2022-03-22T15:29:04.707578+08:00 [info] [Plugins] auth.mysql.database = “mqtt”

2022-03-22T15:29:04.707661+08:00 [info] [Plugins] auth.mysql.password = “emqx123”

2022-03-22T15:29:04.707719+08:00 [info] [Plugins] auth.mysql.password_hash = “plain”

2022-03-22T15:29:04.707769+08:00 [info] [Plugins] auth.mysql.server = “10.233.47.222:3306”

2022-03-22T15:29:04.707831+08:00 [info] [Plugins] auth.mysql.username = “mqtt”

2022-03-22T15:29:04.707887+08:00 [debug] Adding Defaults

2022-03-22T15:29:04.707966+08:00 [debug] Right Hand Side Substitutions

2022-03-22T15:29:04.708019+08:00 [debug] Applying Datatypes

2022-03-22T15:29:04.708386+08:00 [debug] Validation

2022-03-22T15:29:04.708462+08:00 [debug] Applied 1:1 Mappings

2022-03-22T15:29:04.708526+08:00 [debug] Running translation for emqx_auth_mysql.server

2022-03-22T15:29:04.708776+08:00 [debug] Running translation for emqx_auth_mysql.password_hash

2022-03-22T15:29:04.708841+08:00 [debug] Applied Translations

2022-03-22T15:29:09.710495+08:00 [error] crasher: initial call: mysql_conn:init/1, pid: <0.2027.0>, registered_name: [], exit: {timeout,[{gen_server,init_it,6,[{file,“gen_server.erl”},{line,401}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [<0.2026.0>,<0.2025.0>,<0.2023.0>,emqx_auth_mysql_sup,<0.2021.0>], message_queue_len: 0, messages: [], links: [<0.2026.0>], dictionary: [], trap_exit: false, status: running, heap_size: 376, stack_size: 28, reductions: 382; neighbours:

2022-03-22T15:29:09.711163+08:00 [error] [MySQL] Can’t connect to MySQL server: timeout

2022-03-22T15:29:09.711419+08:00 [error] Supervisor: {<0.2025.0>,ecpool_worker_sup}. Context: start_error. Reason: timeout. Offender: id={worker,1},pid=undefined.

2022-03-22T15:29:09.711644+08:00 [error] crasher: initial call: ecpool_worker:init/1, pid: <0.2026.0>, registered_name: [], exit: {timeout,[{gen_server,init_it,6,[{file,“gen_server.erl”},{line,401}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [<0.2025.0>,<0.2023.0>,emqx_auth_mysql_sup,<0.2021.0>], message_queue_len: 1, messages: [{‘EXIT’,<0.2027.0>,timeout}], links: [<0.2025.0>], dictionary: [], trap_exit: true, status: running, heap_size: 1598, stack_size: 28, reductions: 4381; neighbours:

2022-03-22T15:29:09.712155+08:00 [error] Supervisor: {<0.2023.0>,ecpool_pool_sup}. Context: start_error. Reason: {shutdown,{failed_to_start_child,{worker,1},timeout}}. Offender: id=worker_sup,pid=undefined.

2022-03-22T15:29:09.713097+08:00 [error] Supervisor: {local,emqx_auth_mysql_sup}. Context: start_error. Reason: {shutdown,{failed_to_start_child,worker_sup,{shutdown,{failed_to_start_child,{worker,1},timeout}}}}. Offender: id=emqx_auth_mysql,pid=undefined.

2022-03-22T15:29:09.713432+08:00 [error] crasher: initial call: application_master:init/4, pid: <0.2020.0>, registered_name: [], exit: {{bad_return,{{emqx_auth_mysql_app,start,[normal,[]]},{‘EXIT’,{{badmatch,{error,{shutdown,{failed_to_start_child,emqx_auth_mysql,{shutdown,{failed_to_start_child,worker_sup,{shutdown,{failed_to_start_child,{worker,1},timeout}}}}}}}},[{emqx_auth_mysql_app,start,2,[{file,“emqx_auth_mysql_app.erl”},{line,38}]},{application_master,start_it_old,4,[{file,“application_master.erl”},{line,277}]}]}}}},[{application_master,init,4,[{file,“application_master.erl”},{line,138}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [<0.2019.0>], message_queue_len: 1, messages: [{‘EXIT’,<0.2021.0>,normal}], links: [<0.2019.0>,<0.1435.0>], dictionary: [], trap_exit: true, status: running, heap_size: 610, stack_size: 28, reductions: 235; neighbours:

2022-03-22T15:29:09.714254+08:00 [notice] Application: emqx_auth_mysql. Exited: {bad_return,{{emqx_auth_mysql_app,start,[normal,[]]},{‘EXIT’,{{badmatch,{error,{shutdown,{failed_to_start_child,emqx_auth_mysql,{shutdown,{failed_to_start_child,worker_sup,{shutdown,{failed_to_start_child,{worker,1},timeout}}}}}}}},[{emqx_auth_mysql_app,start,2,[{file,“emqx_auth_mysql_app.erl”},{line,38}]},{application_master,start_it_old,4,[{file,“application_master.erl”},{line,277}]}]}}}}. Type: temporary.

2022-03-22T15:29:09.719669+08:00 [notice] Application: ecpool. Exited: stopped. Type: temporary.

2022-03-22T15:29:09.719883+08:00 [notice] Application: mysql. Exited: stopped. Type: temporary.

2022-03-22T15:29:09.720016+08:00 [error] [Plugins] Load plugin emqx_auth_mysql failed, cannot start plugin emqx_auth_mysql for {bad_return,{{emqx_auth_mysql_app,start,[normal,[]]},{‘EXIT’,{{badmatch,{error,{shutdown,{failed_to_start_child,emqx_auth_mysql,{shutdown,{failed_to_start_child,worker_sup,{shutdown,{failed_to_start_child,{worker,1},timeout}}}}}}}},[{emqx_auth_mysql_app,start,2,[{file,“emqx_auth_mysql_app.erl”},{line,38}]},{application_master,start_it_old,4,[{file,“application_master.erl”},{line,277}]}]}}}}

2022-03-22T15:29:09.722098+08:00 [info] [Modules] Load emqx_mod_acl_internal module successfully.

2022-03-22T15:29:09.722322+08:00 [info] [Modules] Load emqx_mod_presence module successfully.

EMQ X Broker 4.3.11 is running now!

2022-03-22T15:29:15.695270+08:00 [debug] file: emqx_telemetry.erl, line: 369, mfa: {emqx_telemetry,report_telemetry,1}, msg: telemetry_data_reported, pid: <0.2003.0>

2022-03-22T15:30:04.442291+08:00 [warning] [Alarm Handler] Alarm high_system_memory_usage is activated, System memory usage is higher than 70%