ElasticSearch-基础-01-6.5.0集群搭建
2025-01-22 08:19:30    328 字   
This post is also available in English and alternative languages.

ElasticSearch版本:6.5.0(点击跳转官方文档)

elasticsearch 和 kibana 的下载地址官网就有。

安装步骤,按照这篇博文没啥问题:https://www.2cto.com/net/201712/705987.html


1. 重要配置

别问那么多,干就是了…

1
2
3
4
5
6
7
8
9
vim /etc/security/limits.conf
es hard nofile 65536
es soft nofile 65536

vim /etc/sysctl.conf
vm.max_map_count=262144

vim elasticsearch.yml
bootstrap.system_call_filter: false

2. 服务器关闭防火墙

1
2
3
4
5
6
7
8
查看防火墙状态
firewall-cmd --state

关闭防火墙
systemctl stop firewalld.service

禁止开机启动
systemctl disable firewalld.service

3. 用户权限

1
2
3
4
5
6
7
8
9
# 新增es专用用户
groupadd es
useradd es -g es -p 密码

# 删除用户
userdel -r es

# 切回root用户,赋予权限
chown es elasticsearch -R

4. 集群机器配置信任

1
2
3
4
5
6
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys

cat /root/.ssh/id_rsa.pub | ssh ....25.135 'cat >> .ssh/authorized_keys'
cat /root/.ssh/id_rsa.pub | ssh ....25.134 'cat >> .ssh/authorized_keys'
cat /root/.ssh/id_rsa.pub | ssh ....25.136 'cat >> .ssh/authorized_keys'

5. 集群日志

  • index_indexing_slowlog.log:索引(动态/写入)慢响应日志

  • index_search_slowlog:搜索(查询)慢响应日志

  • audit.log:记录对索引级别的操作,比如迁移shard,删除索引等

  • cloud.log:集群日志

  • gc.log:Elasticsearch实例垃圾回收日志


6. 下载


7. Reference