linux安装elk_centos[通俗易懂]

linux安装elk_centos[通俗易懂]1、下载地址:https://www.elastic.co/cn/downloads/elasticsearch$wgethttps://artifacts.elastic.co/downloads/elastic

ElasticSearch 安装

1、下载

地址:https://www.elastic.co/cn/downloads/elasticsearch
在这里插入图片描述$> wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.12.1-linux-x86_64.tar.gz

2、解压

$> tar -zxvf elasticsearch-7.12.1-linux-x86_64.tar.gz

在这里插入图片描述

3、JDK1.8 安装(…)

4、创建系统用户

elasticsearch不能以root权限来运行,会出现这种错误:Exception in thread “main” java.lang.RuntimeException: don’t run elasticsearch as root。

因为安全问题elasticsearch 不让用root用户直接运行,所以要创建新用户解决办法:

(1)创建用户
root$> adduser nn
(2)设置密码(连续输入两遍)
root$> passwd 123456 
(3)root 用户给新增的用户添加权限(root 用户创建的文件其他用户是无权操作的)
root$> chown -R nn /你的elasticsearch安装目录

5、启动ES(切换为普通用户启动)

# 切换用户
root$> su nn

# 启动ES
nn$> ./bin/elasticsearch

在这里插入图片描述

5、配置远程访问

修改 elasticsearch.yml

nn$>vim elasticsearch-7.12.1/config/elasticsearch.yml

# 加入以下配置
network.bind_host: 0.0.0.0
network.publish_host: elasticsearch所在的主机的ip
http.port: 9200

6、启动异常1

然后修改文件 /etc/sysctl.conf ,添加下面这个配置

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
vm.max_map_count = 655360

6.1、更新配置

root$> sysctl -p

8 、启动异常1

of [2]: max file descriptors [4096] for elasticsearch process is too low, in

解决:切换到root 用户

root$> vi /etc/security/limits.conf

//在文件末尾添加下面的参数值
* soft nofile 65536
* hard nofile 131072

9 、启动异常2

the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

解决:修改elasticsearch.yml

$> vim elasticsearch-7.12.1/config/elasticsearch.yml

# 加入以下配置
cluster.initial_master_nodes: ["node-1", "node-2"]

10、启动成功

在这里插入图片描述

10 、关闭防火墙

# 检查防火墙是否开启
root$> systemctl status firewalld

# 关闭防火墙
root$> systemctl stop firewalld

在这里插入图片描述在这里插入图片描述

Kibana 安装

1、下载

地址:https://www.elastic.co/cn/downloads/kibana
在这里插入图片描述

Linux 下载:

root$ > wget https://artifacts.elastic.co/downloads/kibana/kibana-7.12.1-linux-x86_64.tar.gz

Linux 解压:

root$ > tar -zxvf kibana-7.12.1-linux-x86_64.tar.gz

2、为普通用户添加权限

root$> chown -R nn ./kibana-7.12.1-linux-x86_64

3、配置远程访问

3.1 切换为 普通用户(nn)

root$> su nn

3.2 修改配置文件

nn$> vim kibana-7.12.1-linux-x86_64/config/kibana.yml

server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"] # 配置 ES 连接地址

![在这里插入图片描述](https://img-blog.csdnimg.cn/20210525094045732.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwMzA0ODc4,size_16,color_FFFFFF,t_7

4、启动服务

nn$> ./kibana-7.12.1-linux-x86_64/bin/kibana

访问:http://IP:5601
在这里插入图片描述

今天的文章linux安装elk_centos[通俗易懂]分享到此就结束了,感谢您的阅读。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/76460.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注