Open Mararesliu opened 3 weeks ago
Do you mean something like
Client -> Apisix @ x:y -> mysql1 Client -> Apisix @x:z -> mysql2 ?
Then you can create two stream routes pointing to same upstream
apisix:
stream_proxy: # TCP/UDP proxy
tcp: # TCP proxy address list
- x:y
- x:z
curl http://127.0.0.1:9180/apisix/admin/stream_routes/1 -H "X-API-KEY: $admin_key" -X PUT -d '
{
"server_addr": "x",
"server_port": y,
"upstream": {
"nodes": {
"mysql1 address": 1
},
"type": "roundrobin"
}
}'
curl http://127.0.0.1:9180/apisix/admin/stream_routes/2 -H "X-API-KEY: $admin_key" -X PUT -d '
{
"server_addr": "x",
"server_port": z,
"upstream": {
"nodes": {
"mysql2 address": 1
},
"type": "roundrobin"
}
}'
@Mararesliu There will be no dropped connections when you do apisix reload.
Can I setting different Domain name points to the same apsix ip and port, route to different mysql instance? How APISIX identify domain to match different instance? Is that I can setting "server_addr" mysql100.prd.com with it?
Description
I use APISIX for mysql proxy, Can I use different domain to the same port with apisix for different mysql instance? Can connect with different host to mysql instance.
By the way. If i change some config, and apisix reload when in high traffic, Will there be any connection issues?If that How can i prevent?
THX
Environment
apisix version
): 3.2uname -a
):openresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):