Elasticsearch:核心的分布式搜索和分析引擎---做存储数据用--就叫es
7.x以上版本集群:https://www.cnblogs.com/chenyanbin/p/13493920.html
1、安装es
wget https://repo.huaweicloud.com/elasticsearch/2.3.2/elasticsearch-2.3.2.rpm
rpm -ivh elasticsearch-2.3.2.rpm
首先请先优化limits.conf sysctl.conf 文件参数,否则后面启动会报错---(tar包安装需要创建用户和授予文件权限)
vim/etc/security/limits.conf
rootsoft nofile 65535
roothard nofile 65535
* softnofile 65536
* hardnofile 65536
vim/etc/sysctl.conf
vm.max_map_count=655360
sysctl-p
#修改配置文件;另一台机器上的配置文件注意修改加粗倾斜内容
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
网友评论