当前位置: 代码迷 >> 综合 >> 复习充电之 ES集群安装
  详细解决方案

复习充电之 ES集群安装

热度:65   发布时间:2024-02-01 01:56:10.0
1.下载elasticsearch-7.2.1-linux-x86_64.tar.gz包2.解压elasticsearch-7.2.1-linux-x86_64.tar.gz 并解压到以下目录
ll
drwxr-xr-x 10 es root      4096 May 22 20:33 elasticsearch-node01
drwxr-xr-x 10 es root      4096 May 22 20:33 elasticsearch-node02
drwxr-xr-x 10 es root      4096 May 22 20:33 elasticsearch-node03
3.编写config中elasticsearch.yml文件
# 集群名字
cluster.name: javatom-cluster
# 节点名 相应的节点修改
node.name: node-1
#绑定的ip端口
network.host: 127.0.0.1
#允许外网访问
network.bind_host: 0.0.0.0
#此端口是用于es Restful接口调用 相应的节点修改
http.port: 9200
#用于es集群直接的指令通信 相应的节点修改
transport.tcp.port: 9300
#允许前端调用访问
http.cors.enabled: true
http.cors.allow-origin: "*"
#用于发现对应集群的端点
discovery.seed_hosts: ["127.0.0.1:9300", "127.0.0.1:9301","127.0.0.1:9302"]
#初始化masterNodes 
cluster.initial_master_nodes: ["127.0.0.1:9300", "127.0.0.1:9301","127.0.0.1:9302"]#启动/usr/local/es/elasticsearch-node01/bin/elasticsearch -decho 'node01 ok'/usr/local/es/elasticsearch-node02/bin/elasticsearch -decho 'node02 ok'/usr/local/es/elasticsearch-node03/bin/elasticsearch -decho 'node03 ok'关闭#!/bin/bash#git pull#getProcessId then kill
pids=$(ps -ef | grep elasticsearch-node| awk '{print $2}')
for pid in $pids
doecho  $pidkill -9  $pid
done
  相关解决方案