环境:Centos7, jdk1.8

安装logstash

1.下载logstash

地址:https://artifacts.elastic.co/downloads/logstash/logstash-7.0.0.tar.gz

2.解压logstash压缩包

tar zxvf logstash-7.0.0.tar.gz

3.config文件夹下创建配置文件

vim logstash-elasticsearch.conf

添加以下内容:

input {
  # For detail config for log4j as input,
  # See: https://www.elastic.co/guide/en/logstash/current/plugins-inputs-log4j.html
  tcp {
    mode => "server"
    host => "0.0.0.0"
    port => 9000
    codec => json_lines
  }
}
filter {
  #Only matched data are send to output.
}
output {
  # For detail config for elasticsearch as output,
  # See: https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html
  elasticsearch {
    action => "index" #The operation on ES
    hosts => ["localhost:9200"] #ElasticSearch host, can be array.
    index => "demolog" #The index to write data to.
  }
}

4.后台启动logstash

./bin/logstash -f config/logstash-elasticsearch.conf &

安装elasticsearch

1.下载elasticsearch

地址:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.0-linux-x86_64.tar.gz

2.解压elasticsearch压缩包

tar zxvf elasticsearch-7.0.0-linux-x86_64.tar.gz

3.修改elasticsearch.yml

启用以下配置

cluster.name: demo-cluster

node.name: node-1

path.data: /tmp/soft/elasticsearch-7.0.0/data

path.logs: /tmp/soft/elasticsearch-7.0.0/logs

network.host: 0.0.0.0

http.port: 9200

discovery.seed_hosts: ["127.0.0.1"]

cluster.initial_master_nodes: ["node-1"]

gateway.recover_after_nodes: 1

action.destructive_requires_name: true

4.创建组

groupadd elasticsearch

注:elasticsearch为组名

5.创建用户

useradd  elasticsearch -g elasticsearch -p elasticsearch

注:第一个elasticsearch为用户名,第二个elasticsearch为组名,第三个elasticsearch为用户密码

6.目录授权

chown -R elasticsearch:elasticsearch /tmp/soft/elasticsearch-7.0.0

7.修改/etc/security/limits.conf

在文件末尾加入以下配置信息

* soft nofile 65536
* hard nofile 131072
* soft nproc 65536
* hard nproc 131072
* soft memlock unlimited
* hard memlock unlimited

8.修改/etc/sysctl.conf

在文件末尾加入以下配置信息

vm.max_map_count=655360

然后执行sysctl -p

9.添加elasticsearch到systemctl

在/etc/systemd/system下创建elasticsearch.sevice, 添加以下内容

[Unit]
Description=elasticsearch.service
After=network.target

[Service]
LimitCORE=infinity
LimitNOFILE=65536
LimitNPROC=65536
Group=elasticsearch
User=elasticsearch
Environment=JAVA_HOME=/tmp/soft/jdk1.8.0_211
ExecStart=/tmp/soft/elasticsearch-7.0.0/bin/elasticsearch

[Install]
WantedBy=multi-user.target

10.启动elasticsearch

设置开机启动   systemctl enable elasticsearch

启动elasticsearch   systemctl start elasticsearch

查看elasticsearch状态   systemctl status elasticsearch

停止elasticsearch     systemctl stop elasticsearch

11.防火墙设置

查看防火墙状态     firewall-cmd --state

关闭防火墙      systemctl stop firewalld.service

禁止防火墙开机启动     systemctl disable firewalld.service

12.验证是否启动成功

执行curl http://127.0.0.1:9200

返回以下信息表示启动成功

