ElasticSearch集群环境搭建

1、准备三台服务器

这里准备三台服务器如下:

IP地址主机名节点名
192.168.225.65linux1node-1
192.168.225.66linux2node-2
192.168.225.67linux3node-3

2、准备elasticsearch安装环境

(1)编辑/etc/hosts(三台服务器都执行)

vim /etc/hosts
添加如下内容:
192.168.225.65    linux1
192.168.225.66    linux2
192.168.225.67    linux3

在这里插入图片描述
(2)编辑/etc/hostname (三台服务器都执行)

在192.168.225.65上修改
echo 'linux1' > /etc/hostname
在192.168.225.66上修改
echo 'linux2' > /etc/hostname
在192.168.225.67上修改
echo 'linux3' > /etc/hostname

(3)修改系统参数 (三台服务器都执行)

vim /etc/security/limits.conf
修改内容如下:
*  soft nofile  65536
*  hard nofile 131072
*  soft nproc  4096
*  hard nproc  4096 vim /etc/sysctl.conf
修改内容如下:
vm.max_map_count = 262145
保存退出,刷新配置文件
sysctl -p 

(4)上传elasticsearch安装包和创建安装用户(三台服务器都执行)
elasticsearch-7.8.1下载地址

这里是将elasticsearch安装包elasticsearch-7.8.1-linux-x86_64.tar.gz上传到/opt目录下
cd /opt
tar -zxvf elasticsearch-7.8.1-linux-x86_64.tar.gz
mv elasticsearch-7.8.1 elasticsearch7.8
useradd jamysong
chown -R jamysong:jamysong  /opt/elasticsearch7.8

注意:做完以上四步重启下三台服务器

3、安装elasticsearch

(1) 编辑elasticsearch配置文件

vim /opt/elasticsearch7.8/cong/elasticsearch.yaml

node1的配置文件

cluster.name: cluster-jamysong
node.name: node-1
network.host: linux1
node.master: true
node.data: true
http.port: 9200 
http.cors.allow-origin: "*"
http.cors.enabled: true
http.max_content_length: 200mb
cluster.initial_master_nodes: ["node-1"]
discovery.seed_hosts: ["linux1:9300", "linux2:9300","linux3:9300"]
gateway.recover_after_nodes: 2
network.tcp.keep_alive: true
network.tcp.no_delay: true
transport.tcp.compress: true
cluster.routing.allocation.cluster_concurrent_rebalance: 16
cluster.routing.allocation.node_concurrent_recoveries: 16
cluster.routing.allocation.node_initial_primaries_recoveries: 16

node2的配置文件

cluster.name: cluster-jamysong
node.name: node-2
network.host: linux2
node.master: true
node.data: true
http.port: 9200 
http.cors.allow-origin: "*"
http.cors.enabled: true
http.max_content_length: 200mb
cluster.initial_master_nodes: ["node-1"]
discovery.seed_hosts: ["linux1:9300", "linux2:9300","linux3:9300"]
gateway.recover_after_nodes: 2
network.tcp.keep_alive: true
network.tcp.no_delay: true
transport.tcp.compress: true
cluster.routing.allocation.cluster_concurrent_rebalance: 16
cluster.routing.allocation.node_concurrent_recoveries: 16
cluster.routing.allocation.node_initial_primaries_recoveries: 16

node3的配置文件

cluster.name: cluster-jamysong
node.name: node-3
network.host: linux3
node.master: true
node.data: true
http.port: 9200 
http.cors.allow-origin: "*"
http.cors.enabled: true
http.max_content_length: 200mb
cluster.initial_master_nodes: ["node-1"]
discovery.seed_hosts: ["linux1:9300", "linux2:9300","linux3:9300"]
gateway.recover_after_nodes: 2
network.tcp.keep_alive: true
network.tcp.no_delay: true
transport.tcp.compress: true
cluster.routing.allocation.cluster_concurrent_rebalance: 16
cluster.routing.allocation.node_concurrent_recoveries: 16
cluster.routing.allocation.node_initial_primaries_recoveries: 16
(2)启动elasticsearch

现在直接去启动每台服务器上面的elasticsearch

su jamysong
cd /opt/elasticsearch7.8/bin
./elasticsearch

注意:elasticsearch是不允许root用户启动的,这里使用上面创建的安装用户(jamysong)启动
!
在这里插入图片描述

查看启动日志如下,表示启动成功!
在这里插入图片描述

(3)检测elasticsearch集群

这里可以直接访问浏览器来检测一下集群是否搭建成功,这里可以看到node-1是主节点,node-2和node-3是从节点
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/159989.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

电源管理(PMIC)MAX20428ATIA/VY、MAX20428ATIC/VY、MAX20428ATIE/VY适合汽车ADAS应用的开关稳压器

