为了实现ELK的3部分开机启动,可以添加各项服务对应的service文件,再通过systemctl enable XXX实现ELK所有服务开机启动。

Elasticsearch

elasticsearch.service (/usr/lib/systemd/system)

[Unit]

Description=Elasticsearch

Documentation=http://www.elastic.co

Wants=network-online.target

After=network-online.target

[Service]

Environment=ES_HOME=/usr/share/elasticsearch

Environment=CONF_DIR=/etc/elasticsearch

Environment=DATA_DIR=/var/lib/elasticsearch

Environment=LOG_DIR=/var/log/elasticsearch

Environment=PID_DIR=/var/run/elasticsearch

EnvironmentFile=-/etc/sysconfig/elasticsearch

WorkingDirectory=/usr/share/elasticsearch

User=elasticsearch

Group=elasticsearch

ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec

ExecStart=/usr/share/elasticsearch/bin/elasticsearch \

-p ${PID_DIR}/elasticsearch.pid \

--quiet \

-Edefault.path.logs=${LOG_DIR} \

-Edefault.path.data=${DATA_DIR} \

-Edefault.path.conf=${CONF_DIR}

# StandardOutput is configured to redirect to journalctl since

# some error messages may be logged in standard output before

# elasticsearch logging system is initialized. Elasticsearch

# stores its logs in /var/log/elasticsearch and does not use

# journalctl by default. If you also want to enable journalctl

# logging, you can simply remove the "quiet" option from ExecStart.

StandardOutput=journal

StandardError=inherit

# Specifies the maximum file descriptor number that can be opened by this process

LimitNOFILE=65536

# Specifies the maximum number of processes

LimitNPROC=2048

# Specifies the maximum number of bytes of memory that may be locked into RAM

# Set to "infinity" if you use the 'bootstrap.memory_lock: true' option

# in elasticsearch.yml and 'MAX_LOCKED_MEMORY=unlimited' in /etc/sysconfig/elasticsearch

#LimitMEMLOCK=infinity

# Disable timeout logic and wait until process is stopped

TimeoutStopSec=0

# SIGTERM signal is used to stop the Java process

KillSignal=SIGTERM

# Send the signal only to the JVM rather than its control group

KillMode=process

# Java process is never killed

SendSIGKILL=no

# When a JVM receives a SIGTERM signal it exits with code 143

SuccessExitStatus=143

[Install]

WantedBy=multi-user.target

# Built for distribution-5.5.2 (distribution)

Logstash

logstash.service (/etc/systemd/system)

[Unit]

Description=logstash

[Service]

Type=simple

User=logstash

Group=logstash

# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.

# Prefixing the path with '-' makes it try to load, but if the file doesn't

# exist, it continues onward.

EnvironmentFile=-/etc/default/logstash

EnvironmentFile=-/etc/sysconfig/logstash

ExecStart=/usr/share/logstash/bin/logstash "--path.settings" "/etc/logstash"

Restart=always

WorkingDirectory=/

Nice=19

LimitNOFILE=16384

[Install]

WantedBy=multi-user.target

Kibana

kibana.service(/etc/systemd/system)

[Service]

ExecStart=/usr/local/kibana/bin/kibana

[Install]

WantedBy=multi-user.target

