elk之elasticsearch安装与配置

本文档详细介绍了如何在Ubuntu系统中安装和配置Elasticsearch 2.2.0。首先,确保安装了JRE作为Elasticsearch的运行依赖。接着,从官方网站下载Elasticsearch的2.2.0版本,并进行解压。通过提供的步骤,你可以成功设置并启动Elasticsearch服务。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.术语讲解
cluster:集群
Node:节点
Index:类似mysql的database
Type:类似mysql的table
Doccument:内容
Shard:数据分片,shard的最大默认Doccument数是2,147,483,519
Replicas:数据副本数,查询时也会用到,不仅仅是备份


2.安装

(a)elasticsearch运行依赖jre,jre的安装可参考:ubuntu安装jre

(b)下载地址:https://www.elastic.co/,点击右上角downloads

(c)我选择的版本是elasticsearch-2.2.0.tar.gz

(d)解压:tar -zxvf elasticsearch-2.2.0.tar.gz
(e)解压即可用,执行程序在bin目录下面
(f)后台运行:./elasticsearch -d

3.检查集群健康状态
curl 'localhost:9200/_cat/health?v'
status有三种:Green,yellow,red


4.检查集群的节点
curl 'localhost:9200/_cat/nodes?v'
*号标注的节点是master节点


5.显示所有的index
curl 'localhost:9200/_cat/indices?v'

pri:也就是shard,默认5
rep:也就是Replicas,默认1

6.创建删除index
index:customer
pretty:显示优化,换行
创建:curl -XPUT 'localhost:9200/customer?pretty'
删除:curl -XDELETE 'localhost:9200/customer?pretty'

7.关于配置
ES_HOME/config目录下:
主配置:elasticsearch.yml
日志配置:logging.yml
单点elasticsearch的配置参考:
cluster.name: bs2test
network.host: 0.0.0.0
path.logs: /data/elasticsearch/logs
path.data: /data/elasticsearch/data


小结:细节很多,主要看官网的配置文档

End;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值