安装 elasticsearch-9.1.4 - 集群 和 kibana-9.1.4

news/2025/9/23 23:35:14/文章来源:https://www.cnblogs.com/chanchifeng/p/19108363

准备 3 台主机,均进行如下操作

  1. 更新系统以及关联软件
yum update
  1. 关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
sed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0
  1. 设置主机名
# lab10 主机设置为
hostnamectl set-hostname lab10# lab20 主机设置为
hostnamectl set-hostname lab20# lab30 主机设置为
hostnamectl set-hostname lab30
  1. 编辑本地域名解析
vim /etc/hosts

追加内容如下:

10.1.1.10 lab10
10.1.1.20 lab20
10.1.1.30 lab30
  1. 创建 software 目录
mkdir /opt/software
  1. 创建 module 目录
mkdir /opt/module
  1. 下载 Elasticsearch 文件

下载列表页面:https://www.elastic.co/cn/downloads/past-releases#elasticsearch
文件名称:elasticsearch-9.1.4-linux-x86_64.tar.gz
MD5:20DA05C3A2A7425A658A73D6D9AF8DFE
下载链接:https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-9.1.4-linux-x86_64.tar.gz

  1. 拷贝到 /opt/software

  2. 解压

tar -zxvf /opt/software/elasticsearch-9.1.4-linux-x86_64.tar.gz -C /opt/module
  1. 创建 es 用户
useradd es
  1. 设置 es 用户密码
passwd es
  1. 创建 data 目录
mkdir /opt/module/elasticsearch-9.1.4/data
  1. 创建 certs 目录
mkdir /opt/module/elasticsearch-9.1.4/config/certs
  1. 进入 Elasticsearch 目录
cd /opt/module/elasticsearch-9.1.4
  1. Elasticsearch 目录赋权给 es 用户操作
chown -R es:es /opt/module/elasticsearch-9.1.4

lab10 主机操作

  1. 切换 es 用户
su es
  1. 签发 ca 证书
bin/elasticsearch-certutil ca

操作过程如下

Please enter the desired output file [elastic-stack-ca.p12]:【默认,回车】
Enter password for elastic-stack-ca.p12 :【默认,回车】

完成后证书在 /opt/module/elasticsearch-9.1.4/elastic-stack-ca.p12

  1. 用 ca 证书签发节点证书,设置集群多节点通信密钥
bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12

操作过程如下

Enter password for CA (elastic-stack-ca.p12) :【默认,回车】
Please enter the desired output file [elastic-certificates.p12]:【默认,回车】
Enter password for elastic-certificates.p12 :【默认,回车】

完成后证书在 /opt/module/elasticsearch-9.1.4/elastic-certificates.p12

  1. 移动上述 2 个证书至 cert 目录
mv elastic-stack-ca.p12 elastic-certificates.p12 config/certs
  1. 设置集群多节点 HTTP 证书
bin/elasticsearch-certutil http

操作过程如下:

Generate a CSR? [y/N]N
Use an existing CA? [y/N]y
CA Path: 【certs/elastic-stack-ca.p12】
Password for elastic-certificates.p12:【默认,回车】
For how long should your certificate be valid? [5y] 【默认,回车】
Generate a certificate per node? [y/N]n
When you are done, press <ENTER> once more to move on to the next step.lab10
lab20
lab30
Is this correct [Y/n]Y
When you are done, press <ENTER> once more to move on to the next step.10.1.1.10
10.1.1.20
10.1.1.30
Is this correct [Y/n]Y
Do you wish to change any of these options? [y/N]N
Provide a password for the "http.p12" file:  [<ENTER> for none]【默认,回车】
What filename should be used for the output zip file? [/opt/module/elasticsearch-9.1.4/elasticsearch-ssl-http.zip]【默认,回车】

完成后证书在 /opt/module/elasticsearch-9.1.4/elasticsearch-ssl-http.zip

  1. 移动上述 1 个压缩包至 cert 目录
mv elasticsearch-ssl-http.zip config/certs/
  1. 解压
unzip config/certs/elasticsearch-ssl-http.zip -d config/certs/elasticsearch-ssl-http
  1. 删除无用的压缩包
rm -rf /opt/module/elasticsearch-9.1.4/config/certs/elasticsearch-ssl-http.zip
  1. 编辑 elasticsearch.yml 文件
vim /opt/module/elasticsearch-9.1.4/config/elasticsearch.yml

追加内容如下

