Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use monit to monitor storm

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how to use monit to monitor storm". In daily operation, I believe many people have doubts about how to use monit to monitor storm. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to use monit to monitor storm". Next, please follow the editor to study!

First, installation. First of all, go to monit to download the latest monit version. The old version may not support it.

The official website address is http://mmonit.com/monit/.

Install with rpm if the yum source is not matched.

Yum-y install pam-devel

Tar-zxf monit-5.12.tar.gz-C / tmp/

Cd / tmp/monit-5.12

. / configure-prefix=/usr/local/monit-sysconfdir=/usr/local/monit/etc-without-ssl-without-pam

Make & & make install

Mkdir-p / usr/local/monit/etc

Cp monitrc / usr/local/monit/etc/

Chmod 600 / usr/local/monit/etc/monitrc

Cd / bin

Ln-s / usr/local/monit/bin/monit / bin/monit

Cp / usr/local/monit/etc/monitrc / etc/monitrc

Second, use.

If you are not familiar with monit, it is recommended to be familiar with the use of monit first.

Monit starts monit-c / etc/monitrc

Stop monit quit

View monit status

Reload monit reload

Start the monitoring item monit start monitoring name

Other

# monit-h

Usage: monit [options] {arguments}

Options are as follows:

-cfile Use this control file

-dn Run as a daemon once per nseconds

-gname Set group name for start,stop, restart, monitor and unmonitor

-llogfile Print log information to thisfile

-ppidfile Use this lock file in daemonmode

-sstatefile Set the file monit shouldwrite state information to

-I Do not run in background (needed for run from init)

-t Run syntax check for the control file

-v Verbose mode, work noisy (diagnostic output)

-H [filename] Print SHA1 and MD5 hashes of the file or of stdin if the

Filename is omited; monit willexit afterwards

-V Print version number and patchlevel

-h Print this text

Optional action arguments for non-daemonmode are as follows:

Start all-Start all services

Start name-Only start the named service

Stopall-Stop all services

Stopname-Only stop the named service

Restart all-Stop and start all services

Restart name-Only restart the named service

Monitorall-Enable monitoring of allservices

Monitor name-Only enable monitoring of the named service

Unmonitor all-Disable monitoring of all services

Unmonitor name-Only disable monitoring ofthe named service

Reload-Reinitialize monit

Status-Print full status information for each service

Summary-Print short status information for each service

Quit-Kill monit daemon process

Validate-Check all services and start if not running

=

Third, monitor storm

My storm path is / usr/storm

1. Write a nimbus startup script for storm

#! / bin/bash

/ usr/storm/bin/storm nimbus &

And named after startstorm.sh, save and give the execution permission, and store it under STORM_HOME/bin.

Then execute permissions to see if the script can be executed successfully.

2. Check the nimbus process. No offense, the name of the nimbus process is very long.

Root@master Desktop] # ps-elf | grep nimbus

