机器组
es1-10.0.7.46
es2-10.0.7.47
es3-10.0.7.48
ES集群部署
rpm包安装
三台ES服务器同时执行,rpm包已包含jdk环境
yum -y install https://mirror.tuna.tsinghua.edu.cn/elasticstack/7.x/yum/7.9.0/elasticsearch-7.9.0-x86_64.rpm
修改elasticsearch.yml配置文件
红色为每台机器机配置不一样的地方
vim /etc/elasticsearch/elasticsearch.yml
- 同一个集群的集群名字必须何持一致
cluster.name: my-cluster1
- 同一个集群节点必须不一样
node.name: node1
- 锁定内存,顺序占用内存
bootstrap.memeory_lock: true
- 监控主机可以写0.0.0.0或者改成本机IP
network.host: 本机IP
http.port: 9200
- 发现主机,探侧主机有没有存活。写主机名需要能解析
discovery.seed_hosts: ['10.0.7.46','10.0.7.47','10.0.7.48']
- 参与选举为master的主机
cluster_inital_master_nodes: ['10.0.7.46','10.0.7.47','10.0.7.48']
- 在搜索删除数据的时候不允许模糊匹配
action.destructive_requires_name: true
配置jvm.options
vim /elasticsearch/jvm.options
## You should always set the min and max JVM heap
## size to the same value. For example, to set
## the heap to 4 GB, set:
##打开此项注释让内存空间按顺序使用并锁定
-Xms4g
-Xmx4g
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
#配置初始化最小及最大内存
-Xms4g
-Xmx4g
启动文件开启内存锁定
vim /usr/lib/systemd/system/elasticsearch.service
[Service]
LimitMEMLOCK=infinity
systemctl daemon-reload
systemctl restart elasticsearch
systemctl enable elasticsearch
安装 elasticsearch-head
打开谷歌浏览器->设置->扩展程序->打开chorme应用商店->elasticsearch-head
ES连接完成的状态
安装kibana
yum -y install https://mirror.tuna.tsinghua.edu.cn/elasticstack/7.x/yum/7.9.0/kibana-7.9.0-x86_64.rpm