03_ElasticSearch下载安装

这篇具有很好参考价值的文章主要介绍了03_ElasticSearch下载安装。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

概述

ElasticSearch是java开发的,jdk环境是必不可少的,至少有jre环境

1 下载ElasticSearch

最新版本需要访问 ElasticSearch 官网下载:https://www.elastic.co/cn/downloads/elasticsearch,

其他版本见Elastic 中文社区,地址:https://elasticsearch.cn/download
注意版本,不同的版本差异比较大,选择适合自己的版本

2. 安装

java 程序启动在不同的环境下是不一样的,但是解压后不需要特殊的安装,只需要找到bin目录使用命令启动即可

03_ElasticSearch下载安装,# ES,elasticsearch,大数据,搜索引擎

2.1 配置环境变量, 方便后期使用命令启动,而不是每次都去bin目录

我用的mac本就截图了 其他的自己百度吧 比较简单

vim ~/.bash_profile 

增加内容:

自己的解压目录
ES_HOME=/Users/XXX/java/es/elasticsearch-7.17.3 
PATH=$PATH:$ES_HOME/bin
export ES_HOME

配置问就可以 在终端 执行
正常 应该是elasticsearch 命令, 我为了简单 修改成 es 命令了

es
在后端启动
es -d 

启动后直接访问:
localhost:9200

mac 环境变量 终端关闭后不生效问题

在 ~/.bash_profile 中配置环境变量, 每次重启终端后配置的环境变量不生效。

需要重新执行 : $source ~/.bash_profile才可以。

是因为zsh加载的是 ~/.zshrc文件,而 '.zshrc’文件中并没有定义环境变量。

解决办法:

vi ~/.zshrc

在~/.zshrc文件最后,增加一行:

source ~/.bash_profile

最后

source ~/.zshrc

已经解决了问题,那么我们想问 .bash_profile 和 .zshrc 这两个文件有什么区别呢?

.bash_profile 修改的环境变量只对当前窗口有效,而且需要 source 一下,.zshrc 则相当于 win 开机启动的环境变量,可以在 .zshrc 中加上一个 source 更新 .bash_profile 命令即可解决问题

集群配置

如果刚开始学习,完全没必要配置集群 直接单机学习就可以, 集群反正各种问题,这里我只写一个配置文件,遇到问题自己百度吧/
把自己的解压文件拷贝几分,修改 config下的配置文件


# Use a descriptive name for your cluster:
##集群名称,节点之间要保持一致
cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
# #节点名称,集群内要唯一
node.name: node-1
node.master: true
node.data: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
# node-01
# 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:
# #ip 地址
network.host: 10.0.72.59
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
# #http 端口
http.port: 1001
#tcp 监听端口
transport.tcp.port: 9301
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# 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"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
#
# ---------------------------------- Security ----------------------------------
#
#                                 *** WARNING ***
#
# Elasticsearch security features are not enabled by default.
# These features are free, but require configuration changes to enable them.
# This means that users don’t have to provide credentials and can get full access
# to the cluster. Network connections are also not encrypted.
#
# To protect your data, we strongly encourage you to enable the Elasticsearch security features. 
# Refer to the following documentation for instructions.
#
# https://www.elastic.co/guide/en/elasticsearch/reference/7.16/configuring-stack-security.html


discovery.seed_hosts: ["localhost:9301", "localhost:9302","localhost:9303"]
discovery.zen.fd.ping_timeout: 1m
discovery.zen.fd.ping_retries: 5
#集群内的可以被选为主节点的节点列表
cluster.initial_master_nodes: ["node-1", "node-2","node-3"]
#跨域配置
#action.destructive_requires_name: true
http.cors.enabled: true
http.cors.allow-origin: "*"







访问集群是否正常启动:
GET http://127.0.0.1:1001/_cluster/health
GET http://127.0.0.1:1002/_cluster/health
GET http://127.0.0.1:1003/_cluster/health
返回结果:

{
    "cluster_name": "my-application",
    "status": "green",
    "timed_out": false,
    "number_of_nodes": 3,
    "number_of_data_nodes": 3,
    "active_primary_shards": 0,
    "active_shards": 0,
    "relocating_shards": 0,
    "initializing_shards": 0,
    "unassigned_shards": 0,
    "delayed_unassigned_shards": 0,
    "number_of_pending_tasks": 0,
    "number_of_in_flight_fetch": 0,
    "task_max_waiting_in_queue_millis": 0,
    "active_shards_percent_as_number": 100.0
}

status字段指示着当前集群在总体上是否工作正常。它的三种颜色含义如下:

green:所有的主分片和副本分片都正常运行。
yellow:所有的主分片都正常运行,但不是所有的副本分片都正常运行。
red:有主分片没能正常运行。

配置内存设置文件jvm.options

文件路径:/var/huaxing/elasticsearch-7.4.2/config

内存容量较小时修改默认配置:-Xms1g -Xmx1g为-Xms512m -Xmx512m。文章来源地址https://www.toymoban.com/news/detail-732873.html

