mac安装elasticsearch8.x

es下载地址:

Past Releases of Elastic Stack Software | Elastic

复制代码
https://www.elastic.co/cn/downloads/past-releases#elasticsearch

选择8.10版本

进入es bin目录下执行启动命令

复制代码
./elasticsearch

这个时候localhost:9200无法访问

原因是是因为开启了ssl认证。

新开命令窗口通过命令测试

修改密码需要在es启动,并cd到es的bin目录下执行

1.重置密码并在控制台显示新密码(密码是自动生成的复杂度较高)

复制代码
./elasticsearch-reset-password -u 用户名  

例:重置elastic用户的密码:

复制代码
./elasticsearch-reset-password -u elastic
  1. 给用户修改指定的密码:

    ./elasticsearch-reset-password --username 用户名 -i

例:重置elastic用户的密码为elastic

复制代码
./elasticsearch-reset-password --username elastic -i  

执行命令之后,输入y 在输入两次密码即可。

测试是否启动成功,用上面重置的密码替换掉下面命令中Y+Hfk00S90PCNFuQLyDT的密码部分

复制代码
curl --cacert /Users/wangfengchen/Downloads/elasticsearch/elasticsearch-8.11.0/config/certs/http_ca.crt -u "elastic:Y+Hfk00S90PCNFuQLyDT" https://localhost:9200

如果想用页面访问,在config/elasticsearch.yml文件中把xpack.security.http.ssl:enabled设置成false然后重启es即可,然后用命令访问,此时不用https即可。

复制代码
curl --cacert /Users/wangfengchen/Downloads/elasticsearch/elasticsearch-8.11.0/config/certs/http_ca.crt -u "elastic:elastic" http://localhost:9200

再用页面也可访问。

守护进程方式启动

复制代码
./elasticsearch -d

查看es进程

复制代码
ps -ef|grep elasticsearch
相关推荐
szarron14 分钟前
HTOOL‑SA12 + HT06 近场探头组合实操|手持设备工位 EMI 预兼容排查完整流程
运维·服务器·开发语言·网络·射频工程·频谱仪
杨云龙UP14 分钟前
DB2 HADR 主备架构活动日志参数优化操作手册
linux·运维·服务器·数据库·db2·db2 hadr·日志参数调整
csdn_aspnet25 分钟前
如何从电脑主机拷东西到VWmare虚拟机
linux·运维·服务器·windows·vmware·虚拟机
码农幻想梦33 分钟前
“找不到 www.bilibili.com 的服务器 IP 地址”解决办法
运维·服务器·tcp/ip
Vcaker40 分钟前
Linux学习28-Kubernetes service
linux·运维·学习
那年窗外下的雪.1 小时前
AIDC 学习日志|第 25 天|设备输出反推、MAC Flapping 与 EAD 撤销
前端·网络·git·学习·macos
Huangjin007_1 小时前
【Linux 系统篇(二十)】进程(八):进程创建、进程退出
linux·运维·服务器
海宇数据1 小时前
零信任架构实战:基于海宇对外投资历史查询服务构建自动化异动企业筛查网关
运维·人工智能·架构·自动化
星辰即远方2 小时前
RunLoop初步了解
macos·objective-c·cocoa
吴声子夜歌2 小时前
Shell编程——开发规范
linux·运维·shell