CentOS 7安装Elasticsearch和Kibana


之前使用es,都是直接在Windows操作,因为安装特别简单,这次向深入学习下ES,没想到Linux的安装这么多报错,记录下

一、安装Elasticsearch

参考博客:https://blog.csdn.net/widely5201/article/details/104359871

1、解压压缩包Elasticsearch:

[root@localhost ~]# cd /opt
[root@localhost opt]# tar -zvxf elasticsearch-6.5.4.tar.gz 
[root@localhost bin]# ./elasticsearch

报错:

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 986513408 bytes for committing reserved memory.
# An error report file with more information is saved as:
# logs/hs_err_pid24562.log

2、修改config下面的jvm.options

-Xms512m
-Xmx512m

3、修改配置文件elasticsearch.yml

network.host: 0.0.0.0
http.port: 9200

4、启动:

[root@localhost bin]# ./elasticsearch

报错:

can not run elasticsearch as root

5、创建用户和用户组

[root@localhost elasticsearch-6.5.4]# adduser es
[root@localhost elasticsearch-6.5.4]# passwd es
更改用户 es 的密码 。
新的 密码:
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
[root@localhost elasticsearch-6.5.4]# chown es /opt/elasticsearch-6.5.4/ -R
[root@localhost elasticsearch-6.5.4]# chown -R es:es /opt/elasticsearch-6.5.4/

6、vi /etc/security/limits.conf:添加

es soft nofile 65536
es hard nofile 65536
es soft nproc 4096
es hard nproc 4096

7、 vi /etc/security/limits.d/20-nproc.conf,将* 改为用户名(es)

[root@localhost elasticsearch-6.5.4]# vi /etc/security/limits.d/20-nproc.conf

8、vi /etc/sysctl.conf,添加

vm.max_map_count = 655360

9、让配置文件生效

[root@localhost elasticsearch-6.5.4]# sysctl -p

10、重启elasticsearch:成功

[esuser@localhost elasticsearch-6.5.4]$ ./bin/elasticsearch

11、浏览器远程访问:

在这里插入图片描述

二、安装kibana

参考博客:https://www.cnblogs.com/nijunyang/p/12541542.html

参考博客:https://www.cnblogs.com/gwyy/p/12205250.html

1、解压压缩包:在/opt目录下

2、vi config/kibana.yml

server.port: 5601    端口
server.host: "0.0.0.0" 开放外网访问
elasticsearch.url: "http://192.168.157.130:9200" es的服务器

3、启动:

nohup ./bin/kibana &

在这里插入图片描述

三、IK分词器

1、下载压缩包:https://github.com/medcl/elasticsearch-analysis-ik/releases?after=v6.8.2

2、在plugins目录下创建IK,然后把解压的文件放进去即可

3、重启ES
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我一直在流浪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值