• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

搭建es运行环境

互联网 diligentman 2周前 (11-20) 11次浏览

系统基于centos 7.4 

1.monit运行

前提:内网环境不能用yum    Centos7.4
1.解压安装
tar -xzvf monit-5.26.0.tar.gz -C /usr/local/
 	cd /usr/local/monit-5.26.0
 	./configure  --without-zlib --without-pam --without-ssl --without-largefile
 	make
 	make install
 	cp monitrc /etc/monitrc
    mkdir /etc/monit.d
2.配置文件vi /etc/monitrc

set daemon  60
 #set log syslog
 set logfile /var/log/monit.log
 set httpd port 2812 and
 use address 172.20.10.11
 allow 0.0.0.0/0.0.0.0
 allow admin:monit
 #with ssl {            # enable SSL/TLS and set path to server certificate
 #    pemfile: /etc/ssl/certs/monit.pem
 #}
 include /etc/monit.d/*

3.安装服务

 cp /usr/local/monit-5.26.0/system/startup/monit.service /usr/lib/systemd/system/monit.service

 monit.service 原文如下
-------------------------------------start----------
# This file is systemd template for monit service. To
# register monit with systemd, place the monit.service file
# to the /lib/systemd/system/ directory and then start it
# using systemctl (see bellow).
#
# Enable monit to start on boot:
#         systemctl enable monit.service
#
# Start monit immediately:
#         systemctl start monit.service
#
# Stop monit:
#         systemctl stop monit.service
#
# Status:
#         systemctl status monit.service

[Unit]
Description=Pro-active monitoring utility for unix systems
After=network.target
Documentation=man:monit(1) https://mmonit.com/wiki/Monit/HowTo

[Service]
Type=simple
KillMode=process
ExecStart=/usr/local/bin/monit -I -c ${prefix}/etc/monitrc
ExecStop=/usr/local/bin/monit -c ${prefix}/etc/monitrc quit
ExecReload=/usr/local/bin/monit -c ${prefix}/etc/monitrc reload
Restart=on-abnormal
StandardOutput=null

[Install]
WantedBy=multi-user.target
-------------------------------------end----------

systemctl enable monit

reboot  

4.脚本运行  
注意三点,1.全路径,
         2.全路径,
         3.全路径------这三点是耗时一天的成果---------------

 

 


喜欢 (0)