Elasticsearch python 启动脚本
来源:互联网 发布:大连嘉友软件 编辑:程序博客网 时间:2024/05/18 00:29
import osimport sysdef endpcess(): nb= os.popen("jps|grep Elasticsearch").read() oldid=nb.split(' ')[0] #print 'oldid'+oldid nb=os.system("kill "+oldid) return 'Elasticsearch is end'def startprcess(): os.system("su - es -c '/home/es/es/es-2.4.4/bin/elasticsearch -d'") #nb= os.popen("jps|grep Elasticsearch").read() #print 'newid'+nb.split(' ')[0] return 'Elasticsearch is start'def restartprcess(): endpcess() startprcess() return 'Elasticsearch is restart'if __name__ =='__main__': try: name=sys.argv[1] if name=='-e': info=endpcess() print info elif name=='-s': info=startprcess() print info elif name=='-r': info=restartprcess() print info elif name=='-h': print 'cmd:python es.py -e ----stop Elasticsearch service' print 'cmd:python es.py -s ----start Elasticsearch service' print 'cmd:python es.py -r ----restart Elasticsearch service' print 'cmd:python es.py -h ----cmd help' except: print 'cmd:python es.py -e ----stop Elasticsearch service' print 'cmd:python es.py -s ----start Elasticsearch service' print 'cmd:python es.py -r ----restart Elasticsearch service' print 'cmd:python es.py -h ----cmd help'
阅读全文
0 0
- Elasticsearch python 启动脚本
- python启动脚本
- python脚本中启动另一个python脚本
- 开启自启动python脚本
- linux开机启动python脚本
- Python脚本启动Java服务
- 配置定时启动python 脚本
- 树莓派开机启动python脚本
- spark 上python启动脚本
- python启动脚本--daemon形式
- elasticsearch 启动
- Python编写Oracle和Elasticsearch数据同步脚本
- python 脚本作为Windows服务启动
- python 脚本作为Windows服务启动
- python 脚本作为Windows服务启动
- 用Python实现开机延迟启动脚本
- python脚本当作Linux中的服务启动
- 【笔记】配置Python脚本自启动服务
- java数学函数Math类中常用的方法
- 区分:subString/ substr / slice / splice
- [转]深入理解 Promise 五部曲:1. 异步问题
- dubbo : forbid consumer
- 树形结构的处理——组合模式(二)
- Elasticsearch python 启动脚本
- spring框架入门详解
- 根据二维码url生成二维码显示到页面
- C#金额转大写的方法
- 全志R40平台的tinav2.1系统下打开SPI2接口(分色排版)
- Linux安全策略机制-SELinux
- 给定一个非负整数,你可以最多交换两个数字一次来获得最大值的数字。 返回您可以获得的最大值。
- 二、python基本操作
- 统计学习方法---感知机