apisix-dashboard
apisix-dashboard copied to clipboard
when upstream pass_host="node" only support one node
Issue description
but use apisix admin api is ok
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
{
"uris": [
"/blog/*"
],
"name": "11",
"plugins": {
"proxy-rewrite": {
"regex_uri": [
"/blog/(.*)",
"/$1"
],
"scheme": "http"
}
},
"upstream": {
"nodes": [
{
"host": "192.168.0.1",
"port": 80,
"weight": 1
},
{
"host": "192.168.0.2",
"port": 80,
"weight": 1
}
],
"type": "roundrobin",
"hash_on": "vars",
"scheme": "http",
"pass_host": "node"
},
"status": 1
}'
Expected behavior
through dashboard can add upstream multi node when pass_host=node
How to Reproduce
...
Screenshots
No response
Environment
- apisix version (cmd:
apisix version
): 2.12.1 - OS (cmd:
uname -a
): - OpenResty / Nginx version (cmd:
nginx -V
oropenresty -V
): - etcd version, if have (cmd: run
etcd --version
): - apisix-dashboard version, if have:
- Browser version, if have:
Additional context
No response
Hi, @liangliang4ward. Please ref here https://github.com/apache/apisix/blob/abc20bb38ec663186ef225dc1b50f9cfaf15c21c/apisix/upstream.lua#L424 , dashboard just follow APISIX rules.
Hi, @liangliang4ward. Please ref here https://github.com/apache/apisix/blob/abc20bb38ec663186ef225dc1b50f9cfaf15c21c/apisix/upstream.lua#L424 , dashboard just follow APISIX rules.
yes,but apisix not only check nodes!=1,also has other conditions
not balancer.recreate_request
Hi, @liangliang4ward. Please ref here https://github.com/apache/apisix/blob/abc20bb38ec663186ef225dc1b50f9cfaf15c21c/apisix/upstream.lua#L424 , dashboard just follow APISIX rules.
when balancer.recreate_request ==true
, Multiple nodes can be supported
Sorry, I'm not familiar with ngx.balancer
, but it does seem to be a bug here. @starsz Please take a look, thanks.
Hi, please provide the apisix-dashboard
version.
Hi, please provide the
apisix-dashboard
version.
2.10.1
Hi, please provide the
apisix-dashboard
version.
The master branch has the same problem, so we need to discuss how to solve it.
Hi @zaunist. The error is returned here:
https://github.com/apache/apisix-dashboard/blob/88f323285f2bdbafca027da9aef357b2e3eb4008/api/internal/core/store/validate.go#L168-L170
The master branch has the same problem, so we need to discuss how to solve it.
I think we should keep the same as APISIX, APISIX can, APISIX-Dashboard should also can.
Hi @zaunist. The error is returned here:
https://github.com/apache/apisix-dashboard/blob/88f323285f2bdbafca027da9aef357b2e3eb4008/api/internal/core/store/validate.go#L168-L170
The master branch has the same problem, so we need to discuss how to solve it.
I think we should keep the same as APISIX, APISIX can, APISIX-Dashboard should also can.
😂,I want to know what is the balancer.recreate_request ==true
, I just read openresty docs, but I still don't understand the operation of this judgment in the manager-api.
apisix-dashboard/api/internal/core/store/validate.go
So do I. @nic-chen Can you give the answer? I see it's written by you.
😂,I want to know what is the
balancer.recreate_request ==true
, I just read openresty docs, but I still don't understand the operation of this judgment in the manager-api.
see https://github.com/apache/apisix/blob/master/apisix/balancer.lua#L331-L347 would help you understand. but we cannot do this in Manager API.
😂,I want to know what is the
balancer.recreate_request ==true
, I just read openresty docs, but I still don't understand the operation of this judgment in the manager-api.see https://github.com/apache/apisix/blob/master/apisix/balancer.lua#L331-L347 would help you understand. but we cannot do this in Manager API.
So do we have another way to solve this problem, this bug needs to be solved.
Manager API cannot interact directly with APISIX. Maybe we could add configuration to let users decide for themselves.