ELK6.6.0+filebeat6.6.0部署
elastic不能用root用户去启动,否则会报错,所以创建elastic用户ES集群部署
1.创建elastic用户
$ useradd elastic
$ passwd elastic
2..部署JDK环境
$ tar xvf jdk-8u191-linux-x64.tar.gz -C /usr/local/
$ mv /usr/local/jdk1.8.0_191/ /usr/local/java
$ vim /etc/profile.d/elk.sh
export JAVA_HOME=/usr/local/java
export PATH=$JAVA_HOME:$PATH
$ source /etc/profile
3.下载elastic源码包
$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.0.tar.gz
4.解压elastic
$ tar xvf elasticsearch-6.6.0.tar.gz -C /usr/local/
$ mv /usr/local/elasticsearch-6.6.0/ /usr/local/elastic
$ chown -R elastic /usr/local/elastic/
5.修改elastic内存配置
elasticsearch6.6.0默认内存需要1G,如果没有1G内存可能会报错,如果内存不够则需要修改配置文件
$ vim /usr/local/elastic/config/jvm.options
-Xms512m
-Xmx512m
6.修改elastic配置文件
$ mkdir /data/es-data -p
$ mkdir /var/log/elastic/
$ vim /usr/local/elastic/config/elasticsearch.yml
# 组名自定义,但是同一个组,组名必须一致
cluster.name: my-application
# 节点名称,建议和主机名一致
node.name: elastic
# 数据存放目录
path.data: /data/es-data
# 日志存放路径
path.logs: /var/log/elastic
# 锁住内存,bubei 使用到交换分区去
bootstrap.memory_lock: true
# 由于只部署两个节点,因此设置为1,否则当master宕机,将无法重新选取master
discovery.zen.minimum_master_nodes: 1
# 网络设置
network.host: 0.0.0.0
# 端口
http.port: 9200
# 从节点配置
# 关闭多播
discovery.zen.ping.unicast.enabled: false
# 发单播,ip地址是master和自己
discovery.zen.ping.unicast.hosts: ["192.168.1.131", "192.168.1.164"]
6.启动elastic
$ chown -R elastic /data/
$ chown -R elastic /var/log/elastic/
$ su - elastic
$ /usr/local/elastic/bin/elasticsearch
7.测试

8.报错

