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"]
相关推荐
%d%d228 分钟前
Windows 本地部署小红书 MCP + OpenAI Tunnel + ChatGPT 接入全流程
windows·chatgpt
90后小陈老师15 小时前
Windows 10 下 Gitee SSH 连接配置详解(附常见问题解决)
windows·gitee·ssh
Light Gao17 小时前
MCPHub 路由原理:一个入口如何管理并调用上百个 MCP Server
windows·microsoft
郭涤生17 小时前
Windows + Ubuntu 双系统启动故障修复
linux·windows·ubuntu
Elasticsearch21 小时前
从工具采购到平台架构:重新思考应对机器速度威胁的 SOC
elasticsearch
心勤则明21 小时前
用 Elastic APM 实现分布式日志与链路追踪
elasticsearch
看浪的路人1 天前
第3讲:代码补全引擎
开发语言·windows·python
进击切图仔1 天前
在 windows 和 ubuntu 中配置 host 文件
linux·windows·ubuntu
Elastic 中国社区官方博客1 天前
一个字段,覆盖所有模态:Elasticsearch 的 semantic 字段如何自动索引和搜索图像、音频、视频和 PDF
大数据·数据库·elasticsearch·ai·云原生·pdf·全文检索
烟锁池塘柳01 天前
【亲测有效】Windows上更新NVIDIA显卡驱动的方法
windows·nvidia·显卡驱动