Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-9152

Not able to find HMaster and HRegionServer processes with grep by process name on ps result because of large classpath as argument.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 0.98.0, 0.95.2
    • scripts
    • None
    • 0.96notable

    Description

      Here no class name of HMaster because cmdline file holds 4kb(depends on os). So grep on ps output is not giving hbase process details.

      HOST-10-18-91-14:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin # cat /proc/16885/cmdline
      /opt/jdk1.6.0_31/bin/java-Dproc_master-XX:OnOutOfMemoryError=kill -9 %p-Xmx1000m-XX:+UseConcMarkSweepGC-Dhbase.log.dir=/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../logs-Dhbase.log.file=hbase-root-master-HOST-10-18-91-14.log-Dhbase.home.dir=/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/..-Dhbase.id.str=root-Dhbase.root.logger=INFO,RFA-Dhbase.security.logger=INFO,RFAS-classpath/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../conf:/opt/jdk1.6.0_31/lib/tools.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/..:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/activation-1.1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/asm-3.1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-beanutils-1.7.0.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-beanutils-core-1.8.0.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-cli-1.2.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-codec-1.7.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-collections-3.2.1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-configuration-1.6.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-digester-1.8.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-el-1.0.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-httpclient-3.0.1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-io-2.4.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-lang-2.6.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-logging-1.1.1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-math-2.2.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/commons-net-1.4.1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/core-3.1.1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/findbugs-annotations-1.3.9-1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/guava-12.0.1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hadoop-core-1.1.2.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-client-0.97.0-SNAPSHOT.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-common-0.97.0-SNAPSHOT-tests.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-common-0.97.0-SNAPSHOT.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-examples-0.97.0-SNAPSHOT.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-hadoop-compat-0.97.0-SNAPSHOT.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-hadoop1-compat-0.97.0-SNAPSHOT.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-it-0.97.0-SNAPSHOT-tests.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-it-0.97.0-SNAPSHOT.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-prefix-tree-0.97.0-SNAPSHOT.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-protocol-0.97.0-SNAPSHOT.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-server-0.97.0-SNAPSHOT-tests.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/hbase-server-0.97.0-SNAPSHOT.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/high-scale-lib-1.1.1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/htrace-1.50.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/httpclient-4.1.3.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/httpcore-4.1.3.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/jackson-core-asl-1.8.8.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/jackson-jaxrs-1.8.8.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/jackson-mapper-asl-1.8.8.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/jackson-xc-1.8.8.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/jamon-runtime-2.3.1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/jasper-compiler-5.5.23.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/jasper-runtime-5.5.23.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/jaxb-api-2.1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/jaxb-impl-2.2.3-1.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/jersey-core-1.8.jar:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../lib/jersey-json-1.8.jar
      

      Output of grep on ps result :
      =============================

      HOST-10-18-91-14:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin # ps ux | grep HMaster
      root     17342  0.0  0.0  10640   884 pts/1    R+   23:19   0:00 grep HMaster
      

      We can export classpath before exec hbase process.

      export CLASSPATH=$CLASSPATH
      if [ "${HBASE_NOEXEC}" != "" ]; then
        "$JAVA" -Dproc_$COMMAND -XX:OnOutOfMemoryError="kill -9 %p" $JAVA_HEAP_MAX $HBASE_OPTS $CLASS "$@"
      else
        exec "$JAVA" -Dproc_$COMMAND -XX:OnOutOfMemoryError="kill -9 %p" $JAVA_HEAP_MAX $HBASE_OPTS $CLASS "$@"
      fi
      

      Here is the output after exporting classpath.

      HOST-10-18-91-14:/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin # ps ux | grep HMaster
      root     20481 21.2  3.0 1443992 112268 pts/1  Sl   00:04   0:05 /opt/jdk1.6.0_31/bin/java -Dproc_master -XX:OnOutOfMemoryError=kill -9 %p -Xmx1000m -XX:+UseConcMarkSweepGC -Dhbase.log.dir=/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/../logs -Dhbase.log.file=hbase-root-master-HOST-10-18-91-14.log -Dhbase.home.dir=/home/rajeshbabu/hbase-0.97.0-SNAPSHOT/bin/.. -Dhbase.id.str=root -Dhbase.root.logger=INFO,RFA -Dhbase.security.logger=INFO,RFAS org.apache.hadoop.hbase.master.HMaster start
      root     20814  0.0  0.0  10640   876 pts/1    S+   00:04   0:00 grep HMaster
      

      This will help to find hbase processes dynamically by process name (HMaster,HRegionServer). Needed in our use case.

      Attachments

        1. HBASE-9152_trunk.patch
          0.7 kB
          rajeshbabu
        2. HBASE-9152_trunk_2.patch
          0.7 kB
          rajeshbabu
        3. HBASE-9152_94.patch
          0.7 kB
          rajeshbabu
        4. HBASE-9152_94_2.patch
          0.7 kB
          rajeshbabu

        Activity

          People

            rajesh23 rajeshbabu
            rajesh23 rajeshbabu
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: