elk相关启动脚本-shell编写
elasticsearch-restart:
#!/bin/bash
PID=`ps -ef|grep elasticsearch|grep -vE 'grep|controller|elasticsearch-restart'|awk '{print $2}'`
kill -9 $PID >/dev/null 2>&1
sleep 1
nohup elasticsearch -d >/data/soft/elasticsearch/nohup.out 2>&1 &
if [ ! -z $PID ]
then
echo SUCCESS!
fi
filebeat-restart:
#!/bin/bash
PID=`ps -ef|grep filebeat|grep -vE 'grep|filebeat-restart'|awk '{print $2}'`
kill -9 $PID >/dev/null 2>&1
sleep 1
nohup filebeat -c /data/soft/filebeat/filebeat.yml >/data/soft/filebeat/nohup.out 2>&1 &
if [ ! -z $PID ]
then
echo SUCCESS!
fi
kibana-restart:
#!/bin/bash
PID=`ps -ef|grep kibana|grep -vE 'grep|kibana-restart'|awk '{print $2}'`
kill -9 $PID >/dev/null 2>&1
sleep 1
nohup /data/soft/kibana/bin/kibana >/data/soft/logstash/out.log 2>&1 &
if [ ! -z $PID ]
then
echo SUCCESS!
fi
logstash-control:
#!/bin/bash
pid_exists(){
nohup logstash -f /data/soft/logstash/config/logstash.conf >/data/soft/logstash/out.log 2>&1 &
sleep 1
PID=`ps -ef|grep logstash|grep -vE 'grep|logstash-control|logstash-plain'|awk '{print $2}'`
if [ ! -z $PID ]
then
echo SUCCESS!
else
echo FAILED!
fi
}
pid_not_exists(){
PID=`ps -ef|grep logstash|grep -vE 'grep|logstash-control|logstash-plain'|awk '{print $2}'`
if [ ! -z $PID ]
then
kill -9 $PID >/dev/null 2>&1
echo SUCCESS!
else
echo "PID has been killed!..."
fi
}
case $1 in
start)
echo -n "starting......"
pid_exists
;;
stop)
echo -n "stopping......"
pid_not_exists
;;
*)
echo "sorry,other opera"
;;
esac
elk相关启动脚本-shell编写的更多相关文章
- (转)mysql5.6.7多实例安装、配置的详细讲解分析及shell启动脚本的编写
一.mysql安装 1.下载mysql数据库源码包: wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.27.tar.gz 2.安装mys ...
- 微服务一键启动脚本shell没有环境变量的
#!/bin/bash#######################################################export JAVA_HOME=/root/data/app/jd ...
- 微服务一键启动脚本shell带有环境变量的
etting####################################################### #程序代码数组APPS=(cAssistantbussiness cAssi ...
- jar启动脚本shell
#!/bin/bash#这里可替换为你自己的执行程序,其他代码无需更改 APP_NAME=/opt/server/msp/health-api/health-2.0.2.jar#使用说明,用来提示输入 ...
- linux shell 之尝试编写 企业级 启动脚本
企业Shell面试题10:开发企业级MySQL启动脚本 说明: MySQL启动命令为: 1 /bin/sh mysqld_safe --pid-file=$mysqld_pid_file_path 2 ...
- nginx的编译安装以及启动脚本编写
Nginx的编译安装和启动脚本的编写 Nginxd的功能强大,可以实现代理.负载均衡等企业常用的功能.下面介绍一下nginx的编译安装方法: 1. 下载 官方下载地址:http://nginx.org ...
- shell编写redis启动脚本
安装后redis,默认系统不会自启动,如果关机或重启redis不会自行启动,linux下/etc/init.d/目录下基本上存放所有系统的大多数的启动脚本,放在这个目录下的脚本可以实现自启动操作. ...
- 自己编写服务启动脚本(一):functions文件详细分析和说明
本文目录: 1.几个显示函数2.action函数3.is_true和is_false函数4.confirm函数5.pid检测相关函数 5.1 checkpid.__pids_var_run和__pid ...
- Linux shell编写脚本部署pxe网络装机
Linux shell编写脚本部署pxe网络装机 人工安装配置,Linux PXE无人值守网络装机 https://www.cnblogs.com/yuzly/p/10582254.html 脚本实 ...
随机推荐
- loj6038「雅礼集训 2017 Day5」远行 树的直径+并查集+LCT
题目传送门 https://loj.ac/problem/6038 题解 根据树的直径的两个性质: 距离树上一个点最远的点一定是任意一条直径的一个端点. 两个联通块的并的直径是各自的联通块的两条直径的 ...
- js中(try catch) 对代码的性能影响
https://blog.csdn.net/shmnh/article/details/52445186 起因 要捕获 JavaScript 代码中的异常一般会采用 try catch,不过 try ...
- 第六周作业—N42-虚怀若谷
一.自建yum仓库,分别为网络源和本地源 [root@centos7 ~]# cd /etc/yum.repos.d/ [root@centos7 yum.repos.d]# mkdir bak #建 ...
- 英语单词character
来源——tr帮助说明 TR() User Commands TR() NAME tr - translate or delete characters SYNOPSIS tr [OPTION]... ...
- python学习笔记(十四)加密模块
import hashlib ybq_pwd='bugaosuni' m=hashlib.md5() bytes_ybq=ybq_pwd.encode()#把字符串转成bytes类型,中文字符在Pyt ...
- ubuntu18.04-安装最新cmake
https://www.linuxidc.com/Linux/2018-09/154165.htm
- vu项目中按F5刷新element菜单没有根据路由匹配菜单解决办法
element组件的菜单中设置:default-active,这个是选择哪个菜单的 然后在created里边增加 因为每次刷新都是要经过这个的.注意data里边也要同步.
- laravel5.6操作数据curd写法(查询构建器)
laravel5.6 数据库操作-查询构建器 <?php //laravel5.6 语法 demo示例 namespace App\Http\Controllers;//命名该控制App空间下名 ...
- pytest相关问题解析
1. 如果你想查询在你的环境下有哪些pytest的active plugin可以使用: py.test --traceconfig 会得到一个扩展的头文件名显示激活的插件和他们的名字.同时也会打印出当 ...
- 从DBA_DDL_LOCKS视图获得DDL锁定信息
http://liwenshui322.iteye.com/blog/1166934 DDL锁有三种: 1.排他DDL锁(Exclusive DDL lock):这会防止其他会话得到它们自己的DDL锁 ...