elk单机安装部署
2024-09-01 13:56:59
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
解压
tar xf elasticsearch-7.1.0-linux-x86_64.tar.gz -C /data/
配置
[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
添加环境变量
[root@es ~]# vim /etc/profile.d/es.sh PATH=/data/elasticsearch-7.1.0/bin/:$PATH
创建普通用户授权并启动
useradd es
chown es:es /data -R
sysctl -p
su es
elasticsearch -d 后台启动
查看es已安装的插件
[es@zk ~]$ elasticsearch-plugin list
es安装插件操作;国际分词插件
[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的解压
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 的安装与导入数据
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
最新文章
- ORACLE分区表梳理系列(一)- 分区表概述、分类、使用方法及注意事项
- (转)Redis使用场景及使用经验
- PHP判断文件夹是否存在和创建文件夹的方法(递归创建多级目录)
- mysql成绩排名
- python 自动发邮件 Errno61 Connection refused
- go语言中间的循环
- java计算过G文件md5 值计算
- data矩阵poj 2778 DNA Sequence
- HashMap 数组应用面试题(Point)
- Duplicate entry '0' for key 'PRIMARY'的一种可能的解决办法
- IFE第一天
- ansible 剧本
- 从运维角度来分析mysql数据库优化的一些关键点【转】
- 基于window 7安装ubuntu 18.04双系统
- WebSphere ILOG JRules 规则引擎运行模式简介
- JDBC异常
- docker 创建elasticsearch集群镜像
- 转:sock_ev——linux平台socket事件框架(基于字节流的测试程序) .
- sql 语句 查询两个字段都相同的方法
- 20145202马超《java》实验四