elk服务重启_ELK开机启动 service文件内容相关推荐

  1. centos 自定义开机启动service

    2,设置开机启动service 步骤如下(以启动开机启动redis为例子) 2-1 在目录/etc/systemd/system 下新建 xxx.service 文件 文件格式sample 如下 [U ...

  2. Windows10系统设置定时任务 开机启动.bat文件

    Windows10系统设置定时任务 开机启动.bat文件 Windows10系统设置定时任务 开机启动.bat文件_circle_do的博客-CSDN博客_win10定时启动bat文件

  3. linux怎么设置tomcat自动启动,linux添加tomcat服务并设置开机启动

    一,脚本文件,编辑好后放在/etc/rc.d/init.d/下面 #!/bin/sh #chkconfig: 2345 10 90 # description: Starts and Stops th ...

  4. 树莓派开机启动python文件_树莓派开机自启动Py文件

    第一种办法先简单提一下,比较简单.但是不知道为什么我开机同时运行三个python脚本的时候就不能运行了. 输入命令: sudo nano /etc/rc.local 1 在exit 0上一行输入: p ...

  5. 使用命令行 启动 各种服务(控制面板 开机启动项 注册表 等)

    目录 普通操作 8.计算机管理 (compmgmt.msc) 9.设备管理器 (devmgmt.msc) 查看机器信息 高级操作 使用命令行启动各种服务 普通操作 ================== ...

  6. 【开机启动】win11开机启动软件,win11开机启动bat脚本(开机启动vbs文件)

    目录 编辑bat脚本 编辑vbs脚本 让vbs脚本开机启动 编辑bat脚本 简单介绍一下 ::是注释前缀 echo 是输出内容到控制台,等同于print @echo off可以关闭路径显示,自己尝试写 ...

  7. android开机启动service

    为什么80%的码农都做不了架构师?>>>    1.开机启动后系统会发射出一个Standard Broadcast Action,名字叫android.intent.action.B ...

  8. 树莓派用服务方式设置开机启动

    http://shumeipai.nxez.com/2017/05/17/raspberry-pi-service-python-script-start-on-boot.html#more-3234 ...

  9. linux学习-将seafile启动脚本设置为开机启动服务

    有时候,我们安装的linux软件和程序不是通过yum安装,而是通过编译或者其他方式安装.有时需要将程序设置为服务,达到开机启动的目的. 我在公有云的与服务器上搭建了seafile网盘,当我重启云服务器 ...

  10. linux设置服务开机启动

    在linux的服务运维管理中,经常会出现这么一种需求,即通过自定义的脚本启动或者关闭一些服务,尽管有些软件在安装的时候可以进行设置,但如果要管理的服务特别多的情况下,假如服务器重启了,仍有一些服务需要 ...

最新文章

  1. 高考结束了,来看下QS最新全球大学排名,清华北大进前20
  2. Linux内核ipsec密码库,关于2.6.18 ipsec内核支持(NETKEY)的问题
  3. 剑指offer二:字符串中的空格替换
  4. 扩展SpringMVC WebMvcConfigurerAdapter ||全面接管SpringMVC @EnableWebMvc
  5. WIN7只能上QQ打不开网页,使用CMD输入netsh winsock reset
  6. 计划策略-40-最终装配计划
  7. Linux下的socket演示程序
  8. ARKit从入门到精通(2)-ARKit工作原理及流程介绍
  9. 路由器的异步和同步串行接口
  10. SQLServer2012x64数据库 安装过程 imp
  11. javaScript中私有属性和方法
  12. Python--Python--类和对象
  13. jchdl - GSL实例 - LogicalLeft
  14. Java实现图片压缩且不改变原图尺寸
  15. (一)1. 数据流图(DFD)概念及画法
  16. 简单明了强烈推荐办公神器
  17. 【网站技术解析③】--织梦入门使用教程
  18. js实现kmp算法_基于KMP算法JavaScript的实现方法分析
  19. 大学期间技术学习方面最有成就感的事?
  20. 学校计算机室上机记录,学生上机记录表

热门文章

  1. bzoj 4883 [Lydsy1705月赛]棋盘上的守卫——并查集(思路!)
  2. 属性变量,实例变量,全局变量
  3. 数据分析之Pandas(一) 学习资料汇总
  4. Exchange 2016 体系结构
  5. 常见的新算法的标准测试函数
  6. 智能优化算法(源码)-樽海鞘优化算法(Salp Swarm Algorithm,SSA)
  7. 智能优化算法应用:基于麻雀搜索算法PID参数优化 - 附代码
  8. 利用Python把遥感影像的某几个波段合成
  9. 自己闲着没事整理的人工智能的思维导图
  10. mysql更新语句使用order by