elk,centos7,filebeat,elasticsearch-head详细安装步骤
先来张图,大致结构应该晓得,对吧!

安装jdk:至少1.8以上
yum -y localinstall jdk-8u73-linux-x64.rpm
安装elasticsearch5.2.1 用普通用户安装es:
tar -zxvf elasticsearch-5.2.1.tar.gz
[es@node elasticsearch-5.2.1]$ ./bin/elasticsearch
处理错误:
ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
cat /etc/security/limits.conf 加上下面这个:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
cat /etc/sysctl.conf
vm.max_map_count=262144
fs.file-max=65536
然后启动成功!
也可以指定名字启动:
./elasticsearch -Ecluster.name=my_cluster_name -Enode.name=my_node_name 健康基本检测
[es@node bin]$ curl -XGET '192.168.36.141:9200/_cat/master?v&pretty'
id host ip node
lbWUxIvITHy_0SufW6fBtw 192.168.36.141 192.168.36.141 my_node_name
[es@node bin]$ curl -XGET '192.168.36.141:9200/_cat/health?v&pretty'
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1499173093 08:58:13 my_cluster_name green 1 1 0 0 0 0 0 0 - 100.0%
[es@node bin]$
练习索引和文档:
新建索引,显示索引:
[es@node bin]$ curl -XPUT 'localhost:9200/customer?pretty&pretty'
[2017-07-04T09:02:16,302][INFO ][o.e.c.m.MetaDataCreateIndexService] [my_node_name] [customer] creating index, cause [api], templates [], shards [5]/[1], mappings []
{
"acknowledged" : true,
"shards_acknowledged" : true
}
[es@node bin]$ curl -XGET 'localhost:9200/_cat/indices?v&pretty'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open customer gtxHBupjSQ-4DNgMAMnuqQ 5 1 0 0 650b 650b
[es@node bin]$
56 curl -XPUT 'localhost:9200/customer?pretty&pretty'
57 curl -XGET 'localhost:9200/_cat/indices?v&pretty'
58 curl -XPUT 'localhost:9200/customer/external/1?pretty&pretty' -H 'Content-Type: application/json' -d'
{
"name": "John Doe"
}
'
59 curl -XGET 'localhost:9200/customer/external/1?pretty&pretty'
60 curl -XDELETE 'localhost:9200/customer?pretty&pretty'
61 curl -XGET 'localhost:9200/_cat/indices?v&pretty'
62 curl -XPUT 'localhost:9200/customer/external/1?pretty&pretty' -H 'Content-Type: application/json' -d'
{
"name": "John Doe"
}
'
63 PUT /customer/external/1?pretty
64 { "name": "Jane Doe"; }
65 curl -XPUT 'localhost:9200/customer/external/1?pretty&pretty' -H 'Content-Type: application/json' -d'
{
"name": "Jane Doe"
}
'
66 PUT /customer/external/2?pretty
67 { "name": "Jane Doe"; }
68 curl -XPUT 'localhost:9200/customer/external/2?pretty&pretty' -H 'Content-Type: application/json' -d'
{
"name": "Jane Doe"
}
'
69 curl -XDELETE 'localhost:9200/customer/external/2?pretty&pretty'
官方文档说可以在kibana里面写更加直观。
反正这个装好了!下一个
安装kibana:
tar zxvf kibana-5.2.1-linux-x86_64.tar.gz
./kibana &
http://192.168.36.141:5601/status#?_g=()

先安装filebeat:
docker run -itd --name java -p 5000:22 bc74bce8afa1 镜像是我以前做的,直接用,在另外自己的一个网站上,有时间弄下来:
测试:启动我的java包nohup java -jar /data/exchange/exchange-1.4.jar & > nohup.out >/dev/null
获取 nohup.out
tar zxvf filebeat-5.2.1-linux-x86_64.tar.gz
配置:
[root@4e07f322e28f ~]# cat filebeat-5.2.1-linux-x86_64/filebeat.yml
#filebeat.prospectors:
#- input_type: log
# paths:
# - /root/logstash-tutorial.log
#output.logstash:
# hosts: ["192.168.36.150:5043"]
filebeat.prospectors:
- input_type: log
paths:
- /root/nohup.out
# - /var/log/secure
# - /var/log/messages
# - /var/log/*.log
fields:
type: syslog
output.logstash:
hosts: ["192.168.36.141:5043"]
[root@4e07f322e28f ~]#
启动filebeat:./filebeat-5.2.1-linux-x86_64/filebeat -e -c filebeat-5.2.1-linux-x86_64/filebeat.yml -d "publish"
安装logstach:
tar zxvf logstash-5.2.1.tar.gz
配置pip:
[root@node logstash-5.2.1]# cat first-pipline.conf
input {
beats {
port => 5043
# ssl => true
# ssl_certificate => "/etc/pki/tls/certs/logstash-forwarder.crt"
# ssl_key => "/etc/pki/tls/private/logstash-forwarder.key"
}
}
filter {
if [type] == "syslog" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
syslog_pri { }
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
}
output {
elasticsearch {
hosts => ["192.168.36.141:9200"]
sniffing => true
manage_template => false
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
}
}
启动起来:
./bin/logstash -f first-pipline.conf --config.reload.automatic
最后在kibana上面建一个索引:
好了数据出来了:

