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编写的更多相关文章

  1. (转)mysql5.6.7多实例安装、配置的详细讲解分析及shell启动脚本的编写

    一.mysql安装 1.下载mysql数据库源码包: wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.27.tar.gz 2.安装mys ...

  2. 微服务一键启动脚本shell没有环境变量的

    #!/bin/bash#######################################################export JAVA_HOME=/root/data/app/jd ...

  3. 微服务一键启动脚本shell带有环境变量的

    etting####################################################### #程序代码数组APPS=(cAssistantbussiness cAssi ...

  4. jar启动脚本shell

    #!/bin/bash#这里可替换为你自己的执行程序,其他代码无需更改 APP_NAME=/opt/server/msp/health-api/health-2.0.2.jar#使用说明,用来提示输入 ...

  5. linux shell 之尝试编写 企业级 启动脚本

    企业Shell面试题10:开发企业级MySQL启动脚本 说明: MySQL启动命令为: 1 /bin/sh mysqld_safe --pid-file=$mysqld_pid_file_path 2 ...

  6. nginx的编译安装以及启动脚本编写

    Nginx的编译安装和启动脚本的编写 Nginxd的功能强大,可以实现代理.负载均衡等企业常用的功能.下面介绍一下nginx的编译安装方法: 1. 下载 官方下载地址:http://nginx.org ...

  7. shell编写redis启动脚本

    ​ 安装后redis,默认系统不会自启动,如果关机或重启redis不会自行启动,linux下/etc/init.d/目录下基本上存放所有系统的大多数的启动脚本,放在这个目录下的脚本可以实现自启动操作. ...

  8. 自己编写服务启动脚本(一):functions文件详细分析和说明

    本文目录: 1.几个显示函数2.action函数3.is_true和is_false函数4.confirm函数5.pid检测相关函数 5.1 checkpid.__pids_var_run和__pid ...

  9. Linux shell编写脚本部署pxe网络装机

    Linux shell编写脚本部署pxe网络装机 人工安装配置,Linux PXE无人值守网络装机  https://www.cnblogs.com/yuzly/p/10582254.html 脚本实 ...

随机推荐

  1. pip安装包出现timeout的解决办法

    今天安装django时老是出现timeout WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, sta ...

  2. 调试IPV6

    从Mac分享IPV6 WIFI的方法: 按住opition + 系统设置中的share 进入 如果被拒了要上诉或者回复审核团队邮件,可以参考这个写: 尊敬的APP审查委员会: 您们好!我们希望将自己开 ...

  3. input的文件上传类型判断

    参考网址: http://www.helloweba.com/view-blog-224.html <p> <label>请选择一个图像文件:</label> &l ...

  4. Java后端进阶教程

    https://www.cnblogs.com/caoleiCoding/p/6170555.html 传智播客Java Spring框架:https://www.bilibili.com/video ...

  5. Java项目案例之---定时器的使用

    定时器的使用 使用定时器,在当前时间的10秒后调用方法,输出语句 import java.text.SimpleDateFormat; import java.util.Calendar; impor ...

  6. cordova+vue做的app解决引入cordova-plugin-splashscreen后启动先显示黑屏在显示启动页

    先上项目目录结构cordova项目结构 android platform 结构 图中用红框框起来的为主要修改文件 这篇主要的讲cordova项目引用了cordova-plugin-splashscre ...

  7. loj#500 「LibreOJ β Round」ZQC 的拼图

    分析 二分倍数 然后考虑dp[i][j]表示选到第i个x轴覆盖到j的情况y轴最多覆盖多少 贡献柿子可以画图然后相似三角形得到 代码 #include<bits/stdc++.h> usin ...

  8. day18—Flex弹性布局详解(二)

    转行学开发,代码100天——2018-04-03 2.6 align-content属性 align-content 属性定义了在交叉轴方向对齐方式和额外空间分配,类似于justify-content ...

  9. python tensorflow windows环境搭建体验

    1. 需先安装python3.7,anaconda包管理器(类似java的maven),tensorflow,pycharm开发工具.文末附件下载地址. 2. 安装tensorflow,开始-Anac ...

  10. C++ 编写的DLL导出的函数名乱码含义解析

    C++编译时函数名修饰约定规则: __stdcall调用约定:   1.以"?"标识函数名的开始,后跟函数名:     2.函数名后面以"@@YG"标识参数表的 ...