-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: kafka-logger, always log not found broker
after kafka-logger kafka broker up. until reload apisix.
#6033
Comments
provide reproduction steps and environment & version information. |
description edited |
|
how to do this?
Is kafka broken definitely available at this point? In my experience, the kafka producer has a lrucache, so you can update the kafka-logger configuration with the |
the kafka broken in other case . when i restart kafka borkers , and waiting the apisix send message auto recover. but not , about 5 minute later , relaod the apisix, it works well.
Maybe in the next time, I will try this solution. |
refer to: doujiang24/lua-resty-kafka#70 maybe we need to add @guxingke If I start kafka with docker, shut down the container after starting it and start it again, can I simulate the broker down scenario you mentioned? |
yes, this can.
yeah, It's best if it can recover automatically |
@guxingke I was unable to reproduce the scenario with this on the master branch. Here is my configuration of route:
Here is my exception log:
When I restarted the kafka container, it continued to push messages to kafka normally again. Note: I did not make the kafka volume, and the restarted kafka is a new cluster. |
my kafka logger configuration {
"batch_max_size": 100,
"broker_list": {
"10.200.32.69": 9092,
"10.200.32.70": 9092,
"10.200.32.71": 9092
},
"disable": false,
"kafka_topic": "nginx_www"
} and it as a global plugin. and it use user-define log_format. Maybe we didn't repeating it because our configuration was different. |
I need to be able to simulate the kafka broker down de scenario you mentioned. |
maybe your kafka recover too quickly? I could not provider more information about this .😂 |
I got |
Retrieved the logs and found both errors. the logs like below.
and the first time for |
I don't know how to reproduce |
2022/04/11 10:48:19 [error] 46#46: *680816936 [lua] producer.lua:272: buffered messages send to kafka err: not found topic, retryable: true, topic: paas_api_log_topic, partition_id: -1, length: 1, context: ngx.timer, client: 10.0.5.62, server: 0.0.0.0:9080 |
we also suffered such thing |
@kennethToyuan @jujiale pls provide full reproduction steps, it looks like this is a mandatory bug on your environment. |
Does the topic exist in the kafka cluster? |
thans to your reply. |
I find when use kafka cluster model(such as 3 nodes). it occurs such problem. but single node seems ok. |
Same issue, at first it works, then after a while (no config changed) and I try to call API again, the above errors are shown and it is unable to write to Kafka. APISIX running on K8s with 1 APISIX, 3 etcd After a while it worked again, but the calls during error are not logged. |
Issue description
always log
not found broker
after kafka-logger kafka broker up. until reload apisix.Environment
apisix version
): 2.10.1uname -a
):Linux test 3.10.0-957.el7.x86_64 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linuxnginx -V
oropenresty -V
):nginx version: openresty/1.19.3.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.1.1l 24 Aug 2021
TLS SNI support enabled
configure arguments: --prefix=/duitang/dist/sys/openresty/nginx --with-cc-opt='-O2 -DAPISIX_BASE_VER=0.0.0 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl111/include' --add-module=../ngx_devel_kit-0.3.1 --add-module=../echo-nginx-module-0.62 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.32 --add-module=../ngx_lua-0.10.19 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.7 --add-module=../ngx_stream_lua-0.0.9 --with-ld-opt='-Wl,-rpath,/duitang/dist/sys/openresty/luajit/lib -Wl,-rpath,-L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl111/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl111/lib' --add-module=/duitang/dist/opt/builder/output/openresty-1.19.3.2/../ngx_multi_upstream_module --add-module=/duitang/dist/opt/builder/output/openresty-1.19.3.2/../apisix-nginx-module --add-module=/duitang/dist/opt/builder/output/openresty-1.19.3.2/../lua-var-nginx-module --with-poll_module --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --with-compat --with-stream --with-http_ssl_module
curl http://127.0.0.1:9090/v1/server_info
to get the info from server-info API):{"version":"2.10.1","boot_time":1641439475,"etcd_version":"3.5.0","up_time":83420,"last_report_time":1641522886,"id":"8d53dda0-5ec2-44b6-872c-70f18b0397a8","hostname":"wvr-ngxweb-0-20.duitang.net"}luarocks --version
):Steps to reproduce
Actual result
after kafka borker up , send logs.
Error log
buffered messages send to kafka err: not found broker, retryable: true, ....
Expected result
notings
The text was updated successfully, but these errors were encountered: