Springboot 整合 Elasticsearch(一):Linux下安装 Elasticsearch 8.x

 1、下载安装包,官方下载地址:

Past Releases of Elastic Stack Software | Elastic

elasticsearch-8.8.1-linux-x86_64.tar.gz

 2、拷贝到 Linux 服务器上, 执行解压缩命令

安装包路径:/home/ELK_8.8.1

[root@localhost ELK_8.8.1]# tar -zxvf elasticsearch-8.8.1-linux-x86_64.tar.gz

3、Elasticsearch 不能使用 root用户启动,创建 es 用户

创建新用户es:

[root@localhost ELK_8.8.1]# useradd es

设置密码:

[root@localhost ELK_8.8.1]# passwd es

设置权限:

[root@localhost ELK_8.8.1]# chown -R es:es /home/ELK_8.8.1/elasticsearch-8.8.1

4、 修改 elasticsearch.yml

为了测试,先关闭一下认证,改成 false:

# Enable security features
xpack.security.enabled: false

xpack.security.enrollment.enabled: false

# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
  enabled: false
  keystore.path: certs/http.p12

# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  enabled: false
  verification_mode: certificate

5、切换用户,启动 Elasticsearch

[root@localhost ELK_8.8.1]# cd elasticsearch-8.8.1/bin/

[root@localhost bin]# su es


[es@localhost bin]$ ./elasticsearch -d  ( -d 表示后台启动)

6、验证 Elasticsearch是否启动成功

浏览器网址输入:Elasticsearch安装的服务器IP:9200,出现以下内容,证明服务启动正常;

{
  "name" : "localhost.localdomain",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "pSTONQoCS0yYIPrvx4KY6w",
  "version" : {
    "number" : "8.8.1",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "f8edfccba429b6477927a7c1ce1bc6729521305e",
    "build_date" : "2023-06-05T21:32:25.188464208Z",
    "build_snapshot" : false,
    "lucene_version" : "9.6.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值