[1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
#切换回root
$ vim /etc/security/limits.conf
# elastic是用户
elastic soft nofile 65536
elastic hard nofile 65536
# 登录elastic查看
$ ulimit -Hn
65536
[2]: memory locking requested for elasticsearch process but memory is not locked
$ vim /etc/security/limits.conf
elastic - memlock unlimited
[3]: max number of threads [3802] for user [elastic] is too low, increase to at least [4096]
$ vim /etc/security/limits.d/20-nproc.conf
elastic - nproc 4096
[4]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
$ vim /etc/sysctl.conf
vm.max_map_count=655360
$ sysctl -p
插件安装
elastic5.0之后,head插件需要独立安装
1.head插件
# 安装NodeJS
$ wget https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.5.0-linux-x64.tar.gz
$ tar -zxvf node-v4.5.0-linux-x64.tar.gz -C /usr/local/
$ mv /usr/local/nodenode-v4.5.0-linux-x64 /usr/local/node
$ vim /etc/profile
export NODE_HOME=/usr/local/node
export PATH=$PATH:$NODE_HOME/bin/
export NODE_PATH=$NODE_HOME/lib/node_modules
$ source /etc/profile
# 安装npm
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
# 安装grunt
$ npm install -g grunt
$ npm install -g grunt-cli --registry=https://registry.npm.taobao.org --no-proxy
# 确认版本
node -v
v9.5.0
$ npm -v
5.6.0
$ grunt -version
grunt-cli v1.3.2
grunt v1.0.1
$ wget https://github.com/mobz/elasticsearch-head/archive/master.zip
$ unzip master.zip
$ cd elasticsearch-head-master/
# npm install -g cnpm --registry=https://registry.npm.taobao.org
$ npm install
# 修改es的配置文件
# head插件可以访问es
$ vim /usr/local/elasticsearch-6.6.0/config/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: "*"
# 修改head插件配置文件
$ vim Gruntfile.js
# 增加一行hostname
connect: {
server: {
options: {
hostname: '0.0.0.0',
port: 9100,
base: '.',
keepalive: true
}
}
}
$ vim elasticsearch-head-master/_site/app.js
# 修改localhost为es的ip地址
# this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.1.126:9200";
# 重启es
$ grunt server

Filebeat+Logstash部署
1.Filebeat部署
a.下载filebeat源码包
$ wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.6.0-linux-x86_64.tar.gz
b.解压源码包
$ tar xvf filebeat-6.6.0-linux-x86_64.tar.gz -C /usr/local/
$ mv /usr/local/filebeat-6.6.0-linux-x86_64/ /usr/local/filebeat
c.修改配置文件
$ vim /usr/local/filebeat/filebeat.yml
#=========================== Filebeat inputs =============================
filebeat.inputs:
- type: log
# Change to true to enable this input configuration.
enabled: true
# Paths that should be crawled and fetched. Glob based paths.
# 指定读取文件的位置
paths:
- /var/log/*.log
# 只发送包含ERR,WARN字样的日志
# include_lines: ['^ERR', '^WARN']
# 不发送包含OK字样的日志
# exclude_lines: ["^OK"]
# 定义写到ES时的type值
# document_type: "test"
# 输出的位置,直接输出到elastic的话,选第一个,输出到logstash的话,选第二个
#output.elasticsearch:
# Array of hosts to connect to.
#hosts: ["localhost:9200"] output.logstash:
# The Logstash hosts
hosts: ["localhost:5044"]
d.启动filebeat
$ vim /etc/profile.d/elk.sh
export PATH=$PATH:/usr/local/filebeat/
$ source /etc/profile
$ filebeat -e -c /usr/local/filebeat/filebeat.yml
2.Logstash部署
a.部署JDK环境
$ tar xvf jdk-8u191-linux-x64.tar.gz -C /usr/local/
$ mv /usr/local/jdk1.8.0_191/ /usr/local/java
$ vim /etc/profile.d/elk.sh
export JAVA_HOME=/usr/local/java
export PATH=$JAVA_HOME:$PATH:/usr/local/filebeat/
$ source /etc/profile
b.下载Logstash源码包
$ wget https://artifacts.elastic.co/downloads/logstash/logstash-6.6.0.tar.gz
c.解压源码包
$ tar xvf logstash-6.6.0.tar.gz -C /usr/local/
$ mv /usr/local/logstash-6.6.0/ /usr/local/logstash
d.修改配置文件
input {
beats {
port => 5044
}
}
output {
stdout {
codec => rubydebug
}
elasticsearch {
hosts => ["http://192.168.1.126:9200"]
index => "test"
}
}
Kibana部署
1. 下载Kibana
$ wget https://artifacts.elastic.co/downloads/kibana/kibana-6.6.0-linux-x86_64.tar.gz
2. 解压源码包
$ tar xvf kibana-6.6.0-linux-x86_64.tar.gz -C /usr/local/
$ mv /usr/local/kibana-6.6.0-linux-x86_64/ /usr/local/kibana
3. 修改配置文件
$ vim /usr/local/kibana/config/kibana.yml
server.host: "192.168.1.130"
elasticsearch.hosts: ["http://192.168.1.126:9200"]
4.启动Kibana
$ /usr/local/kibana/bin/kibana
访问 192.168.1.130:5601

PS:如有错误,欢迎指正
ELK6.6.0+filebeat6.6.0部署的更多相关文章
- centos7.2环境elasticsearch-5.0.1+kibana-5.0.1+zookeeper3.4.6+kafka_2.9.2-0.8.2.1部署详解
centos7.2环境elasticsearch-5.0.1+kibana-5.0.1+zookeeper3.4.6+kafka_2.9.2-0.8.2.1部署详解 环境准备: 操作系统:centos ...
- Flume1.5.0的安装、部署、简单应用(含伪分布式、与hadoop2.2.0、hbase0.96的案例)
目录: 一.什么是Flume? 1)flume的特点 2)flume的可靠性 3)flume的可恢复性 4)flume 的 一些核心概念 二.flume的官方网站在哪里? 三.在哪里下载? 四.如何安 ...
- redis3.0.5集群部署安装详细步骤
Redis集群部署文档(centos6系统) (要让集群正常工作至少需要3个主节点,在这里我们要创建6个redis节点,其中三个为主节点,三个为从节点,对应的redis节点的ip和端口对应关系如下) ...
- Tomcat7 + JRebel6.3.0 + IntelliJ idea 热部署配置过程+错误分析
以前使用Tomcat的时候直接就可以热部署,现在换了一个使用Spring框架的项目突然就不能热部署了. 网上说在tomcat里conf/context.xml中加入 <Context antiJ ...
- Ubuntu & GitLab CI & Docker & ASP.NET Core 2.0 自动化发布和部署(1)
相关博文: Ubuntu 简单安装和配置 GitLab Ubuntu 简单安装 Docker Ubuntu Docker 简单安装 GitLab Ubuntu Docker 安装和配置 GitLab ...
- Ubuntu & GitLab CI & Docker & ASP.NET Core 2.0 自动化发布和部署(2)
上一篇:Ubuntu & GitLab CI & Docker & ASP.NET Core 2.0 自动化发布和部署(1) 服务器版本 Ubuntu 16.04 LTS. 本 ...
- Fabric 1.0的多机部署
Fabric1.0已经正式发布一段时间了,官方给出的单机部署的脚本也很完备,基本上傻瓜式的一键部署,直接运行官方的network_setup.sh up即可.但是在实际生产环境,我们不可能把所有的节点 ...
- redis3.0.7集群部署手册
1.用root登录主机2.将redis-3.0.7.tar.gz传送到主机3.将rubygems-update-2.5.2.gem,redis-3.0.0.gem传送到主机4.解压redis-3.0. ...
- Solr 5.5.0 + tomcat 7.0.69 + zookeeper-3.4.6 Cloud部署
Solr介绍:Solr是一个独立的企业级搜索应用服务器,Solr基于Lucene的全文搜索服务器,同时对其进行了扩展,提供了比Lucene更为丰富的查询语言,同时实现了可配置.可扩展并对查询性能进行了 ...
随机推荐
- 学习MySQL过程中的随笔一
第一天: 关于安装出现了很多问题,各种不懂的bug,没得法只能在网上查找解决方法,终于!!! 登录成功了,一下午的时间 附上参考资料:https://blog.csdn.net/weibo_boer/ ...
- windows下安装配置postgreSQL
1.下载 postgresql-10.4-1-windows-x64.exe 进行安装 2.环境配置(1)文本使用的IDE是VS2010,我们需要配置包含目录(include).库目录(lib).链接 ...
- Xgboost总结
从决策树.随机森林.GBDT最终到XGBoost,每个热门算法都不是孤立存在的,而是基于一系列算法的改进与优化.决策树算法简单易懂可解释性强,但是过拟合风险很大,应用场景有限:随机森林采用Baggin ...
- ElasticSearch 随笔
1.如何用亚马逊S3存储一个ES服务索引.http://t.cn/R0fAJwK 2.ELK实战 - 利用Nginx日志分析API耗时.http://t.cn/R6sgQfU 3.Kibana中的地 ...
- Docker入门详解(转载)
来源 http://dockone.io http://dockone.io/article/6051 Docker是世界领先的软件容器平台,所以想要搞懂Docker的概念我们必须先从容器开始说起. ...
- ASP.NET gridview导出excel,防止繁体产生有乱码的方式
//1.先引用比如 : using System; using System.Collections.Generic; using System.Linq; using System.Web; usi ...
- [CentOS] rsync同步目录进行备份文件
操作不难,网上一堆.这里列几个 CentOS7 参考地址: https://www.server-world.info/en/note?os=CentOS_7&p=rsync Copy fil ...
- zipCrack-v1.1 工具介绍
一个暴力破解zip的工具 用python开发 与kali 自带的fcrackzip类似 git地址:https://github.com/mapyJJJ/python3-for-linux-h-.gi ...
- Linux常用操作指令(面试专用)
Linux:免费开源,多用户多任务,衍生出很多附属版本,例如常用的RedHat... 常用指令 ls 显示文件或目录 -l 列出文件详细信息l(list) -a ...
- 福州大学软件工程1916|W班 第2次作业成绩排名
作业链接: 结对第一次-原型设计(文献摘要热词统计) 评分准则: 本次作业评分分为两部分,一部分是博客分数(满分25分),另一部分是工程能力分数(满分30分). 博客分数评分标准: 1.在随笔开头请加 ...