搭建es執行環境
系統基於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.全路徑------這三點是耗時一天的成果---------------