当emqx出现踢除设备超时,以下办法可以解决
进入emqx控制台
emqx remote_console
找到卡死的进程,杀掉
删除内存中的数据
ets:tab2list(emqx_channel).
process_info(<0.2125.0>).
exit(<0.2125.0>,shutdown).
ets:all(). 列出所有的内存表
ets:delete_object(emqx_channel, {<<"S54789400116">>,<0.2125.0>}).
卡死的进程信息:
[{current_function,{gen,do_call,4}},
{initial_call,{proc_lib,init_p,5}},
{status,waiting},
{message_queue_len,25},
{links,[<0.2011.0>]},
{dictionary,[{'$initial_call',{emqx_connection,init,4}},
{'$ancestors',[<0.2011.0>,<0.2010.0>,esockd_sup,<0.1398.0>]},
{guid,{1641955985303125,268564305021005,2}},
{'$logger_metadata$',#{clientid => <<"S54789400116">>,
peername => "10.111.12.20:30238"}},
{incoming_bytes,2466},
{recv_pkt,3},
{send_pkt,1},
{outgoing_bytes,4}]},
{trap_exit,false},
{error_handler,error_handler},
{priority,normal},
{group_leader,<0.1397.0>},
{total_heap_size,1598},
{heap_size,1598},
{stack_size,43},
{reductions,45153},
{garbage_collection,[{max_heap_size,#{error_logger => true,kill => false,size => 8388608}},
{min_bin_vheap_size,464
{min_heap_size,233},
{fullsweep_after,1000},
{minor_gcs,0}]},
{suspending,[]}]
正常的进程信息:
[{current_function,{emqx_connection,recvloop,2}},
{initial_call,{proc_lib,init_p,5}},
{status,waiting},
{message_queue_len,0},
{links,[<0.2011.0>,#Port<0.1643168>]},
{dictionary,[{incoming_pubs,0},
{'$initial_call',{emqx_connection,init,4}},
{'$ancestors',[<0.2011.0>,<0.2010.0>,esockd_sup,<0.1398.0>]},
{guid,{1642207325110635,268565227791004,0}},
{'$logger_metadata$',#{clientid => <<"S56975300198">>,
peername => "10.111.12.15:31981"}},
{incoming_bytes,116},
{rand_seed,{#{bits => 58,jump => #Fun<rand.13.8986388>,
next => #Fun<rand.10.8986388>,type => exsss,
uniform => #Fun<rand.11.8986388>,
uniform_n => #Fun<rand.12.8986388>},
[250872217282614324|184930584171943021]}},
{outgoing_bytes,318},
{send_pkt,158},
{recv_pkt,158}]},
{trap_exit,false},
{error_handler,error_handler},
{priority,normal},
{group_leader,<0.1397.0>},
{total_heap_size,3217},
{heap_size,1598},
{stack_size,9},
{reductions,106855},
{garbage_collection,[{max_heap_size,#{error_logger => true,kill => false,size => 8388608}},
{min_bin_vheap_size,46422},
{min_heap_size,233},
{fullsweep_after,1000},
{minor_gcs,10}]},
{suspending,[]}]