Solve the Problem of starting the Python module after Ganglia is added

Source: Internet
Author: User

Solve the Problem of starting the Python module after Ganglia is added

Recently added the Python module of Ganglia, and found that the gmond. init file provided by the Ganglia official source code package is unavailable.

Python is compiled by yourself. If Python is installed in the system rpm package, this problem will not occur.

For example, if the gmond service is started, a message indicating success is displayed. But there is no gmond process in ps. So we studied the gmond. init file.

There is no problem with service gmond stop, and there is no problem with manual gmond command execution. The key is the start parameter, so the code to solve the problem is mainly the following lines:

#! /Bin/sh
#
# Chkconfig: 2345 70 40
# Description: gmond startup script
#
GMOND =/usr/sbin/gmond
# TMPDIR set to SysV IPC ramdrive to avoid include processing failures
TMPDIR =/dev/shm
Export TMPDIR
./Etc/rc. d/init. d/functions
RETVAL = 0
Case "$1" in
Start)
Echo-n "Starting GANGLIA gmond :"
[-F $ GMOND] | exit 1
Daemon $ GMOND
RETVAL =$?
Echo
[$ RETVAL-eq 0] & touch/var/lock/subsys/gmond
;

Because Python is compiled by myself, I think the problem is probably caused by environment variables. Then two lines of code are added, and the following code is added:

  1. #! /Bin/sh
  2. #
  3. # Chkconfig: 2345 70 40
  4. # Description: gmond startup script
  5. #
  6. GMOND =/usr/sbin/gmond
  7. # TMPDIR set to SysV IPC ramdrive to avoid include processing failures
  8. TMPDIR =/dev/shm
  9. Export TMPDIR
  10. TPATH = $ PATH
  11. ./Etc/rc. d/init. d/functions
  12. PATH = $ TPATH
  13. RETVAL = 0
  14. Case "$1" in
  15. Start)
  16. Echo-n "Starting GANGLIA gmond :"
  17. [-F $ GMOND] | exit 1
  18. Daemon $ GMOND
  19. RETVAL =$?
  20. Echo
  21. [$ RETVAL-eq 0] & touch/var/lock/subsys/gmond
  22. ;

After the code is changed, there is no problem in using/etc/init. d/gmond for execution, so it must be a problem with the PATH of the environment variable. As mentioned above, my python is compiled by myself. In order not to affect yum, I connect to/usr/local/bin/python, the PATH variable defined by the service gmond start command is defined by the service script instead of defined by the current shell user. Therefore, if I modify the code as follows, it will be okay:

  1. #! /Bin/sh
  2. #
  3. # Chkconfig: 2345 70 40
  4. # Description: gmond startup script
  5. #
  6. GMOND =/usr/sbin/gmond
  7. # TMPDIR set to SysV IPC ramdrive to avoid include processing failures
  8. TMPDIR =/dev/shm
  9. Export TMPDIR
  10. ./Etc/rc. d/init. d/functions
  11. PATH =/usr/local/bin: $ PATH
  12. RETVAL = 0
  13. Case "$1" in
  14. Start)
  15. Echo-n "Starting GANGLIA gmond :"
  16. [-F $ GMOND] | exit 1
  17. Daemon $ GMOND
  18. RETVAL =$?
  19. Echo
  20. [$ RETVAL-eq 0] & touch/var/lock/subsys/gmond
  21. ;

Use Ganglia to monitor Hadoop Clusters

Install and configure Hadoop and Ganglia in Ubuntu of VMware Workstation

Create a Grid

Ganglia installation tutorial yum

Ganglia Quick Start Guide (translated from the official wiki)

Install Ganglia-3.6.0 monitoring Hadoop-2.2.0 and HBase-0.96.0 on CentOS Cluster

Install Ganglia on CentOS 6.5

Install Ganglia on Ubuntu 14.04 Server

This article permanently updates the link address:

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.