ElasticSearch系列:【Win10环境(版本8.11.1) 】elasticsearch+kibana纪实

news2024/9/29 21:24:56

一、环境

安装环境:win10

JDK:1.8

elasticsearch:8.11.1

kibana:8.11.1

下载地址1(elasticsearch+kibana):Past Releases of Elastic Stack Software | Elastic

i下载地址2(k分词器):Releases · infinilabs/analysis-ik · GitHub

二、ElasticSearch

 (主要参考:Windows安装Elasticsearch8.x保姆级教程)

1、elastic与JDK关系

elasticsearch与JDK版本

2、环境变量配置

1)进入:WIN键搜索并点击 编辑系统环境变量 --> 点击环境变量 --->点击系统变量下新建按钮。

2)输入:变量名输入ES_HOME,变量值为ES的安装目录(bin目录的上级)

3)添加:双击PATH变量--->点击新建—>输入%ES_HOME%\bin

4)输入:变量名输入ES_JAVA_HOME,变量值为JDK目录的路径(与bin目录同级)

3、修改配置文件

1)解决启动日志乱码问题。进入config目录--->打开jvm.options 文件

//文档末尾追加
-Dfile.encoding=GBK

2)修改elasticsearch.yml文件属性

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#设置主节点名字
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#设置索引数据的存储路径
path.data: D:/java/software/elasticsearch-8.11.1/data
#
# Path to log files:
#
#设置日志文件的存储路径
path.logs: D:/java/software/elasticsearch-8.11.1/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
#设置ES监听地址,默认为192.168.0.1; 0.0.0.0: 任意机器都可访问
network.host: 0.0.0.0
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
#设置对外服务的http端口,默认为9200
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["127.0.0.1"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Allow wildcard deletion of indices:
#
#action.destructive_requires_name: false

#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
#
# The following settings, TLS certificates, and keys have been automatically      
# generated to configure Elasticsearch security features on 29-09-2024 06:06:36
#
# --------------------------------------------------------------------------------

3)添加ik分词器

选择与下载的es版本一致的下载,并且在plugins目录下新建ik目录,并且将下载压缩包内容复制到ik目录下,最后终端输入命令。

elasticsearch-plugin list

4、启动服务

终端输入命令elasticsearch.bat,首次启动会输出默认用户名密码。

Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
  rhPUKvPExr+fN-tPDcbp
-> Elasticsearch security features have been automatically configured!
-> Authentication is enabled and cluster connections are encrypted.

->  Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
  rhPUKvPExr+fN-tPDcbp

->  HTTP CA certificate SHA-256 fingerprint:
  4831e55d892d7e7d2a9fde48d15683e704ffb82c155d5bbc2f75fb859ddb15c2

->  Configure Kibana to use this cluster:
* Run Kibana and click the configuration link in the terminal when Kibana starts.
* Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
  eyJ2ZXIiOiI4LjExLjEiLCJhZHIiOlsiMTAuMjM4LjExMi4xOTc6OTIwMCJdLCJmZ3IiOiI0ODMxZTU1ZDg5MmQ3ZTdkMmE5ZmRlNDhkMTU2ODNlNzA0ZmZiODJjMTU1ZDViYmMyZjc1ZmI4NTlkZGIxNWMyIiwia2V5IjoiTlM5a1BKSUJINWx3M3Nsa0oyQzM6dEt2eHlPRUZURUtIOVM5VG9MT0ZzZyJ9

-> Configure other nodes to join this cluster:
* Copy the following enrollment token and start new Elasticsearch nodes with `bin/elasticsearch --enrollment-token <token>` (valid for the next 30 minutes):
  eyJ2ZXIiOiI4LjExLjEiLCJhZHIiOlsiMTAuMjM4LjExMi4xOTc6OTIwMCJdLCJmZ3IiOiI0ODMxZTU1ZDg5MmQ3ZTdkMmE5ZmRlNDhkMTU2ODNlNzA0ZmZiODJjMTU1ZDViYmMyZjc1ZmI4NTlkZGIxNWMyIiwia2V5IjoiTmk5a1BKSUJINWx3M3Nsa0oyQzM6aGxKZlkwejhSNVN0a1VlUHBQRFVVQSJ9

  If you're running in Docker, copy the enrollment token and run:
  `docker run -e "ENROLLMENT_TOKEN=<token>" docker.elastic.co/elasticsearch/elasticsearch:8.11.1`