# 设置 ES 集群名称
cluster.name: es-cluster
# 设置集群中当前节点名称
node.name: es-node-1
# 设置数据,日志文件路径
path.data: /opt/module/elasticsearch-9.1.4/data
path.logs: /opt/module/elasticsearch-9.1.4/logs
# 设置网络访问节点
network.host: lab10
# 设置网络访问端口
http.port: 9200
# 初始节点
discovery.seed_hosts: ["lab10"]
# 安全认证
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:enabled: truekeystore.path: /opt/module/elasticsearch-9.1.4/config/certs/elasticsearch-ssl-http/elasticsearch/http.p12truststore.path: /opt/module/elasticsearch-9.1.4/config/certs/elasticsearch-ssl-http/elasticsearch/http.p12
xpack.security.transport.ssl:enabled: trueverification_mode: certificatekeystore.path: /opt/module/elasticsearch-9.1.4/config/certs/elastic-certificates.p12truststore.path: /opt/module/elasticsearch-9.1.4/config/certs/elastic-certificates.p12
# 此处需注意,es-node-1 为上面配置的节点名称
cluster.initial_master_nodes: ["es-node-1"]
http.host: [_local_, _site_]
ingest.geoip.downloader.enabled: false
xpack.security.http.ssl.client_authentication: none
  1. 启动 Elasticsearch 集群
bin/elasticsearch
  1. 重建会话,并使用 es 用户登录并且进入 /opt/module/elasticsearch-9.1.4 目录

  2. 重置 elastic 用户密码

bin/elasticsearch-reset-password -u elastic

操作过程如下

[root@lab10 elasticsearch-9.1.4]# su es
[es@lab10 elasticsearch-9.1.4]$ bin/elasticsearch-reset-password -u elastic
This tool will reset the password of the [elastic] user to an autogenerated value.
The password will be printed in the console.
Please confirm that you would like to continue [y/N]yPassword for the [elastic] user successfully reset.
New value: 1m+yge3yEAkwcetxua-o
[es@lab10 elasticsearch-9.1.4]$ 
  1. 使用浏览器访问:https://10.1.1.10:9200,默认账号为:elastic,密码为 1m+yge3yEAkwcetxua-o,得到如下图所示

elasticsearch-install-1

  1. 使用谷歌浏览器的 Elasticsearch Tools 插件查看 Elasticsearch 状态

elasticsearch-install-2

  1. 使用谷歌浏览器的 Elasticvue 插件查看 Elasticsearch 状态

elasticsearch-install-3

lab20 主机操作

  1. 将 lab10主机 /opt/module/elasticsearch-9.1.4/config/certs 目录拷贝至本机的 /opt/module/elasticsearch-9.1.4/config/certs 目录

  2. Elasticsearch 目录赋权给 es 用户操作(需要root用户权限操作)

chown -R es:es /opt/module/elasticsearch-9.1.4
  1. 切换 es 用户
su es
  1. 编辑 elasticsearch.yml 文件
vim /opt/module/elasticsearch-9.1.4/config/elasticsearch.yml

追加内容如下

# 设置 ES 集群名称
cluster.name: es-cluster
# 设置集群中当前节点名称
node.name: es-node-2
# 设置数据,日志文件路径
path.data: /opt/module/elasticsearch-9.1.4/data
path.logs: /opt/module/elasticsearch-9.1.4/logs
# 设置网络访问节点
network.host: lab20
# 设置网络访问端口
http.port: 9200
# 初始节点
discovery.seed_hosts: ["lab10"]
# 安全认证
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:enabled: truekeystore.path: /opt/module/elasticsearch-9.1.4/config/certs/elasticsearch-ssl-http/elasticsearch/http.p12truststore.path: /opt/module/elasticsearch-9.1.4/config/certs/elasticsearch-ssl-http/elasticsearch/http.p12
xpack.security.transport.ssl:enabled: trueverification_mode: certificatekeystore.path: /opt/module/elasticsearch-9.1.4/config/certs/elastic-certificates.p12truststore.path: /opt/module/elasticsearch-9.1.4/config/certs/elastic-certificates.p12
# 此处需注意,es-node-1 为上面配置的节点名称
cluster.initial_master_nodes: ["es-node-1"]
http.host: [_local_, _site_]
ingest.geoip.downloader.enabled: false
xpack.security.http.ssl.client_authentication: none
  1. 进入 Elasticsearch 目录
cd /opt/module/elasticsearch-9.1.4
  1. 后台启动 Elasticsearch 集群
bin/elasticsearch -d
  1. 使用谷歌浏览器的 Elasticsearch Tools 插件查看 Elasticsearch 状态

elasticsearch-install-4

  1. 使用谷歌浏览器的 Elasticvue 插件查看 Elasticsearch 状态

elasticsearch-install-5

