Elasticsearch集群

Posted kgdxpr

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Elasticsearch集群相关的知识,希望对你有一定的参考价值。

详细Elasticsearch安装:

https://www.cnblogs.com/littlehb/p/8406378.html

安装之前需先优化内核:

https://www.cnblogs.com/kgdxpr/p/3342102.html

简单安装:

--下载
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.0.zip
unzip elasticsearch-6.3.0.zip
mv elasticsearch-6.3.0 elasticsearch

--增加用户
adduser elasticsearch
echo elasticsearch | passwd --stdin elasticsearch
chown -R elasticsearch /usr/local/elasticsearch

--启动
su elasticsearch -l -c "/usr/local/elasticsearch/bin/elasticsearch"

修改Elasticsearch的jvm配置(为服务器总内存的一半)

vi /usr/local/elasticsearch/config/jvm.options

-Xms4g
-Xmx4g

master配置文件:

cluster.name: bigData
node.name: master_node
node.master: true
node.data: false
network.host: 10.10.14.170
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["10.10.14.170:9300", "10.10.14.171:9300", "10.10.14.172:9300", "10.10.14.173:9300"]

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

discovery.zen.minimum_master_nodes: 1
discovery.zen.ping_timeout: 10s

gateway.recover_after_nodes: 3
gateway.recover_after_time: 5m
gateway.expected_nodes: 2

http.cors.enabled: true
http.cors.allow-origin: "*"

path.repo: /usr/local/test    #做快照用的

 

dataNode配置文件:

cluster.name: bigData
node.name: node1
node.master: false
node.data: true
network.host: 10.10.14.171
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["10.10.14.170:9300", "10.10.14.171:9300", "10.10.14.172:9300", "10.10.14.173:9300"]

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

discovery.zen.minimum_master_nodes: 1
discovery.zen.ping_timeout: 10s

gateway.recover_after_nodes: 3
gateway.recover_after_time: 5m
gateway.expected_nodes: 2

path.repo: /usr/local/test

 

以上是关于Elasticsearch集群的主要内容,如果未能解决你的问题,请参考以下文章

Elasticsearch集群部署

使用Spring Data ElasticSearch+Jsoup操作集群数据存储

Elasticsearch:将关系数据库中的数据提取到 Elasticsearch 集群中

Elasticsearch:将关系数据库中的数据提取到 Elasticsearch 集群中

Python Elasticsearch API操作ES集群

通过堡垒主机到 VPC 中的 Elasticsearch 集群的 ssh 端口转发不起作用