20170603 ELK安装 (rpm包安装)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了20170603 ELK安装 (rpm包安装)相关的知识,希望对你有一定的参考价值。
ELK安装
环境安装:
(a)、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
(b)、iptables防火墙(这里iptables已经安装,下面进行配置)
vi/etc/sysconfig/iptables #编辑防火墙配置文件
1,elasticsearch
1),安装JDK
yum install java-1.8.0-openjdk -y
java -version ##查看版本
2),
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.0.rpm
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.1.rpm
3),yum localinstall elasticsearch-5.4.0.rpm
4),
sudo systemctl daemon-reload ##没有权限可以使用sudo刷新配置
sudo systemctl enable elasticsearch.service
sudo systemctl status elasticsearch.service
查看状态发现失败错误:服务会起不来,是node环境的问题,把之前的文件全部删掉,全新安装
[[email protected] local]# find / -name "elasticsearch" -exec rm -rf {} \;
rpm -qa |grep elasticsearch
rpm -e --nodeps elasticsearch-5.4.0-1
5),重新安装后再查看状态已经出来了:
6),查看端口
查看端口
[[email protected] tmp]# lsof -i:9200
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 3994 elasticsearch 112u IPv6 54287 0t0 TCP localhost:wap-wsp (LISTEN)
java 3994 elasticsearch 113u IPv6 54288 0t0 TCP localhost:wap-wsp (LISTEN)
端口没监听在ipv4上。
看来下官方文档, elasticsearch默认监听在localhost上,修改配置文件,把127.0.0.1改为本机ip
[[email protected] elasticsearch]# vim elasticsearch.yml
network.host: 10.0.2.15
使用curl访问下
[[email protected] elasticsearch]# curl 10.0.2.15:9200
{
"name" : "Bulldozer",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "2.2.1",
"build_hash" : "d045fc29d1932bce18b2e65ab8b297fbf6cd41a1",
"build_timestamp" : "2016-03-09T09:38:54Z",
"build_snapshot" : false,
"lucene_version" : "5.4.1"
},
"tagline" : "You Know, for Search"
}
使用浏览器访问
http://10.0.2.15:9200/
{
"name" : "Bulldozer",
"cluster_name" : "elasticsearch",
"version" : {
"number" : "2.2.1",
"build_hash" : "d045fc29d1932bce18b2e65ab8b297fbf6cd41a1",
"build_timestamp" : "2016-03-09T09:38:54Z",
"build_snapshot" : false,
"lucene_version" : "5.4.1"
},
"tagline" : "You Know, for Search"
}
7),修改IP和端口后浏览器查看能登入
Es常遇到的问题,
以上是关于20170603 ELK安装 (rpm包安装)的主要内容,如果未能解决你的问题,请参考以下文章