centos上手动安装最新版本ELK
软件包下载地址:https://www.elastic.co/downloads/elasticsearch
1,安装es
#tar zxvf elasticsearch-2.3.4.tar.gz
#mv elasticsearch-2.3.4 /usr/local
#Cd /usr/local
#mv elasticsearch-2.3.4/ elasticsearch
#chmod -R test:test ./elasticsearch/
#su test
更改配置文件config/elasticsearch.yml
cluster.name: node236
network.host: 192.168.1.236
$ bin/elasticsearch //这里应该正常启动了
插件安装
$ ./plugin install mobz/elasticsearch-head
-> Installing mobz/elasticsearch-head...
Trying https://github.com/mobz/elasticsearch-head/archive/master.zip ...
Downloading
......................................................................................................................................
....................................DONE
Verifying https://github.com/mobz/elasticsearch-head/archive/master.zip checksums if available ...
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed head into /usr/local/elasticsearch/plugins/head
[test@node236 bin]$ ls ../plugins/head/
elasticsearch-head.sublime-project .jshintrc _site/
.gitignore LICENCE src/
Gruntfile.js package.json test/
grunt_fileSets.js plugin-descriptor.properties
index.html README.textile
访问http://192.168.1.236:9200/_plugin/head/正常
注:此处远程访问一定要改配置文件的network.host值,否则只能本机访问
2,安装kibana
#tar zxvf kibana-4.5.3-linux-x64.tar.gz -C /usr/local/
# cd /usr/local/
# mv kibana-4.5.3-linux-x64/ kibana
# cd kibana/
# ls
bin installedPlugins node optimize README.txt webpackShims
config LICENSE.txt node_modules package.json src
# cd /etc/systemd/system
# vi kibana.service
[Service]
ExecStart=/usr/local/kibana/bin/kibana
[Install]
WantedBy=multi-user.target
# systemctl enable kibana
#systemctl start kibana
Created symlink from /etc/systemd/system/multi-user.target.wants/kibana.service to /etc/systemd/system/kibana.service.
#systemctl status kibana
— kibana.service
Loaded: loaded (/etc/systemd/system/kibana.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2016-07-27 16:35:12 CST; 814ms ago
Main PID: 44722 (node)
CGroup: /system.slice/kibana.service
44722 /usr/local/kibana/bin/../node/bin/node /usr/local/kibana/b...
Jul 27 16:35:12 node236 systemd[1]: Started kibana.service.
Jul 27 16:35:12 node236 systemd[1]: Starting kibana.service...
# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5601 0.0.0.0:* LISTEN 44722/node
tcp6 0 0 192.168.1.236:9200 :::* LISTEN 44160/java
tcp6 0 0 192.168.1.236:9300 :::* LISTEN 44160/java
3,安装logstash
[root@node236 test]# tar zxvf logstash-2.3.4.tar.gz -C /usr/local/
[root@node236 test]# cd /usr/local/
[root@node236 local]# mv logstash-2.3.4/ logstash
[root@node236 logstash-2.3.4]# ls
bin CHANGELOG.md CONTRIBUTORS Gemfile Gemfile.jruby-1.9.lock lib LICENSE NOTICE.TXT vendor
测试一下,情况正常
[root@node236 logstash-2.3.4]# bin/logstash -e 'input { stdin { } } output { stdout {} }'
Settings: Default pipeline workers: 1
Pipeline main started
2016-07-27T08:41:53.637Z node236
fdfd
2016-07-27T08:41:58.875Z node236 fdfd
afdfad
2016-07-27T08:42:01.846Z node236 afdfad
加个证书支持
[root@node236 logstash]# cd /etc/pki/tls
[root@node236 tls]# openssl req -subj '/CN=node236/' -x509 -days 3650 -batch -nodes -newkey rsa:2048 -keyout private/logstash-
forwarder.key -out certs/logstash-forwarder.crt
Generating a 2048 bit RSA private key
..........................................+++
....+++
writing new private key to 'private/logstash-forwarder.key'
-----
手动安装是没有配置文件的,需要自己建立
[root@node236 tls]# cd /usr/local/logstash/
[root@node236 logstash]# mkdir conf
[root@node236 logstash]# vi conf/1.conf
内容如下,这是针对apache的日志的监控
input {
file {
path => "/var/log/httpd/access_log"
start_position => beginning
}
}
filter {
if [path] =~ "access" {
mutate { replace => { "type" => "apache_access" } }
grok {
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
}
date {
match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
}
}
output {
elasticsearch {
hosts => "192.168.1.246:9200"
index => "fuckyou_index" #索引名称
}
stdout { codec => rubydebug }
}
"conf/1.conf" 26L, 471C written
[root@node236 logstash]# ./bin/logstash -f ./conf/1.conf //启动
4,测试
yum -y install httpd 装个apache,之后随便用个awvs扫一下IP
以下是在ES里看到的内容,说明已经正确抓取

访问kibana,一切正常。

centos上手动安装最新版本ELK的更多相关文章
- centos下安装最新版本git(通过master分支下载最新版)
centos6.7下安装最新版本git 本文参考:http://www.01happy.com/centos-install-latest-git/ 按照原博主所提供的思路安装可能会出现下列问题 解决 ...
- 【教程】CentOS 7安装 最新版本Docker
博主最近需要安装Docker,步骤如下: Docker安装官方地址:https://docs.docker.com/install/linux/docker-ce/centos/ 以下命令都是在roo ...
- 如何在CentOS 7中安装最新Git(源码安装)
如何在CentOS 7中安装最新Git 2017年05月20日 11:49:53 阅读数:1624 Git是在今天的软件开发行业一个非常有用的版本控制工具.我一直使用Git.于是为Linux公社的读者 ...
- 如何安装最新版本的memcached
转载自孟叔的博客: https://learndevops.cn/index.php/2016/06/10/how-to-install-the-latest-version-of-memcache ...
- Cacti中文版在Centos上的安装
最近老有人问Cacti中文版在哪下载啊怎么安装啊,我在这里一遍给大家讲解了:Cacti中文版在Centos上的安装 1.基本安装 cacti是运作在apache+php+mysql+net-snmp工 ...
- ubuntu14.04下配置Java环境以及安装最新版本的eclipse
首先是配置JDK 步骤一:下载最新版本的JDK,链接:http://www.oracle.com/technetwork/java/javase/downloads/index.html 步骤二:首先 ...
- angular4.0 安装最新版本的nodejs、npm、@angular/cli的方法
在使用ng项目的ui框架时,比如ng-zorro.angular Material,需要安装最新版本的@angular/cli: 配置ng-zorro框架 ng-zorro官网:https://ng. ...
- Windows7 64位安装最新版本MySQL服务器
Windows7 64位安装最新版本MySQL服务器 近期,一直在研究MySQL数据库,经常修改配置文件,导致MySQL数据库无法使用,不得不反复重装MySQL数据库.以下是在Windows7 64位 ...
- 【工具相关】ionic-通过nmp安装最新版本的 cordova 和 ionic
一,命令行下输入: sudo npm install -g cordova ionic 用来安装最新版本的cordova和ionic. 如下图所示: 二,等待一下,如下图所示. 三,用命令 npm u ...
随机推荐
- WPF RichTextBox 插入回车
richtextbox插入回车,开始是这样写的,在win7下运行时没有问题: MyMessageBox.CaretPosition.InsertLineBreak(); MyMessageBox.Ca ...
- vs2013错误 1 Unable to find messages file 'cscui.dll'
最近使用VS编译的时候,提示错误 错误 1 Unable to find messages file 'cscui.dll' 搜索后,几乎只有1个结果,就是搜索cscui.dll 把正常大小的文件替 ...
- select2,利用ajax高效查询大数据列表(可搜索、可分页)
二.导入css和js到网站上 1.使用CDN,节省自己网站的流量 ? 1 2 <link href="https://cdnjs.cloudflare.com/ajax/libs/se ...
- 附近wifi都是你的
今天给大家介绍deauth攻击. 最终效果:附近你指定的任何wifi,别人都无法连接,即便连接上的也会断掉. 由于我在 “世界虽大,但没有破不了的wifi” 这篇文章中写的很详细,所以我在这里就步详 ...
- 数据库中rs("ABC")与rs.Fields("ABC").value的差别(Rs是RecordSet对象)
透过RecordSet取得数据的时候我们要将数据显示出来时,假设字段名称是ABCABCX = rs("ABC")对于RecordSet来说....是把ABC这个[Fileds对象] ...
- C/C++ Sleep(0)
Sleep(0) 的意义是放弃当前线程执行的时间片,把自身放到等待队列之中.这时其它的线程就会得到时间片进行程序的程序.Sleep(0)能够降低当前线程的执行速 度,比如:现在系统中有100个线程(先 ...
- freemaker宏的用法
freemaker宏 定义:定义一个标签,标签体中可以包含参数,开始标签和结束标签可以包含内容,内容中可以通过${}方式引用标签体中定义的参数 用法:页面引入标签,通过标签可以直接输出标签的内容 He ...
- firefly
firefly (9秒社团-游戏服务端开源引擎) 编辑 Firefly是免费.开源.稳定.快速扩展.能 “热更新”的分布式游戏服务器端框架,采用Python编写,基于Twisted框架开发.它包括了开 ...
- cogs 421. HH的项链
421. HH的项链 http://218.28.19.228/cogs/problem/problem.php?pid=421 ★★★ 输入文件:diff.in 输出文件:diff.out ...
- if-else判断语句中经常犯的一个错误
假设题目为:随便给定一个数,三种情况:(1)若小于0,输出为“小于0”:(2)若在0-50之间,则输出“在0-50之间”.(3)若大于50,则输出“大于50”. 解法:如果我这么写,运行一下看看. i ...