#!/bin/bash
. /etc/profile
. ~/.bash_profile
#crontab 每5分钟监控一次
#*/5 * * * * path/neo4j_database_monitor.sh
working_dir=basepath
cd ${working_dir}
lsof -i:7474
if [ $? -ne 0 ] #检测是否存在7474端口
then
./neo4j start
echo "`date` neo4j database is stopped. Now will start it" >> neo4j_monitor.log
fi
neo4j 数据库监控脚本
最新推荐文章于 2025-11-17 04:15:04 发布
本文介绍了一个使用Bash脚本实现的监控解决方案,每5分钟检查7474端口状态,如果发现未开启,启动Neo4j数据库并记录操作日志。

930

被折叠的 条评论
为什么被折叠?



