Use ganglia to monitor storm Clusters

Source: Internet
Author: User

Use ganglia to monitor storm Clusters
Recently, some tasks in the storm cluster cannot be started and executed properly due to unknown reasons (several projects are reused ), so I want to get a monitoring system to monitor the status of the storm cluster and handle the corresponding alarms. Finally, ganglia, an open-source monitoring platform, is selected. Ganglia can use jmxtrans to monitor storm. jmxtrans serves as a communication bridge between ganglia and storm.
1. Download and install jmxtrans
You can use wget to download
Wget https://cloud.github.com/downloads/jmxtrans/jmxtrans/jmxtrans-20121016.145842.6a28c97fbb-0.noarch.rpm
Sudo rpm-I jmxtrans-20121016.145842.6a28c97fbb-0.noarch.rpm
After installation, the jmxtrans directory is in the/usr/share/jmxtrans directory, the configuration file is in the/etc/sysconfig/jmxtrans directory, and the json script for monitoring storm is placed in the/var/lib/jmxtrans directory.
2. Modify storm Configuration
Add the following two parameters to storm. yaml:
Supervisor. childopts: "-verbose: gc-XX: + PrintGCTimeStamps-XX: + PrintGCDetails-Dcom. sun. management. jmxremote-Dcom. sun. management. jmxremote. ssl = false-Dcom. sun. management. jmxremote. authenticate = false-Dcom. sun. management. jmxremote. port = 12346"
Nimbus. childopts: "-verbose: gc-XX: + PrintGCTimeStamps-XX: + PrintGCDetails-Dcom. sun. management. jmxremote-Dcom. sun. management. jmxremote. ssl = false-Dcom. sun. management. jmxremote. authenticate = false-Dcom. sun. management. jmxremote. port = 12345"
The port numbers 12345 and 12346 can be set at will, preferably useless or infrequently used port numbers.
3. Write monitoring scripts
Supervisor. json

 
 
  1. {
  2. "servers" : [ {
  3. "port" : "12346",
  4. "host" : "IP_OF_SUPERVISOR_MACHINE",
  5. "queries" : [ {
  6. "outputWriters": [{
  7. "@class":"com.googlecode.jmxtrans.model.output.GangliaWriter",
  8. "settings": {
  9. "groupName": "supervisor",
  10. "host": "IP_OF_GANGLIA_GMOND_SERVER",
  11. "port": "8649" }
  12. }],
  13. "obj": "java.lang:type=Memory",
  14. "resultAlias": "supervisor",
  15. "attr": ["ObjectPendingFinalizationCount"]
  16. },
  17. {
  18. "outputWriters": [{
  19. "@class":"com.googlecode.jmxtrans.model.output.GangliaWriter",
  20. "settings": {
  21. "groupName": "supervisor",
  22. "host": "IP_OF_GANGLIA_GMOND_SERVER",
  23. "port": "8649"
  24. }
  25. }],
  26. "obj": "java.lang:name=Copy,type=GarbageCollector",
  27. "resultAlias": "supervisor",
  28. "attr": [
  29. "CollectionCount",
  30. "CollectionTime"
  31. ]
  32. },
  33. {
  34. "outputWriters": [{
  35. "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter",
  36. "settings": {
  37. "groupName": "supervisor",
  38. "host": "IP_OF_GANGLIA_GMOND_SERVER",
  39. "port": "8649"
  40. }
  41. }],
  42. "obj": "java.lang:name=Code Cache,type=MemoryPool",
  43. "resultAlias": "supervisor",
  44. "attr": [
  45. "CollectionUsageThreshold",
  46. "CollectionUsageThresholdCount",
  47. "UsageThreshold",
  48. "UsageThresholdCount"
  49. ]
  50. },
  51. {
  52. "outputWriters": [{
  53. "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter",
  54. "settings": {
  55. "groupName": "supervisor",
  56. "host": "IP_OF_GANGLIA_GMOND_SERVER",
  57. "port": "8649"
  58. }
  59. }],
  60. "obj": "java.lang:type=Runtime",
  61. "resultAlias": "supervisor",
  62. "attr": [
  63. "StartTime",
  64. "Uptime"
  65. ]
  66. }],
  67. "numQueryThreads" : 2
  68. }]
  69. }
Port 12346 is the port of the jmx service, which is set in storm. yaml;
IP_OF_SUPERVISOR_MACHINE is the IP address of the supervisor node.
IP_OF_GANGLIA_GMOND_SERVER is the IP address of the server where the ganglia gmond service is located.

Nimbus. json

 
 
  1. {
  2. "servers" : [{
  3. "port" : "12345",
  4. "host" : "IP_OF_NIMBUS_MACHINE",
  5. "queries" : [
  6. { "outputWriters": [{
  7. "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter",
  8. "settings": {
  9. "groupName": "nimbus",
  10. "host": "IP_OF_GANGLIA_GMOND_SERVER",
  11. "port": "8649"
  12. }
  13. }],
  14. "obj": "java.lang:type=Memory",
  15. "resultAlias": "nimbus",
  16. "attr": ["ObjectPendingFinalizationCount"]
  17. },
  18. {
  19. "outputWriters": [{
  20. "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter",
  21. "settings": {
  22. "groupName": "nimbus",
  23. "host": "IP_OF_GANGLIA_GMOND_SERVER",
  24. "port": "8649"
  25. }
  26. }],
  27. "obj": "java.lang:name=Copy,type=GarbageCollector",
  28. "resultAlias": "nimbus",
  29. "attr": [
  30. "CollectionCount",
  31. "CollectionTime"
  32. ]
  33. },
  34. {
  35. "outputWriters": [{
  36. "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter",
  37. "settings": {
  38. "groupName": "nimbus",
  39. "host": "IP_OF_GANGLIA_GMOND_SERVER",
  40. "port": "8649"
  41. }
  42. }],
  43. "obj": "java.lang:name=Code Cache,type=MemoryPool",
  44. "resultAlias": "nimbus",
  45. "attr": [
  46. "CollectionUsageThreshold",
  47. "CollectionUsageThresholdCount",
  48. "UsageThreshold",
  49. "UsageThresholdCount"
  50. ]
  51. },
  52. {
  53. "outputWriters": [{
  54. "@class": "com.googlecode.jmxtrans.model.output.GangliaWriter",
  55. "settings": {
  56. "groupName": "nimbus",
  57. "host": "IP_OF_GANGLIA_GMOND_SERVER",
  58. "port": "8649"
  59. }
  60. }],
  61. "obj": "java.lang:type=Runtime",
  62. "resultAlias": "nimbus",
  63. "attr": [
  64. "StartTime",
  65. "Uptime"
  66. ]
  67. }],
  68. "numQueryThreads" : 2
  69. } ]
  70. }
Port 12345 is the port of the jmx service, which is set in storm. yaml;
IP_OF_NIMBUS_MACHINE is the IP address of the nimbus node.
IP_OF_GANGLIA_GMOND_SERVER is the IP address of the server where the ganglia gmond service is located.
4. Copy the nimbus. json and supervisor. json scripts to the/var/lib/jmxtrans directory.
5. Start the jmxtrans Service
Cd/usr/share/jmxtrans
Sudo./jmxtrans strart
6. Now you can view the running status of the storm cluster on the wen service of ganglia.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.