运行java服务
java -jar ke-community-clean-web-1.0.0-SNAPSHOT.jar -Dspring.profiles.active=dev
nohup java -Dserver.port=8086 -Dspring.config.additional-location=./application.yml -jar ./springboot.jar> nohup.out 2>&1 &
java -jar ke-community-clean-web-1.0.0-SNAPSHOT.jar -Dspring.profiles.active=dev
nohup java -Dserver.port=8086 -Dspring.config.additional-location=./application.yml -jar ./springboot.jar> nohup.out 2>&1 &
php.ini
display_errors注释掉
error_log 注释掉
log_errors = On
1.新建一个新索引portal-im-base-api-2021-09-back
put portal-im-base-api-2021-09-back
{
"settings" : {
"index" : {
"opendistro": {
"index_state_management": {
"policy_id": "month_cold_workflow_delete_62d"
}
},
"refresh_interval": "60s",
"number_of_shards" : 5,
"number_of_replicas" : 1
}
},
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"class_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"exportable": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"index": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"line_number": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"log_level": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"logdate": {
"type": "date"
},
"logger_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"message": {
"type": "text"
},
"parent": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"pod": {
"properties": {
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"project": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"span": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"stack_trace": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"thread": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"trace": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
2.迁移老索引portal-im-base-api-2021-09的数据到新索引portal-im-base-api-2021-09-back
POST _reindex?wait_for_completion=false
{
"source": {
"index": "portal-im-base-api-2021-09",
"size": 5000,
},
"dest": {
"index": "portal-im-base-api-2021-09-back"
}
}
执行会反馈task ID 可以 GET _task/ID
3.删除老索引portal-im-base-api-2021-09
delete portal-im-base-api-2021-09
4-5可选
4.为新索引portal-im-base-api-2021-09-back添加别名为老索引的名字portal-im-base-api-2021-09
POST _aliases
{
"actions": [{
"add": {
"index": "portal-im-base-api-2021-09-back",
"alias": "portal-im-base-api-2021-09"
}
}]
}
5.迁移老索引portal-im-base-api-2021-09的数据到新索引portal-im-base-api-2021-09-back
POST _reindex?wait_for_completion=false
{
"source": {
"index": "portal-im-base-api-2021-09",
"size": 5000,
"query": {
"match": {
"FIELD": "TEXT"
}
}
},
"dest": {
"index": "portal-im-base-api-2021-09-back"
}
}