ELK之在CentOS7.5上使用rpm包安装配置ELK7版本
一,安装环境查看

二,软件版本选用
jdk 1.8.0_171
elasticsearch 7.1.1
kibana 7.1.1
logstash 7.1.1
三,安装配置
1,安装JDK
过程不详述
2,安装ELK
官网下载安装包
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.1.1-x86_64.rpm
wget https://artifacts.elastic.co/downloads/kibana/kibana-7.1.1-x86_64.rpm
wget https://artifacts.elastic.co/downloads/logstash/logstash-7.1.1.rpm
安装
rpm -ivh elasticsearch-7.1.1-x86_64.rpm
rpm -ivh kibana-7.1.1-x86_64.rpm
rpm -vih logstash-7.1.1.rpm
修改elasticsearch配置文件
/etc/elasticsearch/elasticsearch.yml
#集群名
cluster.name: my-es
#node名
node.name: node-1
#数据目录
path.data: /data/es-data
#日志目录
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
#集群master需要和node名设置一致
cluster.initial_master_nodes: ["node-1"]
设置elasticsearch的jave目录(手动安装java需设置yum安装的java无需设置)
修改配置文件
/etc/sysconfig/elasticsearch
设置java目录
JAVA_HOME=/usr/local/jdk1.8.0_171
创建数据目录并设置权限
mkdir -p /data/es-data
chown -R elasticsearch:elasticsearch /data/es-data/
启动elasticsearch
systemctl start elasticsearch
systemctl enable elasticsearch
检测是否启动
[root@salt-test 7.1.1]# curl 127.0.0.1:9200
{
"name" : "node-1",
"cluster_name" : "my-es",
"cluster_uuid" : "-5vm0JOyQP-fehWjlXal_A",
"version" : {
"number" : "7.1.1",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "7a013de",
"build_date" : "2019-05-23T14:04:00.380842Z",
"build_snapshot" : false,
"lucene_version" : "8.0.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
设置kibana
修改配置文件
server.port: 5601
server.host: "0.0.0.0"
server.name: "node-1"
elasticsearch.hosts: ["http://192.168.1.4:9200"]
kibana.index: ".kibana"
PS:7版本elasticsearch.hosts的配置在6版本里面为elasticsearch.url 需要配置正确否则message日志会报错
FATAL Error: [elasticsearch.url]: definition for this key is missing
启动
systemctl start kibana
systemctl enable kibana
web页面查看,还没有索引

安装head
安装head同elasticsearch6 参考 https://www.cnblogs.com/minseo/p/9117470.html
集群健康状态检查
curl -XGET 'http://192.168.1.4:9200/_cluster/health?pretty=true'
使用logstash收集日志
标准输入输出
/usr/share/logstash/bin/logstash -e 'input { stdin{} } output { stdout {} }'

页面输入什么则输出什么
以json格式输出

输出至ES
/usr/share/logstash/bin/logstash -e 'input { stdin{} } output { elasticsearch { hosts => ["192.168.1.4:9200"] index => "logstash-%{+YYYY.MM.dd}" } }'
启动后标准输出无反应

打卡head即可查看


写一个配置文件收集系统日志
/etc/logstash/conf.d/file.conf
input{
file{
path => ["/var/log/messages"]
type => "system-log"
start_position => "beginning"
}
}
filter{
}
output{
elasticsearch{
hosts => ["192.168.1.4:9200"]
index => "system-log-%{+YYYY.MM}"
}
}
启动放置在后台
/usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/file.conf &
当文件/var/log/messages有日志写入时就会写es,在head可以查看

把日志添加至kiban展示


查看

elk7搭建完成与elk6搭建几乎一致
区别为elasticsearch配置文件需要添加配置,否则elasticsearch启动不成功
cluster.initial_master_nodes: ["node-1"]
ELK之在CentOS7.5上使用rpm包安装配置ELK7版本的更多相关文章
- MySQL5.6.36 linux rpm包安装配置文档
一.卸载自带mysql,删除MySQL的lib库,服务文件 [root@localhost ~]#rpm -qa|grep mysql qt-mysql-4.6.2-26.el6_4.x86_64 m ...
- ELK(使用RPM包安装配置ELK)
1,安装环境查看 2,下载rmp包 下载地址:https://www.elastic.co/cn/downloads 分别下载最新rmp包 elasticsearch-6.2.4.rpm logsta ...
- Mongodb之使用rpm包安装配置启动
下载rpm包 wget https://mirrors.aliyun.com/mongodb/yum/redhat/7Server/mongodb-org/3.2/x86_64/RPMS/mongod ...
- centos7中mysql的rpm包安装
解决依赖 yum remove mysql-libs 执行命令:yum -y install autoconf 安装依赖 yum -y install autoconf 安装mysql rpm -iv ...
- rpm包安装mysql5.6.*版本
1.查看是否已经安装Mysql rpm -qa | grep -i mysql #删除已经安装的Mysql程序 rpm -ev *****.rpm 2.检查是否还有残留mysql文件夹 find / ...
- Centos7上以RPM包方式安装Oracle 18c XE
Centos7上以RPM包方式安装Oracle 18c XE 安装阿里云 YUM 源 https://opsx.alibaba.com/mirror?lang=zh-CN 一.安装oracle数据库 ...
- CentOS7使用rpm包安装MySQL
说明 本文写于2017-05-20,使用MySQL-5.7.18.操作系统为64位CentOS Linux release 7.2.1511 (Core),以桌面形式安装. 卸载MariaDB Cen ...
- CentOS7.5 上使用 bundle 文件安装 MySQL8.0 MySQL5.0
CentOS7.5 上使用 bundle 文件安装 MySQL8.0 MySQL5.0 CentOS7.5 环境 [root@instance-fjii60o3 ~]# rpm -qi centos- ...
- [Docker]CentOS7通过rpm包安装Docker
前几天写过一篇文章:[Docker]CentOS7下Docker安装教程,直接使用yum命令下载Docker即可.但是前提是你需要***,所以这篇文章来讲讲,如果不会***,该如何安装Docker. ...
随机推荐
- JS闭包是什么?
闭包是js开发惯用的技巧,什么是闭包? 闭包指的是:能够访问另一个函数作用域的变量的函数. 清晰的讲:闭包就是一个函数,这个函数能够访问其他函数的作用域中的变量. function outer(){ ...
- Python 高级(二)
多继承以及MRO顺序 1. 单独调用父类的方法 # coding=utf-8 print("******多继承使用类名.__init__ 发生的状态******") class P ...
- Django REST framework+Vue 打造生鲜电商项目(笔记九)
(from:http://www.cnblogs.com/derek1184405959/p/8859309.html) 十二.支付宝沙箱环境配置 12.1.创建应用 进入蚂蚁金服开放平台(https ...
- 引入其他服务器的JS文件,同时也引入本地JS文件 报错时:
控制台报错: Uncaught ReferenceError: define is not defined at core.js:5
- DIV半透明层
想使用DIV半透明层时 只需加一个filter:alpha(Opacity=80);-moz-opacity:0.5;opacity: 0.5 0.5为半透明系数 使用前 使用后 style=& ...
- learning scala How To Create Variable Argument Function - varargs :_ *
Scala collection such as List or Sequence or even an Array to variable argument function using the s ...
- FOI冬令营 Day2
目录 T1.直径(diameter) 传送门 Code T2.定价(price) 传送门 Code T3.排序(sort) 传送门 Code T1.直径(diameter) 传送门 Code //20 ...
- hadoop 2.x HA 出现ssh不能解析问题记录。
在docker里面安装hadoop HA 在启动或者停止的时候报ssh不能解析问题. 问题现象: 发现图片不清晰:把问题现象粘贴如下: root@master:/usr/local/hadoop-2. ...
- MovingWallVelocity边界条件【翻译】
翻译自:CFD-online 帖子地址:http://www.cfd-online.com/Forums/openfoam-solving/59646-movingwallvelocity-bound ...
- SpringCloud介绍及入门(二)
接口的实现 在user_service_interface中添加一个User的类. 增加私有属性 id,name , 并利用快捷键Alt+Insert 实现get,set的快速生成. 实体类User ...