lab30 主机操作

  1. 将 lab10主机 /opt/module/elasticsearch-9.1.4/config/certs 目录拷贝至本机的 /opt/module/elasticsearch-9.1.4/config/certs 目录

  2. Elasticsearch 目录赋权给 es 用户操作(需要root用户权限操作)

chown -R es:es /opt/module/elasticsearch-9.1.4
  1. 切换 es 用户
su es
  1. 编辑 elasticsearch.yml 文件
vim /opt/module/elasticsearch-9.1.4/config/elasticsearch.yml

追加内容如下

# 设置 ES 集群名称
cluster.name: es-cluster
# 设置集群中当前节点名称
node.name: es-node-3
# 设置数据,日志文件路径
path.data: /opt/module/elasticsearch-9.1.4/data
path.logs: /opt/module/elasticsearch-9.1.4/logs
# 设置网络访问节点
network.host: lab30
# 设置网络访问端口
http.port: 9200
# 初始节点
discovery.seed_hosts: ["lab10"]
# 安全认证
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:enabled: truekeystore.path: /opt/module/elasticsearch-9.1.4/config/certs/elasticsearch-ssl-http/elasticsearch/http.p12truststore.path: /opt/module/elasticsearch-9.1.4/config/certs/elasticsearch-ssl-http/elasticsearch/http.p12
xpack.security.transport.ssl:enabled: trueverification_mode: certificatekeystore.path: /opt/module/elasticsearch-9.1.4/config/certs/elastic-certificates.p12truststore.path: /opt/module/elasticsearch-9.1.4/config/certs/elastic-certificates.p12
# 此处需注意,es-node-1 为上面配置的节点名称
cluster.initial_master_nodes: ["es-node-1"]
http.host: [_local_, _site_]
ingest.geoip.downloader.enabled: false
xpack.security.http.ssl.client_authentication: none
  1. 进入 Elasticsearch 目录
cd /opt/module/elasticsearch-9.1.4
  1. 后台启动 Elasticsearch 集群
bin/elasticsearch -d
  1. 使用谷歌浏览器的 Elasticsearch Tools 插件查看 Elasticsearch 状态

elasticsearch-install-6

  1. 使用谷歌浏览器的 Elasticvue 插件查看 Elasticsearch 状态

elasticsearch-install-7

【【【 以上完成【安装 elasticsearch-9.1.4 - 集群】 】】】
【【【 以上完成【安装 elasticsearch-9.1.4 - 集群】 】】】
【【【 以上完成【安装 elasticsearch-9.1.4 - 集群】 】】】

lab10 主机操作

  1. 下载Kibana 文件

下载列表页面:https://www.elastic.co/cn/downloads/past-releases#elasticsearch
文件名称:kibana-9.1.4-linux-x86_64.tar.gz
MD5:188D1DEE8DE1AD02116C26404B877C16
下载链接:https://artifacts.elastic.co/downloads/kibana/kibana-9.1.4-linux-x86_64.tar.gz

  1. 拷贝到 /opt/software

  2. 解压

tar -zxvf /opt/software/kibana-9.1.4-linux-x86_64.tar.gz -C /opt/module/
  1. 进入 Elasticsearch 目录
cd /opt/module/elasticsearch-9.1.4
  1. 在 ES 服务器中生成证书
bin/elasticsearch-certutil csr -name kibana -dns lab10

操作过程

Please enter the desired output file [csr-bundle.zip]: 【默认配置,回车】

生成成功后的证书路径在 /opt/module/elasticsearch-9.1.4/csr-bundle.zip

  1. 移动证书至 /opt/module/kibana-9.1.4/config
mv /opt/module/elasticsearch-9.1.4/csr-bundle.zip /opt/module/kibana-9.1.4/config/
  1. 解压
unzip /opt/module/kibana-9.1.4/config/csr-bundle.zip -d /opt/module/kibana-9.1.4/config/csr-bundle
  1. 删除无用的压缩包
rm -rf /opt/module/kibana-9.1.4/config/csr-bundle.zip
  1. 进入证书目录
cd /opt/module/kibana-9.1.4/config/csr-bundle/kibana
  1. 生成 crt 文件
openssl x509 -req -in kibana.csr -signkey kibana.key -out kibana.crt
  1. 编辑 kibana.yml 文件
vim /opt/module/kibana-9.1.4/config/kibana.yml

内容如下

