Hi all,
I wrote a irule to divert all external rest api traffic to a particular node. But, dont know how to test it. Can someone please help me with that ?
Working with apps behind load balancers before, I've found it helpful when the server has added a small HTTP header that indicates the node it's coming from. For security reasons you may not want to make it as simple as 1,2,3,4 - but maybe obfuscate it a little bit and use a random string that your team knows what node is processing the request. This means you can view it in the browser itself instead of logging in to the node(s) to see what requests it's handling.
http://nginx.org/en/docs/http/ngx_http_headers_module.html - example to do this with Nginx. Adjust as necessary for your specific environment.
CCM
I presume you are probably following this guide: https://confluence.atlassian.com/enterprise/traffic-distribution-with-atlassian-data-center-895912660.html
I believe there is a way you can see if these REST API calls are being diverted as expected. Try these steps:
curl -D- -u username:password -X GET -H "Content-Type: application/json" http://jiradatacenter.example.com/rest/api/2/issue/createmeta
If this is working that node will indicate that there is a specific rest call being made to this node. Since this call did not request the login.jsp page, we know this call is not be originated by a web login to Jira. In this case, when you make a curl call, it is purely a REST request to Jira datacenter. We should see that specific node identifying this as a type=rest with the username you defined in the curl call, and the ip address this originated from. Example screenshot below.
If you don't see this specific call, you might want to login to the other nodes in a similar manner to see if you can track down this specific call to see which node it was directed to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
when HTTP_REQUEST {
set referrer_host [URI::host [HTTP::header value Referer]]
log local0. "Host: [HTTP::host]"
log local0. "uri: [HTTP::uri]"
log local0. "path: [HTTP::path]"
log local0. "referrer: $referrer_host"
log local0. "referrer: referrer_host"
if
{ $referrer_host equals "jiratest.corp.chartercom.com" and [string tolower [HTTP::uri]] contains "/rest/" }
{
pool JIRA-test-pool
}
if
{ not $referrer_host equals "jiratest.corp.chartercom.com" and [string tolower [HTTP::uri]] contains "/rest/" }
{
if
{ [string tolower [HTTP::uri]] equals "/login.jsp" }
{ pool JIRA-test-pool }
else
{ pool JIRA-test-external-pool }
}
pool JIRA-test-pool
}
I implemented this irule. But still I can't see anything in the access-log
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.