{
  "name" : "node-1",
  "cluster_name" : "demo-cluster",
  "cluster_uuid" : "v9x4jEImQQ6ralBh63jVTg",
  "version" : {
    "number" : "7.0.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "b7e28a7",
    "build_date" : "2019-04-05T22:55:32.697037Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.7.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

安装elasticsearch head

1.安装依赖

yum install epel-release

yum install nodejs npm

yum install -y git

2.下载elasticsearch-head

git clone git://github.com/mobz/elasticsearch-head.git

3.安装

进入elasticsearch head目录后执行npm install进行安装

4.配置elasticsearch.yml

在elasticsearch.yml配置文件末尾加入以下配置

http.cors.enabled: true

http.cors.allow-origin: "*"

5.修改elasticsearch-head/Gruntfile.js

connect: {
  server: {
    options: {
      port: 9100,
      base: '.',
      keepalive: true
    }
  }
}

修改为

connect: {
  server: {
    options: {
      hostname: '0.0.0.0',
      port: 9100,
      base: '.',
      keepalive: true
    }
  }
}

6.修改elasticsearch-head/_site/app.js

this.base_uri = this.config.base_uri;

修改为

this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://172.29.22.151:9200";

注:172.29.22.151:9200为elasticsearch的访问地址

7.启动

后台启动   npm run start &

8.连接elasticsearch

在浏览器输入elasticsearch head的访问地址(我的elasticsearch和elasticsearch head安装在同一台服务器):http://172.29.22.151:9100

在打开的界面是中输入elasticsearch的访问地址:http://172.29.22.151:9200 后点击连接即可连接到elasticsearch

安装kibana

1.下载kibana

地址:https://artifacts.elastic.co/downloads/kibana/kibana-7.0.0-linux-x86_64.tar.gz

2.解压kibana压缩包

tar zxvf kibana-7.0.0-linux-x86_64.tar.gz

3.修改config/kibana.yml

启用以下配置:

# 172.29.22.151为本机IP地址

server.host: "172.29.22.151"

# http://172.29.22.151:9200为elasticsearch服务地址

elasticsearch.hosts: ["http://172.29.22.151:9200"]

4.后台启动kibana

./bin/kibana &

Centos7安装elasticsearch、logstash、kibana、elasticsearch head的更多相关文章

  1. ELk(Elasticsearch, Logstash, Kibana)的安装配置

    目录 ELk(Elasticsearch, Logstash, Kibana)的安装配置 1. Elasticsearch的安装-官网 2. Kibana的安装配置-官网 3. Logstash的安装 ...

  2. ELKF安装使用教程。elasticsearch+logstash+kibana+filebeta。

    近期因工作需要学习了ELKF的安装和使用.网络上的中文我看大部分也比较老版本了,我想写一下,希望能给他人带来一点帮助.小弟不才,有错位之处,还请大家原谅指点. ELKF就是:elasticsearch ...

  3. 安装logstash+kibana+elasticsearch+redis搭建集中式日志分析平台

    安装logstash+kibana+elasticsearch+redis搭建集中式日志分析平台 2014-01-16 19:40:57|  分类: logstash |  标签:logstash   ...

  4. 基于CentOS6.5或Ubuntu14.04下Suricata里搭配安装 ELK (elasticsearch, logstash, kibana)(图文详解)

    前期博客 基于CentOS6.5下Suricata(一款高性能的网络IDS.IPS和网络安全监控引擎)的搭建(图文详解)(博主推荐) 基于Ubuntu14.04下Suricata(一款高性能的网络ID ...

  5. ELK日志系统:Elasticsearch+Logstash+Kibana+Filebeat搭建教程

    ELK日志系统:Elasticsearch + Logstash + Kibana 搭建教程 系统架构 安装配置JDK环境 JDK安装(不能安装JRE) JDK下载地址:http://www.orac ...

  6. ELK6.0部署:Elasticsearch+Logstash+Kibana搭建分布式日志平台

    一.前言 1.ELK简介 ELK是Elasticsearch+Logstash+Kibana的简称 ElasticSearch是一个基于Lucene的分布式全文搜索引擎,提供 RESTful API进 ...

  7. Elasticsearch+Logstash+Kibana搭建分布式日志平台

    一.前言 编译安装 1.ELK简介 下载相关安装包地址:https://www.elastic.co/cn/downloads ELK是Elasticsearch+Logstash+Kibana的简称 ...

  8. 【linux】【ELK】搭建Elasticsearch+Logstash+Kibana+Filebeat日志收集系统

    前言 ELK是Elasticsearch.Logstash.Kibana的简称,这三者是核心套件,但并非全部. Elasticsearch是实时全文搜索和分析引擎,提供搜集.分析.存储数据三大功能:是 ...

  9. 【转】ELK(ElasticSearch, Logstash, Kibana)搭建实时日志分析平台

    [转自]https://my.oschina.net/itblog/blog/547250 摘要: 前段时间研究的Log4j+Kafka中,有人建议把Kafka收集到的日志存放于ES(ElasticS ...

  10. 使用ELK(Elasticsearch + Logstash + Kibana) 搭建日志集中分析平台实践--转载

    原文地址:https://wsgzao.github.io/post/elk/ 另外可以参考:https://www.digitalocean.com/community/tutorials/how- ...

随机推荐

  1. CSS属性display的浅略探讨

    display 的属性值有:none|inline|block|inline-block|list-item|run-in|table|inline-table|table-row-group|tab ...

  2. ArcGIS10.3+Oracle12C+ArcGIS Server10.3安装布署(之一)

    1.安装Oracle12C 2.配置Oracle12C的PDB监听(1)原始listener.ora文件 改为: (2)原始tnsnames.ora文件 改为: 3.连接Oracle12C的PDB数据 ...

  3. 对抗网络GAN的应用实例

      https://sigmoidal.io/beginners-review-of-gan-architectures/ 嗨,大家好!像许多追随AI进展的人一样,我无法忽略生成建模的最新进展,尤其是 ...

  4. Difference between ReLU、LReLU、PReLU、CReLU、ELU、SELU

    激活函数 ReLU.LReLU.PReLU.CReLU.ELU.SELU  的定义和区别 ReLU tensorflow中:tf.nn.relu(features, name=None) LReLU ...

  5. Android设置日期DatePickerDialog

    设置日期DatePickerDialog package com.example.testview; import java.util.Calendar; import java.util.Date; ...

  6. spring boot(10)-tomcat jdbc连接池

    默认连接池 tomcat jdbc是从tomcat7开始推出的一个连接池,相比老的dbcp连接池要优秀很多.spring boot将tomcat jdbc作为默认的连接池,只要在pom.xml中引入了 ...

  7. -webkit-min-device-pixel-ratio: 2是什么意思?

    DPI(DPR) stands for Dots Per Inch which technically means printer dots per inch. 这个参数实际上量化了屏幕的物理分辨率和 ...

  8. 【Redis】命令学习笔记——哈希(hash)(15个超全字典版)

    本篇基于redis 4.0.11版本,学习哈希(hash)相关命令. hash 是一个string类型的field和value的映射表,特别适合用于存储对象. 序号 命令 描述 实例 返回 HSET ...

  9. Oracle 补丁那些事儿(PS、PSU、CPU、SPU、BP、DBBP…)

    当前ORACLE数据库提供两种方式的补丁一种是主动的Proactive Patches和另一种被动的Reactive Patches,其中Reactive Patches是指过去的ONE-OFF Pa ...

  10. [翻译] BTSimpleRippleButton

    BTSimpleRippleButton https://github.com/balram3429/btSimpleRippleButton This is a custom button for ...