ES 常用API:创建索引,创建别名,重建索引
华为云不同版本间索引同步数据(目前华为后台工具不能跨版本间同步数据):
ES 常用API:创建索引,创建别名,重建索引
华为云不同版本间索引同步数据(目前华为后台工具不能跨版本间同步数据):
elasticdump --input http://admin:123456@ip:9200/sensitive_1_v15 --output http://admin:123123@ip2:9200/sensitive_1_v14 --type=settings
elasticdump --input http://admin:123456@ip:9200/sensitive_1_v15 --output http://admin:123123@ip2:9200/sensitive_1_v14 --type=mapping
elasticdump --input http://admin:123456@ip:9200/sensitive_1_v15 --output http://admin:123123@ip2:9200/sensitive_1_v14 --limit=10000 --type=data
常用api:
查询当前的查询任务:http://ip:9200/_cat/tasks?v&detailed=true
查询当前的索引结构:http://ip:9210/sensitive_1_v13
查询实例所有所有:http://ip:9210/_cat/indices?v
创建索引:http://ip:9202/sensitive_1_v12
{
"sensitive_1_v12": {
"aliases": {
},
"mappings": {
"properties": {
"AddTime": {
"type": "date"
},
"Brand": {
"type": "keyword",
"normalizer": "lowercase_analyzer"
},
"BrandLen": {
"type": "integer"
},
"BrandUpper": {
"type": "keyword"
},
"CategoryIds": {
"type": "text",
"analyzer": "digit_analyzer"
},
"Country": {
"type": "text",
"analyzer": "digit_analyzer"
},
"GoogleWordLabel": {
"type": "keyword"
},
"Id": {
"type": "keyword"
},
"ImportTime": {
"type": "date"
},
"IsIncludeCategory": {
"type": "keyword"
},
"IsSetRiskDetect": {
"type": "boolean"
},
"IsSimilar": {
"type": "boolean"
},
"LabelStatus": {
"type": "keyword"
},
"NiceCl": {
"type": "text",
"analyzer": "digit_analyzer"
},
"PlatformIds": {
"type": "text",
"analyzer": "digit_analyzer"
},
"Remark": {
"type": "text",
"index": false
},
"RiskLevel": {
"type": "keyword"
},
"SearchBrand": {
"type": "text",
"analyzer": "standard"
},
"SiteCodes": {
"type": "text",
"analyzer": "digit_analyzer"
},
"UpdateAdminId": {
"type": "keyword"
},
"UpdateAdminName": {
"type": "keyword"
},
"UpdateTime": {
"type": "date"
},
"ZhcxWordLabel": {
"type": "keyword"
}
}
},
"settings": {
"index": {
"search": {
"slowlog": {
"threshold": {
"fetch": {
"debug": "3s"
},
"query": {
"warn": "1s"
}
}
}
},
"indexing": {
"slowlog": {
"threshold": {
"index": {
"info": "5s"
}
}
}
},
"number_of_shards": "6",
"analysis": {
"normalizer": {
"lowercase_analyzer": {
"filter": [
"lowercase"
],
"type": "custom",
"char_filter": []
}
},
"analyzer": {
"digit_analyzer": {
"filter": [
"lowercase"
],
"type": "custom",
"tokenizer": "comma_tokenizer"
}
},
"tokenizer": {
"comma_tokenizer": {
"type": "char_group",
"tokenize_on_chars": [
"whitespace",
","
]
}
}
},
"number_of_replicas": "1"
}
}
}
}
重建索引:http://ip:9202/_reindex
{
"source": {
"index": "sensitive_1_v11"
},
"dest": {
"index": "sensitive_1_v12"
},
"script": {
"source": "ctx._source.remove("@timestamp");ctx._source.remove("@version");"
}
}
添加别名:http://ip:9202/_aliases
{
"actions": [
{
"remove":{
"index": "sensitive_1_v14",
"alias": "sensitive_1"
}
},
{
"add": {
"index": "sensitive_1_v15",
"alias": "sensitive_1"
}
}
]
}
新ES库设置参数:http://ip:9200/_cluster/settings
{
"persistent" : {
"search": {
"max_open_scroll_context": "2147483647"
}
},
"transient": {
"search": {
"max_open_scroll_context": "2147483647"
}
}
}