elasticsearch学习(一) 下载、安装和初次部署

目录

前言

本系列文章是笔者学习elasticsearch的过程进行笔记,记录自己学习的理解与步骤,以及踩的坑,以便后面的查看

硬件配置

MacBook Pro

3-inch, 2020, Four Thunderbolt 3 ports

i5 16G内存

下载elasticsearch连接

https://www.elastic.co/downloads/elasticsearch

下载后解压缩

复制代码
➜  elasticsearch-9.1.2 ls
bin             jdk.app         logs            plugins
config          lib             modules         README.asciidoc
data            LICENSE.txt     NOTICE.txt
复制代码
➜  bin pwd
/Users/lu/lu/elasticsearch-9.1.2/bin
➜  bin elasticsearch

访问http://localhost:9200/

复制代码
{
  "name" : "192.168.0.121",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "7udK45LfQ9-mA03W54KI-A",
  "version" : {
    "number" : "9.1.2",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "ca1a70216fbdefbef3c65b1dff04903ea5964ef5",
    "build_date" : "2025-08-11T15:04:41.449624592Z",
    "build_snapshot" : false,
    "lucene_version" : "10.2.2",
    "minimum_wire_compatibility_version" : "8.19.0",
    "minimum_index_compatibility_version" : "8.0.0"
  },
  "tagline" : "You Know, for Search"
}

问题

1 无法访问9200

原因:开启了ssl

解决方案:关闭ssl

修改 config/elasticsearch.yml

复制代码
➜  config vi elasticsearch.yml
xpack.security.http.ssl:
  enabled: false ##改成false
  keystore.path: certs/http.p12

2 9200需要帐号密码

原因:在初次启动时,会生成默认用户的elastic的密码,需要帐号密码才能进页面

解决方案:初次启动时,记录密码/重置密码

复制代码
➜  bin elasticsearch-reset-password -u elastic
warning: ignoring JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home; using bundled JDK
This tool will reset the password of the [elastic] user to an autogenerated value.
The password will be printed in the console.
Please confirm that you would like to continue [y/N]y
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
#network.host: 192.168.0.1
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
#


Password for the [elastic] user successfully reset.
New value: qydrnApyblAbk=RS-2A1
相关推荐
武子康3 分钟前
大数据-189 Nginx JSON 日志接入 ELK:ZK+Kafka+Elasticsearch 7.3.0+Kibana 实战搭建
大数据·后端·elasticsearch
陈橘又青7 分钟前
开创性的初创企业利用 Amazon SageMaker孵化器释放企业价值
人工智能·网络协议·学习·ai·编辑器
weixin_3077791311 分钟前
Jenkins Pipeline: Input Step插件详解与实践指南
运维·开发语言·自动化·jenkins·etl
小兜全糖(xdqt)13 分钟前
.net 8 添加swagger以及批量index,批量删除 elasticsearch
elasticsearch·jenkins·.net
走在路上的菜鸟17 分钟前
Android学Dart学习笔记第二十二节 类-扩展方法
android·笔记·学习·flutter
TL滕21 分钟前
从0开始学算法——第二十天(简易搜索引擎)
笔记·学习·算法
你好~每一天31 分钟前
数据分析专员:当传统汽车销售融入AI智能,如何驱动业绩新增长
大数据·数据结构·人工智能·学习·数据分析·汽车·高性价比
✎ ﹏梦醒͜ღ҉繁华落℘33 分钟前
计算机网络学习(三)-- IP地址 和 MAC 地址如何转换,以太网
学习·tcp/ip·计算机网络
秦奈1 小时前
Unity复习学习笔记(七):NGUI
笔记·学习·unity
行业探路者1 小时前
网站二维码的全解析与使用技巧分享
大数据·人工智能·学习·产品运营·软件工程