0 S root 12355 1 5800-764995 futex_ 01:47? 00:00:04 / usr/java/jdk1.8.0_31/bin/java-server-Dstorm.options=-Dstorm.home=/usr/storm-Dstorm.log.dir=/usr/storm/logs-Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib-Dstorm.conf.file=-cp / usr/storm/lib/ring-devel-0.3.11.jar:/usr/storm/lib / carbonite-1.4.0.jar:/usr/storm/lib/tools.macro-0.1.0.jar:/usr/storm/lib/metrics-core-2.2.0.jar:/usr/storm/lib/tools.logging-0.2.3.jar:/usr/storm/lib/compojure-1.1.3.jar:/usr/storm/lib/chill-java-0.3.5.jar:/usr/storm/lib/asm-4.0.jar:/ Usr/storm/lib/ring-jetty-adapter-0.3.11.jar:/usr/storm/lib/kryo-2.21.jar:/usr/storm/lib/tools.cli-0.2.4.jar:/usr/storm/lib/slf4j-api-1.7.2.jar:/usr/storm/lib/clojure-1.5.1.jar:/usr/storm/lib/servlet-api-2.5.jar:/usr/storm/lib/zkclient-0.3. Jar:/usr/storm/lib/joda-time-2.0.jar:/usr/storm/lib/minlog-1.2.jar:/usr/storm/lib/json-simple-1.1.jar:/usr/storm/lib/kafka_2.10-0.8.1.1-scaladoc.jar:/usr/storm/lib/storm-core-0.9.3.jar:/usr/storm/lib/jetty-6.1.26.jar:/usr/storm/lib/commons -io-2.4.jar:/usr/storm/lib/logback-core-1.0.13.jar:/usr/storm/lib/kafka_2.10-0.8.1.1.jar:/usr/storm/lib/objenesis-1.2.jar:/usr/storm/lib/commons-codec-1.6.jar:/usr/storm/lib/zookeeper-3.3.4.jar:/usr/storm/lib/jopt-simple-3.2.jar:/usr/ Storm/lib/math.numeric-tower-0.0.1.jar:/usr/storm/lib/jetty-util-6.1.26.jar:/usr/storm/lib/snakeyaml-1.11.jar:/usr/storm/lib/jline-2.11.jar:/usr/storm/lib/clj-stacktrace-0.2.2.jar:/usr/storm/lib/commons-fileupload-1.2.1.jar:/usr/storm/lib/log4j-1.2.15. Jar:/usr/storm/lib/ring-servlet-0.3.11.jar:/usr/storm/lib/commons-exec-1.1.jar:/usr/storm/lib/kafka_2.10-0.8.1.1-javadoc.jar:/usr/storm/lib/kafka_2.10-0.8.1.1-sources.jar:/usr/storm/lib/clout-1.0.1.jar:/usr/storm/lib/commons-lang-2.5. Jar:/usr/storm/lib/log4j-over-slf4j-1.6.6.jar:/usr/storm/lib/slf4j-api-1.7.5.jar:/usr/storm/lib/ring-core-1.1.5.jar:/usr/storm/lib/snappy-java-1.0.5.jar:/usr/storm/lib/reflectasm-1.07-shaded.jar:/usr/storm/lib/hiccup-0.3.6.jar:/usr/storm/lib / disruptor-2.10.1.jar:/usr/storm/lib/core.incubator-0.1.0.jar:/usr/storm/lib/scala-library-2.10.1.jar:/usr/storm/lib/jgrapht-core-0.9.0.jar:/usr/storm/lib/logback-classic-1.0.13.jar:/usr/storm/lib/commons-logging-1.1.3.jar:/usr/storm/lib/clj-time-0.4 .1.jar: / usr/storm/conf-Xmx1024m-Dlogfile.name=nimbus.log-Dlogback.configurationFile=/usr/storm/logback/cluster.xml backtype.storm.daemon.nimbus

3. Edit / etc/monitrc add the following content at the end. Here, stormnb is the monitoring name, and the content after matching is the process name found by the above command. Do not copy different versions. If monit has been started, use monit start stormnb to start the monitoring process.

Check process stormnb matching "/ usr/java/jdk1.8.0_31/bin/java-server-Dstorm.options=-Dstorm.home=/usr/storm-Dstorm.log.dir=/usr/storm/logs-Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib-Dstorm.conf.file=-cp / usr/storm/lib/ring-devel-0.3.11.jar:/usr/storm/lib/carbonite-1.4.0.jar:/usr/storm/ Lib/tools.macro-0.1.0.jar:/usr/storm/lib/metrics-core-2.2.0.jar:/usr/storm/lib/tools.logging-0.2.3.jar:/usr/storm/lib/compojure-1.1.3.jar:/usr/storm/lib/chill-java-0.3.5.jar:/usr/storm/lib/asm-4.0.jar:/usr/storm/lib/ring-jetty-adapter-0.3. 11.jar:/usr/storm/lib/kryo-2.21.jar:/usr/storm/lib/tools.cli-0.2.4.jar:/usr/storm/lib/slf4j-api-1.7.2.jar:/usr/storm/lib/clojure-1.5.1.jar:/usr/storm/lib/servlet-api-2.5.jar:/usr/storm/lib/zkclient-0.3.jar:/usr/storm/lib/joda-time-2.0 .jar: / usr/storm/lib/minlog-1.2.jar:/usr/storm/lib/json-simple-1.1.jar:/usr/storm/lib/kafka_2.10-0.8.1.1-scaladoc.jar:/usr/storm/lib/storm-core-0.9.3.jar:/usr/storm/lib/jetty-6.1.26.jar:/usr/storm/lib/commons-io-2.4.jar:/usr/storm/lib/ Logback-core-1.0.13.jar:/usr/storm/lib/kafka_2.10-0.8.1.1.jar:/usr/storm/lib/objenesis-1.2.jar:/usr/storm/lib/commons-codec-1.6.jar:/usr/storm/lib/zookeeper-3.3.4.jar:/usr/storm/lib/jopt-simple-3.2.jar:/usr/storm/lib/math.numeric-tower-0.0.1. Jar:/usr/storm/lib/jetty-util-6.1.26.jar:/usr/storm/lib/snakeyaml-1.11.jar:/usr/storm/lib/jline-2.11.jar:/usr/storm/lib/clj-stacktrace-0.2.2.jar:/usr/storm/lib/commons-fileupload-1.2.1.jar:/usr/storm/lib/log4j-1.2.15.jar:/usr/storm/lib/ring-servlet-0.3 .11.jar: / usr/storm/lib/commons-exec-1.1.jar:/usr/storm/lib/kafka_2.10-0.8.1.1-javadoc.jar:/usr/storm/lib/kafka_2.10-0.8.1.1-sources.jar:/usr/storm/lib/clout-1.0.1.jar:/usr/storm/lib/commons-lang-2.5.jar:/usr/storm/lib/log4j-over-slf4j-1 .6.6.jar: / usr/storm/lib/slf4j-api-1.7.5.jar:/usr/storm/lib/ring-core-1.1.5.jar:/usr/storm/lib/snappy-java-1.0.5.jar:/usr/storm/lib/reflectasm-1.07-shaded.jar:/usr/storm/lib/hiccup-0.3.6.jar:/usr/storm/lib/disruptor-2.10.1.jar:/usr/storm/ Lib/core.incubator-0.1.0.jar:/usr/storm/lib/scala-library-2.10.1.jar:/usr/storm/lib/jgrapht-core-0.9.0.jar:/usr/storm/lib/logback-classic-1.0.13.jar:/usr/storm/lib/commons-logging-1.1.3.jar:/usr/storm/lib/clj-time-0.4.1.jar:/usr/storm/conf-Xmx1024m-Dlogfile. Name=nimbus.log-Dlogback.configurationFile=/usr/storm/logback/cluster.xml backtype.storm.daemon.nimbus "

