bisakhmondal commented on issue #5775:
URL: https://github.com/apache/apisix/issues/5775#issuecomment-992123547
Hi @yunfhu, thanks for the detailed analysis
> login apisix pod with kubectl exec command,I use the telnet command to
check the stream proxy route, it shows able route to mysql host
>
> ```
> @MacBook-Pro APISIX % kubectl exec -it apisix-557f5f646f-r69z9 sh
> kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future
version. Use kubectl exec [POD] -- [COMMAND] instead.
> sh-4.2# telnet localhost 9100
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> J
> 5.7.36@1->t-::kmLEXU'7Lmysql_native_password
> ```
Yes, I also have tested locally, there is no issue from the APISIX side
while proxying the request to the MySQL server with the correct route
configuration.
> but when I logout the pod and tried to request with the node port, the
connection was closed
>
> ```
> @MacBook-Pro ~ % telnet localhost 30100
> Trying ::1...
> Connected to localhost.
> Escape character is '^]'.
> Connection closed by foreign host.
> ```
Got your point.
>"value": {
"create_time": 1639291584,
"id": "1",
"server_addr": "10.1.2.177",
"server_port": 9100,
"update_time": 1639291584,
"upstream": {
"hash_on": "vars",
"nodes": {
"10.1.2.171:3306": 1
},
"pass_host": "pass",
"scheme": "http",
"type": "roundrobin"
}
Just curious why do you have `server_addr` filter enabled for port
`10.1.2.177` while from the kubectl I can see your APISIX server is running on
`10.1.2.186`. (see
[here](https://nginx.org/en/docs/http/ngx_http_core_module.html#var_server_addr))
Could you please check if you can access the mysql through the k8s nodeport
for this stream route config:
```json
{
"upstream": {
"nodes": {
"10.1.2.171:3306": 1
},
"type": "roundrobin"
}
}
```
assuming you can access the mysql at `10.1.2.171:3306`. Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org