linux 下 ElasticSearch 和 Logstash 安装
安装环境基于CentOS 7.x
1、安装java 环境
安装java 8 参考:https://www.cnblogs.com/myibm/p/9232744.html
查看是否安装成功
[root@localhost ~]# java -version
openjdk version "1.8.0_312"
2、ElasticSearch 和 logstash 安装
获取密钥
[root@localhost ~]# rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
下载
ELK三个套件版本要一致,这里获取的是2021-12-16日最新版本的,如需更新的版本可以到官网下载 https://www.elastic.co/cn/downloads/
[root@localhost ~]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.16.1-x86_64.rpm
[root@localhost ~]# wget https://artifacts.elastic.co/downloads/logstash/logstash-7.16.1-x86_64.rpm
安装
[root@localhost ~]# rpm -ivh elasticsearch-7.16.1-x86_64.rpm
[root@localhost ~]# rpm -ivh logstash-7.16.1-x86_64.rpm
配置
[root@localhost ~]# vim /etc/elasticsearch/elasticsearch.yml
去掉,以下两行的注释
bootstrap.memory_lock: true
http.port: 9200
启动
[root@localhost ~]# systemctl daemon-reload [root@localhost ~]# systemctl enable elasticsearch [root@localhost ~]# systemctl start elasticsearch
[root@localhost ~]# systemctl enable logstash [root@localhost ~]# systemctl start logstash
[root@localhost ~]# netstat -plntu | grep 9200
最后一行是看elasticsearch 是否正常启动,如果没有还是没有启动,可以重启一下系统
至此 elasticsearch 和logstash 安装完成
下一篇:通过简单配置实现把mysql数据同步到es elasticsearch上的索引
参考:https://www.cnblogs.com/cheesebar/p/9126171.html#4973512