Elasticsearch核心技术与实战-05-elasticsearch的安装与简单配置-Windows

首先下载elasticsearch的zip包:下载地址

网络不通的解决方法:国内镜像站

es、kibana、logstash均可在华为云开元镜像站自行选择版本下载:下载地址

下载插件包:

bash 复制代码
.\bin\elasticsearch-plugin install analysis-icu
.\bin\elasticsearch-plugin list

网络不通的解决方法:手动下载对应版本的插件包:https://artifacts.elastic.co/downloads/elasticsearch-plugins/analysis-icu/analysis-icu-8.10.4.zip

指定本地文件加载插件:注意地址不要有空格

bash 复制代码
.\bin\elasticsearch-plugin install file:///D:\Program Files\es\analysis-icu-8.10.4.zip

启动elasticsearch:

bash 复制代码
# 单实例
.\bin\elasticsearch
# 指定node名称,集群名称,数据保存地址,后台进程方式启动
# 若指定了集群名称,那么必须要有2个及以上node存在,才可以正常访问es
.\bin\elasticsearch -E node.name=node1 -E cluster.name=geektime -E path.data=node1_data -d
# 多实例启动
.\bin\elasticsearch -E node.name=node1 -E cluster.name=geektime -E path.data=node1_data -d
.\bin\elasticsearch -E node.name=node2 -E cluster.name=geektime -E path.data=node2_data -d
.\bin\elasticsearch -E node.name=node3 -E cluster.name=geektime -E path.data=node3_data -d
# 查看已有节点:
curl -X GET -kv http://127.0.0.1:9200/_cat_nodes

安装遇到的一些问题:

Q:发现只开启了https安全访问,并设置了登录用户名和密码。如何取消它们?

A:/config/elasticsearch.yml中有个配置参数xpack.security.enabled,默认值是true,表示开启ssl协议,并开启强制用户名密码登录访问限制。把这个参数配置为false,重启elasticsearch即可。

Q:多实例(集群启动)时报错:

master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [node-1] to bootstrap a cluster。

A1:后面的实例通过node名称[node-1]发现不了master节点,对应修改配置参数elasticsearch.yml文件

bash 复制代码
cluster.initial_master_nodes: ["node1","node2","node3"]

A2:以指定node名称的方式设置master节点的范围不是很合理,当后续扩容时,不仅要重启已有节点,还需要修改yml配置文件。所以可以通过指定端口的方式来设置master节点范围

bash 复制代码
cluster.initial_master_nodes: ["127.0.0.1:9200"]
相关推荐
攻城狮在此1 小时前
SecureCRT与MobaXterm详细对比:哪个更强、谁更适合你?
windows
ybwycx2 小时前
springboot之集成Elasticsearch
spring boot·后端·elasticsearch
love530love2 小时前
冷门干货!llama.cpp 自带原生网页聊天 UI,无需第三方依赖一键开启
人工智能·windows·ui·llama·flash-attention·switch-cuda
gordon~93 小时前
Windows 11 wsl 中安装的Ubuntu-24.04 中装docker
windows·ubuntu·docker
历程里程碑4 小时前
Protobuf 环境搭建:Windows 与 Linux 系统安装教程
linux·运维·数据结构·windows·线性代数·算法·矩阵
tobebetter95275 小时前
WSL2 + Windows + remote Chrome CDP openclaw 浏览器自动化
chrome·windows·自动化
@PHARAOH6 小时前
WHAT - git worktree 开发的并发模型
大数据·git·elasticsearch
桌面运维家6 小时前
解决Windows 10打印机脱机:端口、驱动、网络故障排除
windows·stm32·单片机
liwulin05066 小时前
【ROS2】【ESP32S3纯透传方案】ESP32S3+WINDOWS+VMware+ROS2+YDLIDA X导航完整落地方案
windows·stm32·单片机
AxureMost7 小时前
MTools 0.0.12-beta 全能工具箱
windows·开源软件