本人实例:

#!/bin/bash

ps -ef | grep elastic | grep -v grep
if [ $? -ne 0 ]
then
echo "start process......"
echo 1 > /proc/sys/vm/drop_caches;
cd /data/soft/elasticsearch-6.4.0/bin/;
su elsearch;
./elasticsearch -d;
else
echo "runing......"
fi

这是检测搜索引擎 elastic 的脚本

 


#!/bin/bash

ps -ef | grep mysqld | grep -v grep
if [ $? -ne 0 ]
then
echo "start process......"
/etc/rc.d/init.d/mysqld start
else
echo "runing......"
fi

这是检测mysql 进程的 脚本

 

相关文章:

  • 2021-09-02
  • 2021-06-27
  • 2021-11-21
  • 2021-12-23
  • 2021-12-03
  • 2021-07-19
  • 2021-12-30
  • 2021-10-30
猜你喜欢
  • 2021-12-15
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
相关资源
相似解决方案