概念和集群

概念

存储数据到 Elasticsearch 的行为叫做 索引 (indexing)

关于数据的概念

Relational DB -> Databases 数据库 -> Tables 表 -> Rows 行 -> Columns 列
Elasticsearch -> Indices 索引库 -> Types 类型 -> Documents 文档 -> Fields 字段/属性

一个 Elasticsearch 集群可以 包含多个 索引 (indices 数据库),相应的每个索引可以包含多个 类型(type 表) 。 这些不同的类型存储着多个 文档(document 数据行) ,每个文档又有 多个 属性 (field 列)。

3. 集群

  • 实现了复制, 并且自动故障转移
  • 实现了分片, 提高吞吐量

  • 访问ES
    • 使用POSTMAN
    • 终端curl命令
curl -X http请求方式 url -H 请求头字段 -d 请求体数据
curl -X GET 127.0.0.1:9200/_cluster/health?pretty  # 设置?pretty可以进行格式化显示
curl -X PUT 127.0.0.1:9200/article -H 'Content-Type:application/json' -d '
{

}'
  • 查看集群状态
curl -X GET 127.0.0.1:9200/_cluster/health?pretty

猜你喜欢

转载自www.cnblogs.com/oklizz/p/11443243.html