apache / apisix

The Cloud-Native API Gateway
https://apisix.apache.org/blog/
Apache License 2.0
14.3k stars 2.49k forks source link

help request: Multiple mysql proxy stream_proxy #11013

Open samsu-lb opened 6 months ago

samsu-lb commented 6 months ago

Description

The first one forwards mysql and port 9500 can run normally. The second forwarding mysql, port 9400 failed to run, Doesn't it support multiple TCP ports to enable forwarding?

Configuration related: stream_proxy: # TCP/UDP proxy tcp: # TCP proxy address list

services: apisix: image: apache/apisix:${APISIX_IMAGE_TAG:-3.7.0-debian} restart: always volumes:

Server ports 9400 and 9500 have been started normally

The first one that works normally 9500 port: { "upstream": { "nodes": { "mysql-1": 1 }, "type": "roundrobin" } } image

The second one doesn’t work properly 9400 port: { "server_port":9400, "upstream": { "nodes": { "mysql-2": 1 }, "type": "roundrobin" } }

image

Environment

shreemaan-abhishek commented 6 months ago

are there any error logs? Please provide self contained examples so that it's easier to reproduce this bug.

samsu-lb commented 6 months ago

Thanks for the reply, client connection log: image

No relevant files were found after the stream log was enabled. Configuration: nginx_config: stream: enabled: true access_log_format: >

shreemaan-abhishek commented 6 months ago

I would appreciate step by step example that leads to this error.

samsu-lb commented 6 months ago

Build apisix and forward multiple mysql instances through streams through multiple tcp ports to achieve the above problems