# 服务端口
server.port: 5601
# 服务主机名
server.host: "lab10"
# 国际化 - 中文
i18n.locale: "zh-CN"
# ES 服务主机地址
elasticsearch.hosts: ["https://lab10:9200"]
# 访问 ES 服务的账号密码
elasticsearch.username: "kibana"
# 需要使用es用户,使用命令 bin/elasticsearch-reset-password -u kibana 获取密码
elasticsearch.password: "hloTe9BBk-4gB8DUwmbY"
elasticsearch.ssl.verificationMode: none
elasticsearch.ssl.certificateAuthorities: [ "/opt/module/elasticsearch-9.1.4/config/certs/elasticsearch-ssl-http/kibana/elasticsearch-ca.pem" ]
server.ssl.enabled: true
server.ssl.certificate: /opt/module/kibana-9.1.4/config/csr-bundle/kibana/kibana.crt
server.ssl.key: /opt/module/kibana-9.1.4/config/csr-bundle/kibana/kibana.key
  1. /opt/module/kibana-8.1.0/ 目录给 es 用户赋予权限
chown -R es:es /opt/module/kibana-9.1.4/
  1. 切换 es 用户
su es
  1. 切换工作目录
cd /opt/module/kibana-9.1.4/
  1. 启动 kibana
bin/kibana

或者

nohup /opt/module/kibana-9.1.4/bin/kibana >kibana.log 2>&1 &
  1. 浏览器访问 https://10.1.1.10:5601/,默认账号为 elastic,默认密码为控制台输出为准,成功登录后的图片

kibana-install-1

【【【 以上完成【kibana-9.1.4】 】】】
【【【 以上完成【kibana-9.1.4】 】】】
【【【 以上完成【kibana-9.1.4】 】】】

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

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

相关文章

反码 原码 补码

