ES-集群配置

Elasticsearch:核心的分布式搜索和分析引擎---做存储数据用--就叫es
1、安装es
wget https://repo.huaweicloud.com/elasticsearch/2.3.2/elasticsearch-2.3.2.rpm
rpm -ivh elasticsearch-2.3.2.rpm

#修改配置文件;另一台机器上的配置文件注意修改加粗倾斜内容
vim /etc/elasticsearch/elasticsearch.yml
cluster.name: es
node.name: 2dot237
node.rack: 2dot237
path.data: /data/elasticsearch/data
path.logs: /data/elasticsearch/logs
network.host: 192.168.2.237
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.2.237", "192.168.2.238"]
#es_head使用
http.cors.enabled: true    
http.cors.allow-origin: "*"

2、创建相关目录;启动es
mkdir -p /data/elasticsearch/{data,logs}
chown -R elasticsearch:elasticsearch /data/elasticsearch
systemctl enable elasticsearch && systemctl restart elasticsearch

#验证集群状态和集群健康状态
curl 192.168.2.237:9200/_cat/nodes

curl http://192.168.2.237:9200/_cluster/health?pretty

ES-集群配置_第1张图片

你可能感兴趣的:(ES-集群配置)