CentOS 7 安装指定版本 ELK6.2.4
Centos7安装ELK
操作系统及各组件版本
centos-7-x86_64
jdk-8
elasticsearch-6.2.4
logstash-6.2.4
kibana-6.2.4
1、禁用SELinux
永久关闭更改配置文件
vim /etc/selinux/config
2、安装jdk
tar xf jdk-8u181-linux-x64.tar.gz -C /usr/local/
vim /etc/profile 写入下面的内容
. /etc/profile 使其配置文件生效
java -verison 查看是否安装成功
3、安装elasticsearch logstash kibana
导入秘钥 rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
下载 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.rpm
安装 rpm -ivh elasticsearch-6.2.4.rpm
安装 rpm -ivh kibana-6.2.4-x86_64.rpm
安装 rpm -ivh logstash-6.2.4.rpm
mkdir -pv /esdata/elasticsearch/{data,logs}
mkdir -pv /esdata/logstash/{data,logs}
chown -R elasticsearch.elasticsearch /esdata/elasticsearch/
chown -R logstash.logstash /esdata/logstash/
修改es配置文件
vim /etc/elasticsearch/elasticsearch.yml
vim /etc/logstash/logstash.yml
vim /etc/kibana/kibana.yml
4、安装nginx
安装epel源 yum -y install epel-release
安装nginx和http用户认证工具 yum -y install nginx httpd-tools
安装完成后配置nginx
vim /etc/nginx/nginx.conf
把location这段注释掉
location / {
}
vim /etc/nginx/conf.d/kibana.conf #添加如下内容
server {
listen 80;
server_name kibana;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/kibana-user;
location / {
proxy_pass http://192.168.10.195:5601;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
生成http用户认证文件,生成文件kibana-user,并添加用户infohold
htpasswd -cm /etc/nginx/kibana-user infohold
5、启动ELK和nginx
systemctl daemon-reload #重新加载所有配置文件
systemctl start elasticsearch logstash kibana nginx #启动ELK和nginx
systemctl enable elasticsearch logstash kibana nginx #将ELK和nginx加入开机启动
systemctl status elasticsearch logstash kibana nginx #查看ELK和nginx启动状态
查看端口是否已监听
6、查看elasticsearch状态
curl -XGET ‘http://192.168.10.225:9200/_cluster/state/nodes?pretty’
查看健康状态
curl -XGET ‘http://192.168.10.225:9200/_cat/health?v’
curl -XGET ‘http://192.168.10.225:9200/_cluster/health?pretty’
健康状态green(绿色)为最好
本文地址:https://blog.csdn.net/qq_42810635/article/details/107321552
上一篇: 招聘事件
下一篇: 16GB小米平板也能刷Win10了!
推荐阅读