搭建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.全路径------这三点是耗时一天的成果---------------

 

 

posted @   瓜瓜先生  阅读(4)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
点击右上角即可分享
微信分享提示