Skip to content
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

load balancer is abnormal when the uris=["/"] ? #2542

Closed
shaowin16 opened this issue May 18, 2017 · 8 comments
Closed

load balancer is abnormal when the uris=["/"] ? #2542

shaowin16 opened this issue May 18, 2017 · 8 comments

Comments

@shaowin16
Copy link

shaowin16 commented May 18, 2017

The Kong version is kong:0.10.2 and the database is postgres:9.4.
When i add the follow API,upstream,target to load balance,it has some exceptions.

First,i add the api:

POST:http://${kong_ip}:8001/apis

{
	
"methods": [
               "POST",
		"PUT",
		"GET",
		"DELETE"
  ],
  "upstream_url": "http://ab-web",
  "https_only": false,
  "name": "ab-web",
	"uris":["/"],
	"strip_uri":false
}

the upstream:

POST:http://${kong_ip}:8001/upstreams

{"name":"ab-web"}

and the target:

POST:http://${kong_ip}:8001/upstreams/ab-web/targets

{
	"target": "139.1.2.12:3006",
	"weight": 2
}

Now,i request the url: http://${kong_ip}:8000 and it can proxy normally the url: http://139.1.2.12:3006(a microService)

Second,i add the api

POST:http://${kong_ip}:8001/apis

{
	
   "methods": [
                "POST",
		"PUT",
		"GET",
		"DELETE"
  ],
  "upstream_url": "http://ab-system",
  "https_only": false,
  "name": "ab-system",
	"uris":["/system"],
	"strip_uri":false
}

the upstream:

POST:http://${kong_ip}:8001/upstreams

{"name":"ab-system"}

and the target:

POST:http://${kong_ip}:8001/upstreams/ab-system/targets

{
	"target": "139.1.2.12:8323",
	"weight": 2
}

Now, i request the url: http://${kong_ip}:8000/system/api/v1/users and it can't proxy normally the url: http://139.1.2.12:8323/system/api/v1/users

The second step can proxy normally sometime and can't proxy normally sometime.

When the apis is not include uris=["/"], the all api can proxy normally.

why?

@p0pr0ck5
Copy link
Contributor

Can you please provide some more detail about

The second step can proxy normally sometime and can't proxy normally sometime.

What do you mean "can't proxy"? Do you receive an error? A timeout? What specifically is the problem you're seeing? How often does this occur?

@sarraz1
Copy link
Contributor

sarraz1 commented May 24, 2017

I guess that the "/" rule has the highest priority.
Check the order of the rules when you request the apis list.

Regards

@p0pr0ck5
Copy link
Contributor

@sarraz1 unfortunately your response doesn't provide any useful detail. Please provide details on the following questions:

What do you mean "can't proxy"? Do you receive an error? A timeout? What specifically is the problem you're seeing? How often does this occur?

@p0pr0ck5
Copy link
Contributor

Also @sarraz1 it sounds like this was possibly resolved with #2523. Can you try your environment with Kong 0.10.3 and let us know if you still see any issues?

@p0pr0ck5
Copy link
Contributor

p0pr0ck5 commented Jun 6, 2017

sarraz1 ping :)

@sarraz1
Copy link
Contributor

sarraz1 commented Jun 7, 2017

I will try, but not yet. For the moment, I can't update my kong environment with the 0.10.3.

@p0pr0ck5
Copy link
Contributor

p0pr0ck5 commented Jun 8, 2017

Would you be able to try with the patch noted in #2523?

@p0pr0ck5
Copy link
Contributor

I was able to duplicate this behavior in 0.10.2, and not able to duplicate it with the patch noted above (or on 0.10.3). @sarraz1 let us know if you still see this behavior on 0.10.3 and we can reexamine this issue, but I believe your problem has been resolved in the latest release. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants