全文检索工具elasticsearch和kibana安装

一、安装elasticsearch

1、拷贝elasticsearch-5.6.4.rpm到/opt目录下「cenos7」

systemctl list-unit-files|grep elasticsearch

 2、启动之前为elasticsearch配置jdk

vim /etc/sysconfig/elasticsearch 中修改JAVA_HOME路径的路径

 3、启动elasticsearch

 4、修改内存

cd /etc/elasticsearch

 5、修改配置文件

vim /etc/elasticsearch/elasticsearch.yml

修改yml配置的注意事项:每行必须顶格,不能有空格

“:”后面必须有一个空格

集群名称,同一集群名称必须相同

 单个节点名称

网络部分  改为当前的ip地址  ,端口号保持默认9200就行

 把bootstrap自检程序关掉

bootstrap.system_call_filter: false

自发现配置:新节点向集群报到的主机名

 6、修改linux配置

为什么要修改linux配置?

默认elasticsearch是单机访问模式,就是只能自己访问自己。

但是我们之后一定会设置成允许应用服务器通过网络方式访问。这时,elasticsearch就会因为嫌弃单机版的低端默认配置而报错,甚至无法启动。

所以我们在这里就要把服务器的一些限制打开,能支持更多并发。

问题1max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] elasticsearch

原因:系统允许 Elasticsearch 打开的最大文件数需要修改成65536

解决:vi /etc/security/limits.conf

添加内容:

 * soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 65536

注意:“*” 不要省略掉

问题2max number of threads [1024] for user [judy2] likely too low, increase to at least [2048]  (CentOS7.x  不用改)

原因:允许最大进程数修该成2048

解决:vi /etc/security/limits.d/90-nproc.conf   

修改如下内容:

* soft nproc 1024

#修改为

 * soft nproc 2048 

问题3max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144] (CentOS7.x  不用改)

原因:一个进程可以拥有的虚拟内存区域的数量。

解决:可零时提高vm.max_map_count的大小

命令:sysctl -w vm.max_map_count=262144

 7、重启linux 

[root@centos147 ~]# curl http://192.168.67.147:9200

浏览器访问

  8、如果启动未成功

vim  /var/log/elasticsearch/my-es.log

二、安装kibana

1、拷贝kibana-5.6.4-linux-x86_64.tar 到/opt下

cp elasticsearch-analysis-ik-5.6.4.zip /usr/share/elasticsearch/plugins/

2、解压缩

unzip elasticsearch-analysis-ik-5.6.4.zip

3、进入kibana主目录的config目录下

4、编辑kibana.yml

vim  kibana.yml

 5、启动

  在 kibana主目录bin目录下执行

nohup  ./kibana  &

然后ctrl+c退出

执行ps -ef

启动失败,插件包没有删除

rm -rf elasticsearch-analysis-ik-5.6.4.zip

6、浏览器访问

http://192.168.xx.xx:5601/

GET _cluster/health

点击左边菜单DevTools 

在Console中 

执行 get _cluster/health    

右边的结果中,status为yellow或者green。

表示es启动正常,并且与kibana连接正常。

原文地址:https://www.cnblogs.com/minmin123/p/11444591.html