elk单机安装部署

es 下载地址:wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.1.0-linux-x86_64.tar.gz

kibana下载地址:wget https://artifacts.elastic.co/downloads/kibana/kibana-7.1.0-linux-x86_64.tar.gz

logstash下载地址: wget https://artifacts.elastic.co/downloads/logstash/logstash-7.1.0.tar.gz

解压

1
tar xf elasticsearch-7.1.0-linux-x86_64.tar.gz -C /data/

  配置

1
2
3
4
5
6
7
8
9
10
11
12
[root@es ~]# vim  /etc/security/limits.conf
 
* soft nofile 65536
* hard nofile 65536
 [root@es ~]# vim  /etc/sysctl.conf
vm.max_map_count=655360
 
[root@es ~]# vim /etc/security/limits.d/20-nproc.conf
 
 
*          soft    nproc     4096
root       soft    nproc     unlimited

  添加环境变量

1
2
3
[root@es ~]# vim  /etc/profile.d/es.sh
 
PATH=/data/elasticsearch-7.1.0/bin/:$PATH

  创建普通用户授权并启动

1
2
3
4
5
useradd es
chown es:es /data -R
sysctl -p
su es
elasticsearch -d  后台启动

    查看es已安装的插件

1
[es@zk ~]$ elasticsearch-plugin list

 es安装插件操作;国际分词插件

1
2
3
4
5
6
7
8
9
10
11
[es@zk ~]$ elasticsearch-plugin install analysis-icu
-> Downloading analysis-icu from elastic
[=================================================] 100%  
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.bouncycastle.jcajce.provider.drbg.DRBG (file:/data/elasticsearch-7.1.0/lib/tools/plugin-cli/bcprov-jdk15on-1.61.jar) to constructor sun.security.provider.Sun()
WARNING: Please consider reporting this to the maintainers of org.bouncycastle.jcajce.provider.drbg.DRBG
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
-> Installed analysis-icu
[es@zk ~]$ elasticsearch-plugin list
analysis-icu

  

 kibana的解压

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
tar xf kibana-7.1.0-linux-x86_64.tar.gz -C /usr/local/ 解压
 cd /usr/local/kibana-7.1.0-linux-x86_64/config/
[root@es config]# vim kibana.yml
 
# Kibana is served by a back end server. This setting specifies the port to use.
#server.port: 5601
 
# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "192.168.183.8"# 修改监听的地址默认locathost
[root@es config]# vim /etc/profile.d/kibana.sh
export PATH=/usr/local/kibana-7.1.0-linux-x86_64/bin/:$PATH  #添加环境变量
 
[root@es config]# exec bash #使其在当前shll生效
 
[root@es config]# kibana   # 前台启动

  测试数据下载地址:https://grouplens.org/datasets/movielens/

       logstash 的安装与导入数据

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
tar xf logstash-7.1.0.tar.gz -C /usr/local/
cp movies.csv /usr/local/logstash-7.1.0/bin/
 cp logstash.conf /usr/local/logstash-7.1.0/config/
# cat logstash.conf
input {
  file {
    path => "/Users/yiruan/dev/elk7/logstash-7.0.1/bin/movies.csv"
    start_position => "beginning"
    sincedb_path => "/dev/null"
  }
}
filter {
  csv {
    separator => ","
    columns => ["id","content","genre"]
  }
 
  mutate {
    split => { "genre" => "|" }
    remove_field => ["path", "host","@timestamp","message"]
  }
 
  mutate {
 
    split => ["content", "("]
    add_field => { "title" => "%{[content][0]}"}
    add_field => { "year" => "%{[content][1]}"}
  }
 
#  mutate {
 
#    gsub => [
#     
#      "year", "\\)", ""
#    ]
#  }
 
 
  mutate {
    convert => {
      "year" => "integer"
    }
    strip => ["title"]
    remove_field => ["path", "host","@timestamp","message","content"]
  }
 
 
 
}
output {
   elasticsearch {
     hosts => "http://localhost:9200"
     index => "movies"
     document_id => "%{id}"
   }
  stdout {}
}
[root@es ~]# vim /etc/profile.d/logstash.sh
export PATH=/usr/local/logstash-7.1.0/bin:$PATH  添加环境变量
[root@es ~]# exec bash
[root@es config]# ../bin/logstash -f logstash.conf 启动

 浏览器查看节点   IP:9200/_cat/nodes

  

 

posted @   烟雨楼台,行云流水  阅读(1123)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
点击右上角即可分享
微信分享提示