elasticSearch7.9数据占用磁盘存储空间情况

最近,在VMware Workstation虚拟机上安装了es7.9,单节点的es,不是集群,然后建了一个索引(包含3个分片和一个副本),插入了500万条数据,占据磁盘空间17G。如下图:

=============================================================

索引的字段如下,仅供参考:

PUT my_log
{
  "settings":{
    "index":{
      "number_of_shards":"3",
      "number_of_replicas":"1"
    }
  },
  "mappings": {
    "properties": {
      "logId ": {
        "type": "keyword"
      },
      "xxxId": {
        "type": "keyword"
      },
      "xxxDataId": {
        "type": "keyword"
      },
      "xxxeName": {
        "type": "keyword"
      },
      "souxxxpic": {
        "type":"keyword"
      },
     "souxxxoup": {
        "type":"keyword"
      },
     "tarxxxame": {
        "type":"keyword"
      },
     "callxxxeMode": {
        "type":"keyword"
      },
     "callTxxxdeName": {
        "type":"keyword"
      },
     "mxxxce": {
        "type":"keyword"
      },
     "datxxxory": {
        "type": "keyword"
      },
     "daxxxame": {
        "type":"keyword"
      },
     "filexxxId": {
        "type":"keyword"
      },
     "filexxxName": {
        "type":"keyword"
      },
     "fixxxype": {
        "type":"keyword"
      },
     "filxxxName": {
        "type":"text"
      },
     "logxxxName": {
        "type":"text"
      },
     "loxxxpe": {
        "type":"keyword"
      },
     "buxxxtage": {
        "type":"keyword"
      },
     "buxxxeName": {
        "type":"text"
      },
     "buixxxgeTime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "buinxxxeStatus": {
        "type": "keyword"
      },
     "buixxxatusName": {
        "type":"keyword"
      },
     "rexxxMode": {
        "type": "keyword"
      },
     "recxxxdeName": {
        "type":"keyword"
      },
     "creaxxxTime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "rexxxime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "msgSxxxTime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "callTarxxxime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "begxxxxime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "endRexxxgTime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "resolxxxdTime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "getFxxxTime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "getFixxxTime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "resoxxxnTime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "resxxxndTime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "saveFixxxdTime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.SSS"
      },
     "successNumber": {
        "type": "long"
      },
     "errorNumber": {
        "type": "long"
      },
     "buinessNumber": {
        "type": "long"
      },
     "descInfo": {
        "type": "text"
      }
    }
  }
}

Elasticsearch 7.9中,创建索引是一个基本操作,用于存储和检索数据。以下是创建索引的步骤: 1. **打开Elasticsearch客户端**:你可以使用curl命令行工具,Elasticsearch REST API客户端(如Sense或Beats中的Kibana Dev Tools),或者Elasticsearch的Java、Python等官方客户端库。 2. **定义索引信息**:首先,你需要指定索引的名字。例如,如果你想创建一个名为`my-index`的索引,可以这样表示: ```json { "index": { "name": "my-index" } } ``` 3. **发送请求**:将这个JSON结构作为POST请求发送到`/_create`端点。完整的URL可能是`http://localhost:9200/my-index/_create`,其中`localhost:9200`是Elasticsearch的默认地址,需要根据实际情况替换。 示例用curl命令: ```sh curl -X POST 'http://localhost:9200/my-index/_create' -H 'Content-Type: application/json' -d ' { "index": { "name": "my-index" } } ' ``` 4. **检查响应**:如果索引创建成功,Elasticsearch会返回一个响应确认索引已创建。如果索引已经存在,或者创建过程中出现错误,响应会包含相应的错误信息。 5. **配置索引模板**(可选):为了更高效地管理索引,可以预先定义索引模板,设置字段映射、分析器等属性。 6. **将文档插入索引**:创建索引后,你可以开始将文档(通常是JSON格式)插入到索引中。 注意:在实际使用中,可能还需要设置一些选项,比如分片和副本数,以提高查询性能和容错性。具体配置应根据应用需求调整。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值