一、概述 MAX20428是一款高效率、八路输出、低压PMIC。OUT1将输入电源升压至5V,电流高达500mA,而三个同步降压转换器的输入电压范围为3.0V至4.2V,输出电压范围为0.8V至3.9875V,峰值电流分别高达1.3A、1.3A和3.5A。三个300mA pMOS…

【ES专题】ElasticSearch搜索进阶

目录 前言阅读导航前置知识特别提醒笔记正文一、分词器详解1.1 基本概念1.2 分词发生的时期1.3 分词器的组成1.3.1 切词器&#xff1a;Tokenizer1.3.2 词项过滤器&#xff1a;Token Filter1.3.3 字符过滤器&#xff1a;Character Filter 1.4 倒排索引的数据结构 <font color…

论文阅读—— BiFormer(cvpr2023)

论文&#xff1a;https://arxiv.org/abs/2303.08810 github&#xff1a;GitHub - rayleizhu/BiFormer: [CVPR 2023] Official code release of our paper "BiFormer: Vision Transformer with Bi-Level Routing Attention" 一、介绍 1、要解决的问题&#xff1a;t…

【入门Flink】- 05Flink运行时架构以及一些核心概念

系统架构 Flink运行时架构Standalone会话模式为例 1&#xff09;作业管理器&#xff08;JobManager&#xff09; JobManager 是一个 Flink 集群中任务管理和调度的核心&#xff0c;是控制应用执行的主进程。每个应用都应该被唯一的 JobManager 所控制执行。 JobManger 又包含…

网络安全(网络安全)小白自学

想自学网络安全&#xff08;黑客技术&#xff09;首先你得了解什么是网络安全&#xff01;什么是黑客&#xff01; 网络安全可以基于攻击和防御视角来分类&#xff0c;我们经常听到的 “红队”、“渗透测试” 等就是研究攻击技术&#xff0c;而“蓝队”、“安全运营”、“安全…

selenium自动化测试入门 —— 操作浏览器!

1、启动浏览器&#xff08;实例化浏览器&#xff09; 启动Chrome浏览器&#xff08;驱动已放入path环境变量下&#xff09; driver webdriver.Chrome() 指定驱动路径驱动Chrome 浏览器 # .\driver\chromedriver.exe 为驱动存放位置,可以是相对路径或者绝对路径 driver we…

UNI-APP_ios自动适应底部安全区背景,修改安全区背景

自动适应&#xff08;推荐&#xff09; 将所有 iPhone X&#xff08;刘海屏) 底部安全区域背景颜色 自动适应&#xff0c;当前页面什么颜色会自动调整。 1.打开 manifest.json &#xff0c;打开源码视图 2.找到 app-plus 配置项&#xff0c;添加以下代码 "safearea&quo…

VBA之正则表达式(44)-- 拆分商品和规格

实例需求&#xff1a;商品组清单保存在A列中&#xff0c;现需要将其拆分为商品名称&#xff0c;保存在从B列开始的后续单元格中&#xff0c;部分商品包含规格&#xff0c;并且多种规格属性使用了逗号分隔&#xff0c;因此无法直接使用Excel分列功能完成数据拆分。 示例代码如下…

百度竞价排名推广对比自然排名哪一个更具优势-华媒舍

在搜索引擎结论网页页面&#xff08;SERP&#xff09;中&#xff0c;我们经常会看到一些网站链接及其广告栏。这种连接一般分为两种类型&#xff1a;百度竞价推广排名推广与自然排名。究竟哪个更有优势&#xff1f;本文将对这几种排名形式进行科谱详细介绍。 什么叫百度竞价推广…

TimeGPT-1——第一个时间序列数据领域的大模型他来了

一直有一个问题:时间序列的基础模型能像自然语言处理那样存在吗?一个预先训练了大量时间序列数据的大型模型&#xff0c;是否有可能在未见过的数据上产生准确的预测?最近刚刚发表的一篇论文&#xff0c;Azul Garza和Max Mergenthaler-Canseco提出的TimeGPT-1&#xff0c;将ll…

路由器基础(七):NAT原理与配置

一、NAT 配置 华为路由器配置NAT 的方式有很多种&#xff0c;考试中可能考到的基本配置方 式主要有EasyIP和通过NAT地址池的方式。图22-7-1是一个典型的通过EasyIP进行NAT的示意图&#xff0c;其中Router出接口GE0/0/1的IP地址为200.100.1.2/24,接口E0/0/1的IP地址为192.168.0.…

贰[2],OpenCV函数解析

1&#xff0c;imread&#xff1a;图片读取 CV_EXPORTS_W Mat imread( const String& filename, int flags IMREAD_COLOR );//参数1(filename)&#xff1a;文件地址 //参数2(flags):读取标志 注:ImreadModes&#xff0c;参数2(flags)枚举定义 enum ImreadModes { IMREAD…