到了这里,关于03_ElasticSearch下载安装的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • ES搜索引擎入门+最佳实践(九):项目实战(二)--elasticsearch java api 进行数据增删改查

            本篇是这个系列的最后一篇了,在这之前可以先看看前面的内容: ES搜索引擎入门+最佳实践(一)_flame.liu的博客-CSDN博客 ES搜索引擎入门+最佳实践(二)_flame.liu的博客-CSDN博客 ES搜索引擎入门+最佳实践(三)_flame.liu的博客-CSDN博客 ES搜索引擎入门+最佳实践(四)_flame.liu的博客

    2024年02月12日
    浏览(42)
  • Java SpringBoot API 实现ES(Elasticsearch)搜索引擎的一系列操作(超详细)(模拟数据库操作)

    小编使用的是elasticsearch-7.3.2 基础说明: 启动:进入elasticsearch-7.3.2/bin目录,双击elasticsearch.bat进行启动,当出现一下界面说明,启动成功。也可以访问http://localhost:9200/ 启动ES管理:进入elasticsearch-head-master文件夹,然后进入cmd命令界面,输入npm run start 即可启动。访问http

    2024年02月04日
    浏览(44)
  • 使用Logstash同步mysql数据到Elasticsearch(亲自踩坑)_将mysql中的数据导入es搜索引擎利用logstash(1)

    先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7 深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前! 因此收集整理了一份《2024年最新大数据全套学习资料》,

    2024年04月28日
    浏览(39)
  • Spring Cloud学习(十一)【深入Elasticsearch 分布式搜索引擎03】

    聚合(aggregations)可以实现对文档数据的统计、分析、运算。聚合常见的有三类: 桶(Bucket)聚合:用来对文档做分组 TermAggregation:按照文档字段值分组 Date Histogram:按照日期阶梯分组,例如一周为一组,或者一月为一组 度量(Metric)聚合:用以计算一些值,比如:最大值

    2024年01月23日
    浏览(37)
  • ElasticSearch内容分享(四):ES搜索引擎

    目录 ES搜索引擎 1. DSL设置查询条件 1.1 DSL查询分类 1.2 全文检索查询 1.2.1 使用场景 1.2.2 match查询 1.2.3 mulit_match查询 1.3 精准查询 1.3.1 term查询 1.3.2 range查询 1.4 地理坐标查询 1.4.1 矩形范围查询 1.4.2 附近(圆形)查询 1.5 复合查询 1.5.0 复合查询归纳 1.5.1 相关性算分 1.5.2 算分函数查

    2024年02月05日
    浏览(41)
  • 入门ElasticSearch :为什么选择ES作为搜索引擎?

    随着数据量的不断增长,搜索和分析大规模数据集变得越来越重要。传统数据库在面对这种需求时往往表现不佳,这时候就需要一种专门用于搜索和分析的引擎。ElasticSearch (简称ES)就是这样一款强大的搜索引擎,它具有许多优势,使得它成为许多企业和开发者的首选。 简

    2024年02月09日
    浏览(36)
  • ES可视化工具--elasticsearch-head--下载、安装、使用

    原文网址:ES可视化工具--elasticsearch-head--下载、安装、使用_IT利刃鞘的博客-CSDN博客 说明         本文介绍ES可视化工具--ElasticSearch-Head的下载、安装与安装的方法。 概述         虽然UI比较古老,但它能在“数据浏览”中选择索引、类型、字段查看,个人用起来比下边“

    2024年01月18日
    浏览(52)
  • Elasticsearch (ES) 搜索引擎: 搜索功能:搜索分页、搜索匹配、全文搜索、搜索建议、字段排序

    原文链接:https://xiets.blog.csdn.net/article/details/132348920 版权声明:原创文章禁止转载 专栏目录:Elasticsearch 专栏(总目录) ES 搜索 API 官网文档:Search APIs 先创建一个索引,并写入一些文档用于搜索示例: 写入一些文档示例: 官网API:The _source option 搜索结果中的文档数据封装

    2024年02月08日
    浏览(45)
  • 搜索引擎ElasticSearch分布式搜索和分析引擎学习,SpringBoot整合ES个人心得

    Elasticsearch是一个基于Lucene的搜索服务器。它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口。Elasticsearch是用Java语言开发的,并作为Apache许可条款下的开放源码发布,是一种流行的企业级搜索引擎。Elasticsearch用于云计算中,能够达到实时搜索,稳定,可靠,

    2024年02月04日
    浏览(57)
  • elasticsearch(ES)分布式搜索引擎01——(初识ES,索引库操作和文档操作,RestClient操作索引库和文档)

    1.1.1.elasticsearch的作用 elasticsearch是一款非常强大的开源搜索引擎,具备非常多强大功能,可以帮助我们从海量数据中快速找到需要的内容 1.1.2.ELK技术栈 elasticsearch结合kibana、Logstash、Beats,也就是elastic stack(ELK)。被广泛应用在日志数据分析、实时监控等领域: 而elasticsearc

    2024年02月07日
    浏览(48)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包