一、核心概念:原码、反码、补码(以 8 位二进制为例) 三者均针对“带符号数”(最高位为符号位:0 表示正数,1 表示负数),仅负数的编码规则不同,正数的原/反/补码完全一致。 编码类型 正数(以 +3 为例) 负数(…

.net网站c asp.net 发布网站

题目描述 计算公式&#xff1a;1-1/21/3-1/4……&#xff0c;求前面n(n≤10000)项和&#xff0c;结果保留小数点后面6位。 例如当n4时&#xff0c;和值为0.583333 当n10时&#xff0c;和值为0.645635 输入格式 一个正整数n 输出格式 求出的和值&#xff0c;保留小数点后面6位 …

上海轨道交通建设查询网站阳江房产网58同城网

文章目录 1、文件包含概述1.1 文件包含语句1.1.1、相关配置 1.2、动态包含1.2.1、示例代码1.2.2、本地文件包含1.2.3、远程文件包含 1.3、漏洞原理1.3.1、特点 2、文件包含攻防2.1、利用方法2.1.1、包含图片木马2.1.2、读取敏感文件2.1.3、读取PHP文件源码2.1.4、执行PHP命令2.…

网站建设犀牛云pageadmin是免费的吗

maven依赖关系中Scope的作用 Dependency Scope 在POM 4中&#xff0c;<dependency>中还引入了<scope>&#xff0c;它主要管理依赖的部署。目前<scope>可以使用5个值&#xff1a; * compile&#xff0c;缺省值&#xff0c;适用于所有阶段&#xff0c;会…

沈阳微信网站建设网站建设销售方面会遇到的问题

数据存储量比较大时&#xff0c;我就需要将数据存储在数据库中方便使用&#xff0c;尤其是制作管理系统时&#xff0c;它的用处就更大了。 在编写程序前&#xff0c;需要在Assets文件夹中创建plugins文件&#xff0c;将.dll文件导入&#xff0c;文件从百度网盘自取&#xff1a;…

营口pc网站开发青海住房建设网站

在Java语言中&#xff0c;类的访问修饰符决定了其它类能够访问该类的方式。类有如下4种访问修饰符&#xff0c;在创建类时用于类的声明&#xff1a; 1、public: 当一个类被声明为public时&#xff0c;它可以从任何其他类中被访问&#xff0c;无论这些类位于哪个包中。通常&am…

joomla 网站 html 空免费外贸自建网站

Spring Boot Starter 是 Spring Boot 框架为了简化项目的初始化和配置工作而设计的一种模块化依赖管理方式。它主要具有以下几个关键功能和使用场景&#xff1a; 功能&#xff1a; 1. 依赖管理每个 Starter 都是一组相关的依赖项集合&#xff0c;这些依赖项都是为了实现特定功能…

网站建设步骤ppt基层网站建设存在困难

目录: Nginx的优势 HTTP协议详解 Nginx部署-Yum Nginx配置文件 Nginx编译参数 Nginx基本配置 Nginx日志Log Nginx WEB模块 Nginx 访问限制 Nginx 访问控制 Nginx的优势 Nginx (engine x) 是一个高性能的HTTP(解决C10k的问题)和反向代理服务器&#xff0c;也是一个IM…

移动端网站设计尺寸南宁制作企业服装

目录 1. 使用自定义Favicon 2. 在vue中设置Favicon 3. 使用Vue插件设置Favicon 网页显示的小图标&#xff0c;通常称为Favicon&#xff08;Favorites Icon&#xff09;&#xff0c;是网站的标识之一&#xff0c;也是浏览器标签页上显示的图标。 1. 使用自定义Favicon 准备图…

线性结构常见应用之栈[基于郝斌课程]

栈的定义:一种可以实现“先进后出”的存储结构栈类似于箱子,先放进去的最后取出来,最后放入的先取出来 栈的分类:静态栈的内核是数组动态栈的内核是链表 栈的算法:出栈压栈 栈的应用:函数调用中断表达式求值内存…

实测对比:权威榜单之公众号排版Top 5(含效果对比与适用建议)

在新媒体运营领域,公众号排版是一项至关重要却又让许多人头疼的工作。写作慢、排版耗时、跨平台排版不统一、配图难/侵权风险等问题,一直困扰着公众号/知乎/小红书运营者、新媒体运营新手小白、自媒体人等众多从业者…

东莞微信网站物联网在生活中的应用

java.io.File.setExecutable(boolean executable) 方法来设置所有者对于此抽象路径名执行权限。 声明 以下是 java.io.File.setExecutable(boolean executable) 方法的声明&#xff1a; public boolean setExecutable(boolean executable) 参数 executable -- 设置访问权限为t…

go的泛型

简单例子,把传入的int类型的数据,打印出来,然后返回前两位数值 func forSclice(slice []int) []int {for i, v := range slice {fmt.Println(i, v)}return slice[:2] }如果该方法,支持任何形式的入参呢? func for…

原码补码反码

原码是最高位为符号位,其余位表示数值的绝对值二进制码,反码是正数与原码相同,负数原码按位取反,补码是正数与原码相同,负数是反码加1。 Java整数类型使用的是二进制补码如就是0000 0000 0000 0000 0000 0000 000…

lc1034-边界着色

难度:中等(中期)题目描述有一个二维地图,值代表颜色。 给定一个点的坐标和一个备用的颜色 这个点周围与它颜色一样的部分认为是一个整体 给这块区域的最外层刷上备用颜色示例 输入:grid = [[1,1],[1,2]], row = 0…

网站是用sql2012做的_在发布时可以改变为2008吗湖南人文科技学院在哪

1.什么是web开发 Web&#xff1a;全球广域网&#xff0c;也称为万维网(www World Wide Web)&#xff0c;能够通过浏览器访问的网站。 所以Web开发说白了&#xff0c;就是开发网站的&#xff0c;例如网站&#xff1a;淘宝&#xff0c;京东等等 2. 网站的工作流程 1.首先我们需…

连江县建设局网站企业做网站要注意些什么

目录 1、环境变量process.env配置2、vue package.json多环境配置vue-cli-service serve其他用法vue-cli-service build其他用法vue-cli-service inspect其他用法3、vue导出webpack配置4、配置打包压缩图片文件5、打包去掉多余css(由于依赖问题暂时未实现)6、打包去除console.…

标志设计logo网站广西壮族自治区成立时间

从事java开发一般都需要使用到一些开发工具&#xff0c;记得以前刚接触java的时候还用过MyEclipse。idea被评为最好用java开发工具&#xff0c;为什么用eclipse的人更多?下面一起来了解下吧&#xff01;IDEA毕竟不便宜啊&#xff0c;很多企业都买不起只能用Eclipse了&#xff…

网站建设技术指标做设计什么兼职网站建设

前面我们介绍了Harris和Shi-Tomasi角点检测算法&#xff0c;这两种算法具有旋转不变性&#xff0c;但不具有尺度不变性&#xff0c;以下图为例&#xff0c;在左侧小图中可以检测到角点&#xff0c;但是图像被放大后&#xff0c;在使用同样的窗口&#xff0c;就检测不到角点了。…

赤水市住房和城乡建设局网站网站建设刷赞和vip

目录 1、源码编译安装nginx 2、分别编写基于RHEL6和RHEL7的脚本。 2.1 RHEL6的nginx系统服务脚本 2.2 RHEL7的nginx系统服务脚本 1、源码编译安装nginx 1.首先关闭防火墙和selinux [rootnode13 ~]# systemctl stop firewalld [rootnode13 ~]# setenforce 0 2.准备环境&…