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
相关推荐
FIT2CLOUD飞致云7 小时前
操作教程|使用Cursor工具连接JumpServer资产
运维·开源
会飞的小蛮猪8 小时前
Jenkins运维之路(Slave容器节点)
运维·ci/cd·jenkins
刘立军13 小时前
内网的服务如何能在公网使用?
运维
飞询14 小时前
docker 部署 sftp
运维·docker
goodSleep1 天前
更新Mac OS Tahoe26用命令恢复 Mac 启动台时不小心禁用了聚焦搜索
macos
云偶1 天前
从零搭建 Jenkins Android 自动发包体系
jenkins
LH_R2 天前
OneTerm开源堡垒机实战(四):访问授权与安全管控
运维·后端·安全
Raymond运维2 天前
MariaDB源码编译安装(二)
运维·数据库·mariadb
libraG2 天前
Jenkins打包问题
前端·npm·jenkins
JuiceFS2 天前
从 MLPerf Storage v2.0 看 AI 训练中的存储性能与扩展能力
运维·后端