环境为阿里云Centos7
目前ES最新版本为6.5.4,kibana最新版本为6.5.4 安装ES必须配置JDK,不为什么,ESjava语言开发的
安装ES
Linux版本ES下载地址:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.5.4.tar.gz
- tar -zxvf elasticsearch-6.5.4.tar.gz -C /usr/local/
- cd /usr/local/elasticsearch-6.5.4/config/
- vim elasticsearch.yml
- network.host: 服务器内网IP
- http.port: 9200
- cd /usr/local/elasticsearch-6.5.4/bin
- ./elasticsearch
- 启动之后报错
启动报错遇到的问题:
1.不能使用root用户启动
- 创建一个分组
- groupadd elkgroup
- useradd elk -g elkgroup -p 123456
- 在es根目录上执行
- chown -R elk:elkgroup elasticsearch-6.5.4
- su elk 切换用户
继续启动继续报两个错:
- [1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
- vim /etc/security/limits.conf
- *也可换成elk用户
-
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
-
这个问题需要重启服务器
-
--------------------------------------------一道亮丽的风景线------------------------------------------------------------
-
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
-
vim /etc/sysctl.conf
-
vm.max_map_count=655360
-
sysctl -p
-
--------------------------------------------一道亮丽的风景线------------------------------------------------------------
-
如果第一次启动用root启动了,导致用root生成了对应的文件。切换es账号之后,没有对应文件的权限导致,删除相关的东西即可。
-
--------------------------------------------一道亮丽的风景线------------------------------------------------------------
-
重启之后启动es就没有问题
-
输入ip:端口进行访问,如图安装成功
安装kibana
下载地址:https://artifacts.elastic.co/downloads/kibana/kibana-6.5.4-linux-x86_64.tar.gz
安装:
- tar -zxvf kibana-6.5.4-linux-x86_64.tar.gz -C /usr/local/
- cd /usr/local/kibana-6.5.4-linux-x86_64/config/
- vim kibana.yml
- 将默认配置改成如下
- server.port: 5601
- server.host: "内网IP"
- elasticsearch.url: "http:// 外网IP:9200"
- 启动报错,错误如下
- 在vim kibana.yml文件中添加
- xpack.security.encryptionKey: "something_at_least_32_characters"
- --------------------------------------------一道亮丽的风景线------------------------------------------------------------
- 在vim kibana.yml文件中添加
- xpack.reporting.encryptionKey: "you_are_dobi"
- --------------------------------------------一道亮丽的风景线------------------------------------------------------------
- 暂未解决。。。。
- --------------------------------------------一道亮丽的风景线------------------------------------------------------------
- kibana6.4.3没有这个警告
- elasticsearch6.4.3下载地址 https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.3.tar.gz
kibana6.4.3下载地址 https://artifacts.elastic.co/downloads/kibana/kibana-6.4.3-linux-x86_64.tar.gz - --------------------------------------------一道亮丽的风景线------------------------------------------------------------
- 重新启动kibana
- 访问IP:5601