-
Notifications
You must be signed in to change notification settings - Fork 225
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
Multicast Discovery of Agents #127
Comments
I'll put the documentation draft in this issue which finally will make it into the reference manual Agent DiscoveryJolokia agents are able to respond to certain multicast requests in order to allow clients to detect automatically connection parameters. The agent URL to expose can be either manually configured for an agent or an agent can try to detect its URL automatically. This works fine for the JVM agent, for the WAR agent it only works after the first HTTP request has been processed by the agent. Due to limitations of the Servlet API the agent servlet has no clue about its own URL until this first request, which contains the request URL. Of course, the URL obtained that way can be bogus as well, since the agent might hide behind a proxy, too. So, if in doubt you should configure the agent URL from outside to allow external clients to be discovered. A agent which is enabled for multicast discovery will only respond to a multicast request if the restrictor allows connections from the source IP. Otherwise a multicast request will be simply ignored. For example, if you have configured your agent to only allow request from a central monitoring host, only this host is able to detect these agents. Beside security aspects it wouldn't make sense to expose the URL as any other host is not able to connect anyways. Starting with version 1.2.0 the Jolokia JVM agent has this discovery feature enabled by default which can be switched off via Multicast Discovery ProtocolFor sending a multicast request discovery message, an UDP message should be send to the address {
"type": "query"
} Any agent enabled for disovery will respond to requestor on the same socket with an answer which looks like {
"type": "response",
"agent_description" : "Atlantis Tomcat",
"agent_id" : "10.9.11.18-58613-81b087d-servlet",
"url": "http://10.9.11.25:8778/jolokia",
"confidence": 100,
"server_vendor" : "Apache",
"server_product" : "Tomcat",
"server_version" : "7.0.35"
} Please note, that the format with respect to The response is restricted to 8192 bytes maximum. IPv6 is currently not supported yet but likely in the future. Discovery MBeanEvery agent registers an MBean at [
{
"agent_id" : "10.9.11.18-58613-81b087d-servlet",
"url": "http://10.9.11.25:8778/jolokia",
"secured": false,
"server_vendor" : "Apache",
"server_product" : "Tomcat",
"server_version" : "7.0.35"
},
{
"agent_id" : "10.9.11.87-23455-9184ef-osgi",
"agent_description": "My OSGi container",
"url": "http://10.9.11.87:8080/jolokia",
"secured": true,
"server_vendor" : "Apache",
"server_product" : "Felix",
"server_version" : "4.2.1"
}
] |
Long done. |
It should be possible to (a) allow agents to respond to multicast requests for their URL and (b) triggering an MBean operation for finding all agents with a multi cast request.
See #125 for more details and an alternative approach.
Currently, most of the stuff is already implemented and can be tried out with the 1.2.0-SNAPSHOT where the discovery mechanism is enabled by default (for the WAR agent it has to be enabled by an ini param or a system property). The MBean can be found at
jolokia:type=Discovery
.More documentation to follow, I also have still some points to discuss (but now I'm too tired ;-).
The text was updated successfully, but these errors were encountered: