在3台不联网的 CentOS 7.8 服务器上部署 Elasticsearch 6.8 集群

为了在3台不联网的 CentOS 7.8 服务器上部署 Elasticsearch 6.8.23 集群,并考虑到path.datapath.logs的配置,我们可以按照以下步骤进行操作:

1. 准备工作

1.1 从有网络的机器下载 Elasticsearch 6.8.23 的 RPM 包:

https://www.elastic.co/downloads/past-releases/elasticsearch-6-8-23

1.2 为了安装依赖包,还需要下载以下 RPM 包:

  • java-1.8.0-openjdk

可以使用 yum 命令下载:

bash 复制代码
yum install --downloadonly --downloaddir=/path_to_directory java-1.8.0-openjdk

1.3 使用 U盘或其他方式将这些 RPM 包复制到 3 台 CentOS 服务器上。

2. 安装

2.1 安装 Java:

bash 复制代码
cd /path_to_directory
yum localinstall java-1.8.0-openjdk*.rpm

2.2 安装 Elasticsearch:

bash 复制代码
cd /path_where_elasticsearch_rpm_is
yum localinstall elasticsearch-6.8.23.rpm

3. 配置 Elasticsearch

3.1 创建数据和日志的目录:

bash 复制代码
mkdir -p /data1/elasticsearch/data/
mkdir -p /data1/elasticsearch/log/

3.2 设置适当的权限:

bash 复制代码
chown -R elasticsearch:elasticsearch /data1/elasticsearch/data/
chown -R elasticsearch:elasticsearch /data1/elasticsearch/log/

3.3 编辑 /etc/elasticsearch/elasticsearch.yml 文件,设置以下参数:

yaml 复制代码
cluster.name: my-cluster
node.name: node-1 # 在不同的服务器上设置为 node-2, node-3
network.host: 0.0.0.0
http.port: 9200
discovery.zen.ping.unicast.hosts: ["server1_ip", "server2_ip", "server3_ip"]
discovery.zen.minimum_master_nodes: 2
path.data: /data1/elasticsearch/data/
path.logs: /data1/elasticsearch/log/

3.4 开启 Elasticsearch 服务:

bash 复制代码
systemctl enable elasticsearch
systemctl start elasticsearch

4. 开放防火墙

若服务器有启动防火墙,需要允许访问 Elasticsearch 的端口:

bash 复制代码
firewall-cmd --permanent --add-port=9200/tcp
firewall-cmd --permanent --add-port=9300/tcp
firewall-cmd --reload

5. 验证安装

在任意服务器上运行以下命令,查看集群健康状况:

bash 复制代码
curl -X GET "localhost:9200/_cluster/health?pretty"

以上步骤应该可以帮助你在 3 台 CentOS 7.8 服务器上部署 Elasticsearch 6.8.23 集群并正确配置数据和日志路径。确保在所有3台服务器上都执行这些步骤,以确保集群的每个节点都正确配置。

注意:Elasticsearch 的配置和部署在生产环境中涉及很多细节和优化,上述步骤仅为基础部署。生产环境中需要考虑数据安全、性能优化、备份等多种问题。

相关推荐
liuyao_xianhui11 分钟前
Linux_基本指令1
linux·运维·服务器
liliangcsdn2 小时前
LLM时代基于unstructured解析非结构化pdf
linux·服务器·数据分析
爱吃喵的鲤鱼2 小时前
仿mudou——Connection模块(连接管理)
linux·运维·服务器·开发语言·网络·c++
郝学胜-神的一滴3 小时前
使用Linux的read和write系统函数操作文件
linux·服务器·开发语言·数据库·c++·程序人生·软件工程
pu_taoc3 小时前
深入剖析:基于epoll与主从Reactor模型的高性能服务器设计与实现
服务器·c语言·c++·vscode
敢敢J的憨憨L5 小时前
GPTL(General Purpose Timing Library)使用教程
java·服务器·前端·c++·轻量级计时工具库
INFINI Labs6 小时前
Elasticsearch 备份:方案篇
大数据·elasticsearch·搜索引擎·gateway·snapshot·backup·ccr
Bug退退退1236 小时前
Java 网络流式编程
java·服务器·spring·sse
QotomPC6 小时前
软件定义的理想硬件平台:Qotom Q30900SE/UE系列在AIO服务器与边缘网关中的实践
运维·服务器
望获linux6 小时前
【实时Linux实战系列】实时系统的可观测性:Prometheus 与 Grafana 集成
大数据·linux·服务器·开发语言·网络·操作系统