安装环境
(1) 安装ES
① JDK->依赖,ES基于java编写的,需要有JDK依赖
② 下载->https://www.elastic.co/cn/downloads/elasticsearch
③ 启动->./elasticsearch -d
④ 验证->http://localhost:9200/
小坑:如果你启动成功es后,发现无权限进行添加新数据,并且控制台有打印对你磁盘百分比的相关警告,这说明你目前的磁盘可用不足5%,ES会启动只读模式。解决可参考:https://blog.youkuaiyun.com/xudailong_blog/article/details/80850159
(2) 安装Kibana(从版本6.0.0开始,Kibana仅支持64位操作系统。)
① 下载:http://elastic.co
② 启动:依然是开箱即用
Linux:./kibana
Windows:.\kibana.bat
③ 验证:localhost:5601
(3) 安装Head插件(选装):
① 介绍:提供可视化的操作页面对ElasticSearch搜索引擎进行各种设置和数据检索功能,可以很直观的查看集群的健康状况,索引分配情况,还可以管理索引和集群以及提供方便快捷的搜索功能等等。
② 下载:https://github.com/mobz/elasticsearch-head
③ 安装:依赖于node和grunt管理工具(详见笔记head安装)
④ 启动:npm run start
⑤ 验证:http://localhost:9100/
ES工作模式
es分为生产模式和开发模式,当你改动了配置文件时,将会触发生产模式,生产模式会触发es的N多项引导检查,因此学习阶段,我们不改配置,就用开发模式。

集群健康
健康值检查
① _cat/health
② _cluster/health
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 9,
"active_shards" : 9,
"relocating_shards" : 0, //这个发生在节点数发生变动时,在进行迁移中的分片的个数
"initializing_shards" : 0,
"unassigned_shards" : 6,
"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" : 60.0
}
集群健康值(status)
Green
所有Primary Shard和Replica Shard都为active,集群很健康。
Yellow
所有Primary Shard为active,至少1个Replica Shard不可用,此时数据仍然是完整的。
Red
至少有一个Primary Shard不可用,数据不完整,集群不可用
本文详细介绍Elasticsearch、Kibana及Head插件的安装步骤,包括环境要求、下载地址、启动方法及验证方式。同时,解析ES工作模式、集群健康状态及常见问题解决方案。

被折叠的 条评论
为什么被折叠?



