美文网首页
Elasticsearch集群搭建

Elasticsearch集群搭建

作者: 大雄的学习笔记 | 来源:发表于2019-06-28 16:08 被阅读0次

Elasticsearch安装

es运行需要jdk1.8

下载es6.4安装包elasticsearch-6.4.0.tar.gz,解压即可

配置es:目录/config/elasticsearch.yml


cluster.name: es-cluster #集群名称,必须跟其他节点相同

node.name: es-node1      #节点名称  不能跟其他节点相同

node.master: true              #是否允许作为主节点

node.data: true     #是否存储数据

path.data: /usr/local/elasticsearch-6.4.0/data        #数据存储路径

path.logs: /usr/local/elasticsearch-6.4.0/logs/      #日志路径

http.enabled: true                                                    #是否允许http

network.host: 10.6.80.101     #配置为节点的ip地址

bootstrap.system_call_filter: false

transport.tcp.port: 9300     #传输端口

discovery.zen.ping.unicast.hosts: ["10.6.80.101:9300","10.6.80.103:9300"]        #集群所有几点ip

discovery.zen.minimum_master_nodes: 1                                     

http.cors.enabled: true                        #允许es-head链接es

http.cors.allow-origin: "*"

配置文件复制到其他节点 并配置对应的ip地址

启动es节点
bin/ ./elasticsearch

 ./elasticsearch

访问http://loaclhost:9200来验证es启动是否成功
当出现 You Know,for Search 字样 说明es启动成功

image.png

可能出现的报错

问题1:

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

解决:

sudo vim /etc/security/limits.conf

# 在最后面追加下面内容
* soft nofile 65536
* hard nofile 131072
* soft nproc 65536
* hard nproc 65536

问题2:

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方法:

sudo sysctl -w vm.max_map_count=655360

sudo sysctl -a | grep “vm.max_map_count”
修改配置文件:
sudo vim /etc/sysctl.conf
加入如下内容:
vm.max_map_count=262144

问题3:

system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

解决方法:

在es配置文件elasticsearch.yml中加入:
bootstrap.system_call_filter: false

相关文章

网友评论

      本文标题:Elasticsearch集群搭建

      本文链接:https://www.haomeiwen.com/subject/xmkecctx.html