es 基本導入導出操作

  1. 安裝elasticdump 
    首先安裝nodejs
    npm install elasticdump -g
  2. 使用dump導出es數據到json
    #導出data
    elasticdump --input=http://host:9200/draft_eum_210000000000_1_1_7_5 --output=./draft_eum_210000000000_1_1_7_5.json --type=data
    #導出mapping
    elasticdump --input=http://host:9200/draft_eum_210000000000_1_1_7_5 --output=./draft_eum_210000000000_1_1_7_5.json --type=mapping
  3. 使用dump導入es數據
    elasticdump --input=new_field_34_1_1_5_1.jsonl --output=http://121.40.156.209:9201/eum_340000000000_1_1_5_1 
  4. 使用kibana 創建mapping 

    PUT index
    {
        "settings": {
            "number_of_shards": 6
        },
        "mappings": {
            "properties": {
                "latest_enroll_year": {
                    "type": "short"
                },
               "sch_id": {
                    "type": "keyword"
                },
                "enroll_unit_name": {
                    "type": "text",
                    "analyzer": "ik_max_word"
                },
              "is_new_sch": {
                    "type": "boolean"
                },
                "enroll_major_info_list": {
                    "type": "nested",
                    "properties": {
                        "is_new_major": {
                            "type": "boolean"
                        }                   
                    }
                }
            }
        }
    }

     

  5.  

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章