Start program = "/ bin/sh / usr/storm/bin/start_storm.sh" with timeout 30 seconds

Stop program = "/ usr/bin/kill-9 `ps-elf | grep nimbus | grep-v grep | awk'{print $4}'`"

Note: the value of your own configuration storm_home and the value in the matching "" number should be the same as the process name you got by executing ps-elf | grep nimbus. The last two sentences mean start nimbus and stop nimbus.

[root@master storm] # monit reload

[root@master storm] # monit status

The Monit daemon 5.12 uptime: 1m

Process' stormnb'

Status Running

Monitoring status Monitored

Pid 4224

Parent pid 1

Uid 0

Effective uid 0

Gid 0

Uptime 1m

Children 0

Memory 109.1 MB

Memory total 109.1 MB

Memory percent 5.8%

Memory percent total 5.8%

Cpu percent 0.4%

Cpu percent total 0.4%

Data collected Tue, 17 Mar 2015 01:19:57

System 'master'

Status Running

Monitoring status Monitored

Load average [0.53] [0.20] [0.23]

Cpu 62.1%us 4.2%sy 0.5%wa

Memory usage 1.5 GB [79.7%]

Swap usage 460.5 MB [23.2%]

Data collected Tue, 17 Mar 2015 01:19:57

[root@master storm] # jps

4224 nimbus

3233 Kafka

4338 Jps

3061 QuorumPeerMain

3273 Kafka

[root@master storm] # kill-9 4224

Kill nimbus and check that just killed here is already started

[root@master storm] # jps

3233 Kafka

3061 QuorumPeerMain

4360 Jps

3273 Kafka

4350 config_value

[root@master storm] # jps

3233 Kafka

3061 QuorumPeerMain

3273 Kafka

4349 nimbus

4414 Jps

[root@master storm] # monit status

The Monit daemon 5.12 uptime: 3m

Process' stormnb'

Status Running

Monitoring status Monitored

Pid 4349

Parent pid 1

Uid 0

Effective uid 0

Gid 0

Uptime 0m

Children 0

Memory 104.8 MB

Memory total 104.8 MB

Memory percent 5.6%

Memory percent total 5.6%

Cpu percent 0.4%

Cpu percent total 0.4%

Data collected Tue, 17 Mar 2015 01:21:45

System 'master'

Status Running

Monitoring status Monitored

Load average [0.59] [0.28] [0.25]

Cpu 2.6%us 0.3%sy 0.0%wa

Memory usage 1.4 GB [74.6%]

Swap usage 460.5 MB [23.2%]

Data collected Tue, 17 Mar 2015 01:21:45

The method of monitoring supervisor,core is the same, just change it.

At this point, the study on "how to use monit to monitor storm" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report