安装一个elasticsearch-head:
这里下载:https://github.com/mobz/elasticsearch-head
1050 unzip elasticsearch-head-master.zip
1051 wget https://nodejs.org/dist/v5.10.1/node-v5.10.1-linux-x64.tar.gz
1052 tar zxvf node-v5.10.1-linux-x64.tar.gz
1053 ln -s /root/node-v5.10.1-linux-x64/bin/node /usr/local/bin/node
1054 ln -s /root/node-v5.10.1-linux-x64/bin/npm /usr/local/bin/npm
1055 cd elasticsearch-head-master
1056 npm install
1057 npm install -g cnpm --registry=https://registry.npm.taobao.org
1058 su es
1059 ll
1060 vi Gruntfile.js
1061 npm install -g grunt--registry=https://registry.npm.taobao.org
1062 npm install
cat _site/app.js
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.36.141:9200";
cat Gruntfile.js:
server: {
options: {
hostname: '192.168.36.141',
port: 9100,
base: '.',
keepalive: true
1063 cd node_modules/
1064 cd grunt
1065 cd bin/
1066 ./grunt server

OK!!!!!
---------------我是有底线的--------------------
作者:jt
出处:http://www.cnblogs.com/Jt00/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
如果文中有什么错误,欢迎指出。以免更多的人被误导。
elk,centos7,filebeat,elasticsearch-head详细安装步骤的更多相关文章
- Linux详细安装步骤
Linux详细安装步骤(CentOS_6.7_64位) 1.先安装好VMware10软件 2.验证VM是否安装成功: (有些机器在安装vmware的时候会出现一个错误:virtual XT,这需要重启 ...
- LAMP----linux+apache+mysql+php详细安装步骤之一APACHE篇(openldap等)
LAMP----linux+apache+mysql+php详细安装步骤之一APACHE篇(openldap等) linux详细版本为RHEL5.3 [root@localhost mail]# un ...
- Hadoop HA(高可用) 详细安装步骤
什么是HA? HA是High Availability的简写,即高可用,指当当前工作中的机器宕机后,会自动处理这个异常,并将工作无缝地转移到其他备用机器上去,以来保证服务的高可用.(简言之,有两台机器 ...
- Windows下Oracle安装图解----oracle-win-64-11g 详细安装步骤
一. Oracle 下载 官方下地址 http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.htm ...
- Anaconda的详细安装步骤图文并茂
Anaconda(官方网站)就是可以便捷获取包且对包能够进行管理,同时对环境可以统一管理的发行版本.Anaconda包含了conda.Python在内的超过180个科学包及其依赖项. 事实上Anaco ...
- --nodejs详细安装步骤
什么是nodejs? 脚本语言需要一个解析器才能运行,JavaScript是脚本语言,在不同的位置有不一样的解析器,如写入html的js语言,浏览器是它的解析器角色.而对于需要独立运行的JS,node ...
- Oracle(11g)详细安装步骤
最详细的Oracle安装步骤就在这里,话不多说直接给大家上安装Oracle的详细教程 如果没有安装包,可以先点击下载下载地址:http://download.oracle.com/otn/nt/o ...
- 如何搭建SVN服务器,详细安装步骤。
SVN服务器端安装 下载: VisualSVN是一款图形化svn服务器.官网 http://www.visualsvn.com/server/ 下载地址: http://www.visualsvn.c ...
- SQL Server系列之SQL Server 2016 中文企业版详细安装步骤(超多图)
1. 下载地址 下载地址 :https://www.microsoft.com/en-us/server-cloud/products/sql-server-2016/ 官方技术文档:https:// ...
随机推荐
- 多线程编程之Apue3rd_Chapter11之互斥锁_读写锁_自旋锁
学习了apue3rd的第11章,主要讲的是多线程编程.因为线程共享进程的资源比如堆和全局变量,多线程编程最重要的是,使用各种锁进行线程同步. 线程编程首先要学习的三个函数如下: #include &l ...
- stm32+lwip(一):使用STM32CubeMX生成项目
我是卓波,很高兴你来看我的博客. 系列文章: stm32+lwip(一):使用STM32CubeMX生成项目 stm32+lwip(二):UDP测试 stm32+lwip(三):TCP测试 stm32 ...
- R语言学习笔记(七): 排序函数:sort(), rank(), order()
sort() sort()函数直接对函数进行排序,并返回排序结果. > a <- c(12,4,6,5) > sort(a) [1] 4 5 6 12 rank() rank()函数 ...
- grunt in webstorm
1.install grunt sudo npm install -g grunt-cli npm install grunt --save-dev
- 【Consul】Consul架构-Session会话
Consul提供session会话机制--可以用于构建分布式锁,session可以绑定到节点.健康检查.KV数据.目的是提供颗粒锁--受 The Chubby LockService for Loos ...
- 开源版本 hadoop-2.7.5 + apache-hive-2.1.1 + spark-2.3.0-bin-hadoop2.7整合使用
一,开源软件版本: hadoop版本 : hadoop-2.7.5 hive版本 :apache-hive-2.1.1 spark版本: spark-2.3.0-bin-hadoop2.7 各个版本到 ...
- C++基础语言知识大汇总(不断更新!!!)
经过十天的时间,LITTLESUN做好了前期的工作,今天LITTLESUN就要在新地图里扬帆起航喽!!!(撒花) 简单的整理了一下这次启航准备好的物资.后面的航程中也会不断来补充这个小仓库哦!
- 接口测试工具postman(一)下载安装说明
Postman是Google开发的一款功能强大的网页调试与发送网页HTTP请求,并能运行测试用例的的Chrome插件. 主要功能包括: 1.模拟各种HTTP requests 从常用的 GET.POS ...
- Jmeter和Charles下载文件
有时候我们jmeter做自动化测试是会遇到文件上传和文件下载的接口,这里我将接结合Charles来Jmeter 文件下载进行讲解 一.用Charles抓包分析文件下载接口 1.1.业务中文件下载链接如 ...
- Jmeter使用时异常问题解决
1.执行jmeter请求时,响应数据中出现乱码异常(如图) 解决方案: 打开E:\apache-jmeter-4\bin\jmeter.properries(jmeter安装目录),查找到语句行:#s ...