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
相关推荐
甲鱼9296 小时前
MySQL 实战手记:日志管理与主从复制搭建全指南
运维
碳基沙盒2 天前
OpenClaw 多 Agent 配置实战指南
运维
pe7er4 天前
macOS 应用无法打开(权限问题)解决方案
macos·mac
蝎子莱莱爱打怪5 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes
DianSan_ERP6 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
呉師傅6 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
不是二师兄的八戒6 天前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
zhangfeng11336 天前
趋动云 如何ssh登录 服务区 项目server
运维·人工智能·ssh
ZeroNews内网穿透6 天前
谷歌封杀OpenClaw背后:本地部署或是出路
运维·服务器·数据库·安全
失重外太空啦6 天前
nginx
运维·nginx