elasticsearch-7.2.0 部署

elasticsearch-7.2.0 部署

所需资源

主机IP描述
172.18.194.182主节点
172.18.194.183主节点
172.18.194.184主节点

下载软件

https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0-linux-x86_64.tar.gz

上传软件到服务器,完成解压

tar -zxvf  elasticsearch-7.2.0-linux-x86_64.tar.gz

分别修改三台主机上的配置文件 XXX/elasticsearch-7.2.0/config/elasticsearch.yml

172.18.194.182主机
cluster.name: log_center_es7_cluster
node.name: es7_node_01
node.master: true
node.data: true
bootstrap.memory_lock: false
network.host: 172.18.194.182
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
transport.tcp.port: 9300
discovery.zen.minimum_master_nodes: 1
discovery.seed_hosts: ["172.18.194.182:9300", "172.18.194.183:9300"]
cluster.initial_master_nodes: ["172.18.194.182", "172.18.194.183"]
172.18.194.183主机
cluster.name: log_center_es7_cluster
node.name: es7_node_02
node.master: true
node.data: true
bootstrap.memory_lock: false
network.host: 172.18.194.183
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
transport.tcp.port: 9300
discovery.zen.minimum_master_nodes: 1
discovery.seed_hosts: ["172.18.194.182:9300", "172.18.194.183:9300"]
cluster.initial_master_nodes: ["172.18.194.182", "172.18.194.183"]
172.18.194.184主机
cluster.name: log_center_es7_cluster
node.name: es7_node_03
node.master: false
node.data: true
bootstrap.memory_lock: false
network.host: 172.18.194.184
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
transport.tcp.port: 9300
discovery.zen.minimum_master_nodes: 1
discovery.seed_hosts: ["172.18.194.182:9300", "172.18.194.183:9300"]
cluster.initial_master_nodes: ["172.18.194.182", "172.18.194.183"]

分别修改三台主机启动文件 XXX/elasticsearch-7.2.0/bin/elasticsearch

在这里插入图片描述

以上配置是引用下载的es版本中自带的jdk,这个指定符合其要求,否则可能会报如下提示

future versions of Elasticsearch will require Java 11; your Java version from [/opt/openjdk8u222-b10/jre] does not meet this requirement

分别在三台主机上执行启动命令

XXX/elasticsearch-7.2.0/bin/elasticsearch -d

验证启动是否成功

每台主机上执行jps命令查看是否有 Elasticsearch 进程
浏览器访问 http://172.18.194.182:9200/_cat/nodes 显示如下信息

172.18.194.182 27 6 0 0.00 0.00 0.00 mdi * es7_node_01
172.18.194.183 34 5 1 0.15 0.10 0.04 mdi - es7_node_02
172.18.194.184 33 5 1 0.18 0.10 0.04 di - es7_node_03

常见错误

1.启动报错:future versions of Elasticsearch will require Java 11; your Java version from [/opt/openjdk8u222-b10/jre] does not meet this requirement

解决方法:

启动脚本增加如下配置

export JAVA_HOME=/ulmp/app/elasticsearch-7.2.0/jdk
export PATH=$JAVA_HOME/bin:$PATH

2.启动报错:ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方法:

切换到root用户修改配置sysctl.conf
vi /etc/sysctl.conf

添加下面配置:
vm.max_map_count=655360

并执行命令:
sysctl -p

然后,重新启动elasticsearch,即可启动成功

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值