Elasticsearch集群

时间:2021-10-17 20:42:09

详细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..zip
unzip elasticsearch-6.3..zip
mv elasticsearch-6.3. 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:
transport.tcp.port:
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:
discovery.zen.ping_timeout: 10s gateway.recover_after_nodes:
gateway.recover_after_time: 5m
gateway.expected_nodes: 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:
transport.tcp.port:
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:
discovery.zen.ping_timeout: 10s gateway.recover_after_nodes:
gateway.recover_after_time: 5m
gateway.expected_nodes: path.repo: /usr/local/test