访问:http://localhost:9200/,输入控制台输出的默认用户名密码则,启动成功。

5、创建新用户以及授权

//添加:终端输入,添加新用户xinuser,并设置密码
//必须先运行ES,elasticsearch不能使用root用户启动,所以我们创建一个新的用户
elasticsearch-8.11.1\bin>elasticsearch-users useradd xinuser
Enter new password:
Retype new password:

权限:终端输入,设置xinuser为超级管理员
elasticsearch-8.11.1\bin>elasticsearch-users roles -a superuser xinuser

权限:终端输入,设置xinuser为kibana用户
elasticsearch-8.11.1\bin>elasticsearch-users roles -a kibana_system xinuser

注意:

1)、随机生成密码(一定要先运行ES)

//终端输入命令
elasticsearch-reset-password -u elastic

New value字段的值就是新的密码,用于忘记密码的情况

2)、指定账号密码(一定要先运行ES):

//终端输入命令
elasticsearch-reset-password --username elastic -i

注:密码至少要六个字符,新密码xxxxxxx

3)、安全配置

elasticsearch.yml 文件运行服务自动生成下列配置:

# 设置是否开启xpack的安全功能,默认true/开启---以xpack开头的配置项都会开启
xpack.security.enabled: false
# 设置是否开启节点的安全注册功能---ChatGPT询问xpack.security.enrollment
xpack.security.enrollment.enabled: true

# 配置X-Pack安全功能中 与 HTTP 通信相关的 SSL 设置
xpack.security.http.ssl:
  # 设置是否开启 HTTP API 客户端连接加密功能---如 Kibana  
  enabled: true
  keystore.path: certs/http.p12
  
# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  # 设置是否启用集群节点之间的加密和相互身份验证功能
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12`

xpack.security.enabled
● 默认true:必须使用账号连接ES
● 若为false:必须使用http://localhost:9200/访问ES服务+启动Kibana服务会失败+使用Spring Data ES和elasticsearch-java依赖,不需要使用账号连接,但必须使用HTTP连接
xpack.security.http.ssl.enabled
● 默认true:必须使用https://localhost:9200/访问ES服务+无论使用Spring Data ES还是elasticsearch-java依赖,都需要使用账号连接+必须使用HTTPS连接
● 若为false:必须使用http://localhost:9200/访问ES服务+启动Kibana服务会失败+使用Spring Data ES和elasticsearch-java依赖,都需要使用账号连接,但必须使用HTTP连接

4)界面可视(未验证过)

下载:点击https://github.com/1340691923/ElasticView/releases/tag/v1.8.7``-->选择win

三、Kibana

1、修改配置文件config/kibana.yml

server.port: 5601

server.host: "localhost"

elasticsearch.hosts: ["http://localhost:9200"]

elasticsearch.username: "xinuser"

#新建的用户密码
elasticsearch.password: "xxxxxxxxx"

i18n.locale: "zh-CN"  

2、启动bin/kibana.bat。

3、访问http://localhost:5601/,输入账号xinuser和密码,即可登录。

四、问题

1、kibana使用ES认用户elastic访问,会无法访问。所以需要创建新用户。创建过程参考第二节的第5小节。

2、提示服务器尚未准备就绪

注意检查下server.host: "localhost" 该属性不能配置为localhost,可以配置为server.host: "0.0.0.0"server.host: "127.0.0.1"

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

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

相关文章

RS HMP4040 直流电源

R&S HMP404 直流电源 苏州新利通仪器仪表 产品综述 单台仪器中最多四个通道 R&SHMP4000 直流电源具有三个或四个输出通道&#xff0c;每个通道的输出电流高达 10 A&#xff0c;主要设计用于工业应用&#xff0c;例如&#xff1a; -生产测试 -维护 -工程实验室 这些…

关于git分支冲突问题

什么是冲突 在Git中&#xff0c;冲突是指两个或多个开发者对同一文件统一部份进行了不同的修改&#xff0c;并且在合并这些修改时&#xff0c;Git无法自动确定应该采用哪种修改而产生的情况。 分支冲突 如何出现并解决 在一个版本时&#xff0c;有一个master分支&#xff0c…

JAVA甜蜜升级情侣专属扭蛋机游戏系统小程序源码

甜蜜升级&#xff01;情侣专属扭蛋机游戏系统&#xff0c;让爱更有趣&#x1f496; &#x1f389; 开篇&#xff1a;爱的游戏新玩法 在爱情的旅途中&#xff0c;我们总在寻找那些能让彼此心跳加速、笑容满面的瞬间。现在&#xff0c;“甜蜜升级情侣专属扭蛋机游戏系统”为你和…

用友畅捷通-TPlus FileUploadHandler.ashx 任意文件上传

0x01 产品描述&#xff1a; ‌用友畅捷通-TPlus‌是由用友集团成员企业畅捷通公司开发的一款企业级财务管理工具&#xff0c;旨在帮助企业实现财务管理的现代化和智能化。作为畅捷通旗下的核心产品&#xff0c;TPlus集成了财务核算、资金管理、预算控制等多项核心功能&#xff…

spring boot 项目中redis的使用,key=value值 如何用命令行来查询并设置值。

1、有一个老项目&#xff0c;用到了网易云信&#xff0c;然后这里面有一个AppKey&#xff0c;然后调用的时候要在header中加入这些标识&#xff0c;进行与服务器进行交互。 2、开发将其存在了redis中&#xff0c;一开始的时候&#xff0c;我们测试用的老的key&#xff0c;然后提…

结合创新!小波变换+注意力机制,实现100%分类准确率

小波变换是一种先进的信号分析技术&#xff0c;它擅长捕捉信号的局部特征&#xff0c;但有时可能会忽略数据中的关键信息。为了克服这一局限&#xff0c;我们引入了注意力机制&#xff0c;这一机制能够强化模型对数据重要部分的关注。通过将小波变换与注意力机制相结合&#xf…

SD2.0 Specification之CRC(Cyclic Redundancy Code)

文章目录 本文章主要讲解关于SD2.0中的CRC应用&#xff0c;其它基础概念和其它内容请参考以下文章。 SD2.0 Specification简述 CRC全称为Cyclic Redundancy Code&#xff0c;中文名称是循环冗余校验&#xff0c;该方法通过附加冗余数据来保证数据的完整性&#xff0c;即用于检…

一类医疗器械产品分类目录 2002版

医疗医疗器械备案申请时&#xff0c;需要填写老的分类目录表&#xff08;2022版&#xff09; 在网上找了很多&#xff0c;都没有Word的&#xff0c;于是自己到官网上整理了一份分享给用到的朋友&#xff01; 下载地址&#xff1a; 一类医疗器械产品分类目录2002版资源-CSDN…

latex作者介绍添加,以及作者介绍段落间距调整(看这篇就够了)

文章目录 1.latex语句如何添加作者的介绍和照片2.作者介绍段落和段落之间的距离太大如何调整 1.latex语句如何添加作者的介绍和照片 \begin{IEEEbiography}[{\includegraphics[width1in,height1.25in,clip,keepaspectratio]{图像存放地址}}]{作者姓名} 这里写作者介绍 \end{IE…

Qt --- 界面优化 --- QSS和绘图API

界面优化 》美化 一个程序的界面是否好看&#xff0c;是否重要呢。 有些面向专业领域的程序&#xff0c;界面好看与否&#xff0c;不是看关键&#xff0c;更关键的是实际的效果。有些面向普通用户领域的程序&#xff0c;界面好看&#xff0c;还是很大的加分项。 界面优化 Qt…

基于单片机的多路温度检测系统

**单片机设计介绍&#xff0c;基于单片机CAN总线的多路温度检测系统设计 文章目录 前言概要功能设计设计思路 软件设计效果图 程序设计程序 前言 &#x1f497;博主介绍&#xff1a;✌全网粉丝10W,CSDN特邀作者、博客专家、CSDN新星计划导师&#xff0c;一名热衷于单片机技术探…

【Vue3】组件元素定义的ref属性和expose,setup返回值的关系

1、实例代码 首先一个测试结果: 1、在组件模版中元素定义的ref属性&#xff0c;会在编译阶段生成对应的props数据&#xff0c;作为参数传入到创建这个ref所在元素的vnode的方法中。 2、如果ref定义在一般的元素中&#xff0c;那么ref就指向这个元素的dom实例&#xff0c;如果re…

6.824 Lab 2C 学习记录

2C的test中的unreliable figure8算是给博主的迎头一棒&#xff0c;需要根据raft论文的figure8进行解决&#xff0c;leader无法提交不属于currentTerm的日志&#xff0c;当确定committed到当前term时才能apply。 这一步没做到时&#xff0c;报错大概率为applied error&#xff0…

leetcode 450.删除二叉搜索树中的结点

1.题目要求: 给定一个二叉搜索树的根节点 root 和一个值 key&#xff0c;删除二叉搜索树中的 key 对应的节点&#xff0c;并保证二叉搜索树的性质不变。返回二叉搜索树&#xff08;有可能被更新&#xff09;的根节点的引用。一般来说&#xff0c;删除节点可分为两个步骤&#…

SpringBoot--为什么Controller是串行的?怎样才能并行?

原文网址&#xff1a;SpringBoot--为什么Controller是串行的&#xff1f;怎样才能并行&#xff1f;-CSDN博客 简介 本文介绍SpringBoot为什么Controller是串行的&#xff1f;在什么场景下才能并行执行&#xff1f; 大家都知道&#xff0c;SpringBoot的Controller按理是并行执…

STM32DMA学习日记

STM32 DMA学习日记 写于2024/9/28晚 文章目录 STM32 DMA学习日记1. DMA简介2. I/O方式2.1 程序查询方式2.2 程序中断方式2.3 DMA方式 3.DMA框图4. 相关寄存器4.1 DMA中断状态寄存器&#xff08;DMA_ISR&#xff09;4.2 DMA中断标志清除寄存器&#xff08;DMA_IFCR&#xff09;…

3. 将GitHub上的开源项目导入(clone)到本地pycharm上——深度学习·科研实践·从0到1

目录 1. 在github上搜项目 (以OpenOcc为例&#xff09; 2. 转移到码云Gitee上 3. 下载整个项目到本地 4. 在pycharm中打开项目 1. 在github上搜项目 (以OpenOcc为例&#xff09; 把链接复制下来&#xff0c;转移到国内Gitee上&#xff0c;会更稳定 2. 转移到码云Gitee上 &…

IT基础监控范围和对象

监控易作为一款由美信时代独立自主研发的分布式一体化集中监控平台&#xff0c;其监控范围极为广泛&#xff0c;几乎涵盖了所有主流的IT基础设施以及相关的设备和系统。以下是对监控易监控范围的详细介绍&#xff1a; 一、IT基础资源监控 服务器硬件监控&#xff1a;监控易支…

【CAM350】使用总结 <二>{ 光绘Gerber 比较 }

一、 比较两份版本不同的光绘文件&#xff1a; //Analysis-Compare layers// 二、参数默认&#xff0c;比较完成给出结果 三、也可以直接在一份文件上选择“Draw on top” 四、对比差距直观可见

PageHelper - MyBatis 分页插件

如果你也在用 MyBatis&#xff0c;建议尝试该分页插件&#xff0c;这一定是最方便使用的分页插件。分页插件支持任何复杂的单表、多表分页。 学习任何知识都推荐查看它的官方文档&#xff1a;MyBatis 分页插件 PageHelper 文档里面介绍了很多&#xff0c;我这里谈一下我的理解&…