Elasticsearch_7.0.0_单机伪集群部署

将tar.gz安装包解压三份,修改配置参数vi config/elasticsearch.yml

master节点 elasticsearch.yml
cluster.initial_master_nodes: ["node1"]
cluster.name: per_es_cluster
node.name: node1
node.master: true
node.attr.rack: r1
node.max_local_storage_nodes: 3    #这个配置限制了单节点上可以开启的ES存储实例的个数,我们需要开多个实例,因此需要把这个配置写到配置文件中,并为这个配置赋值为2或者更高
network.host: 10.4.56.105
http.port: 9200
transport.tcp.port: 9301
discovery.zen.minimum_master_nodes: 1
http.cors.enabled: true
http.cors.allow-origin: "*"
data节点1 elasticsearch.yml
cluster.name: per_es_cluster
node.name: node2
node.master: false
node.attr.rack: r1
node.max_local_storage_nodes: 3
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 10.4.56.105
http.port: 9202
transport.tcp.port: 9302
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["10.4.56.105:9301"]  #候选主节点地址
data节点2 elasticsearch.yml
cluster.name: ictr_ElasticSearch
#换个节点名字
node.name: node3
node.master: false
node.attr.rack: r1
node.max_local_storage_nodes: 3
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
network.host: 10.4.56.105
http.port: 9203
transport.tcp.port: 9303
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.zen.ping.unicast.hosts: ["10.4.56.105:9301"] 

单机内存不足,启动不了3个节点可以调小内存占用修改jvm.options
将 -Xms512m -Xmx512m,设置为512m

管理es工具:cerebro
https://github.com/lmenezes/cerebro

集群错误
ERROR: [2] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
切换到root用户下面
vim /etc/security/limits.conf
在最后添加

  • hard nofile 65536
  • hard nofile 65536
    重新登录用户
    [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    sysctl -w vm.max_map_count=262144

    在 /etc/sysctl.conf文件最后添加一行
    vm.max_map_count=262144
    即可永久修改

  1. tar zxvf elasticsearch-7.0.0-linux-x86_64.tar.gz -C elastic
  2. 复制elastic三份,模仿三个节点es7-1,es7-2,es7-3
  3. 由于单机伪集群所以调小jvm,修改jvm.options
  4. 新建es用户,groupadd elsearch,useradd elsearch -g elsearch -p elasticsearch,chown -R elsearch:elsearch ./es7-1 用户目录权限
  5. ./bin/elasticsearch
  6. 开放端口,firewall-cmd --permanent --zone=public --add-port=80/tcp,firewall-cmd --reload,firewall-cmd --zone= public --query-port=80/tcp
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值