1.术语讲解
cluster:集群
Node:节点
Index:类似mysql的database
Type:类似mysql的table
Doccument:内容
Shard:数据分片,shard的最大默认Doccument数是2,147,483,519
Replicas:数据副本数,查询时也会用到,不仅仅是备份
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
rep:也就是Replicas,默认1
6.创建删除index
index:customer
pretty:显示优化,换行
创建:curl -XPUT 'localhost:9200/customer?pretty'
删除:curl -XDELETE 'localhost:9200/customer?pretty'
index:customer
pretty:显示优化,换行
创建:curl -XPUT 'localhost:9200/customer?pretty'
删除:curl -XDELETE 'localhost:9200/customer?pretty'
7.关于配置
ES_HOME/config目录下:
主配置:elasticsearch.yml
日志配置:logging.yml
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
小结:细节很多,主要看官网的配置文档
下一篇:elk之kibana安装与配置
End;