skywalking6.2升级到6.5

1、需要把之前数据复制到新索引,涉及到索引有

es查看: curl -s localhost:9210/_cat/indices |grep sw |grep -v "2019"

network_address_inventory
service_inventory
service_instance_inventory
endpoint_inventory
register_lock

2、复制索引数据,自行变更索引名称
curl -XPOST 'http://127.0.0.1:9210/_reindex?pretty' -d '{
"conflicts": "proceed",
"source": {
"index": "sw1_service_inventory"
},
"dest": {
"index": "sw_service_inventory",
"version_type": "external"
}
}' -H 'Content-Type:application/json'

3、service_instance_inventory索引多了字段,需要初始化last_update_time、register_time、heartbeat_time

curl -XPOST 'localhost:9210/sw_service_instance_inventory/_update_by_query?pretty' -H 'Content-Type: application/json' -d'{
"script":{
"source":"ctx._source.last_update_time=1576736982;ctx._source.register_time=1576736982;ctx._source.heartbeat_time=1576736982"
},
"query":{"match_all":{}
}
}'

4、service_inventory索引字段名称变更了,由mapping_last_update_time变为last_update_time,同理需要初始化last_update_time、register_time、heartbeat_time

curl -XPOST 'localhost:9210/sw_service_inventory/_update_by_query?pretty' -H 'Content-Type: application/json' -d'{
"script":{
"source":"ctx._source.last_update_time=1576736982;ctx._source.register_time=1576736982;ctx._source.heartbeat_time=1576736982"
},
"query":{"match_all":{}
}
}'

5、network_address_inventory多了last_update_time、register_time、heartbeat_time

curl -XPOST 'localhost:9210/sw_network_address_inventory/_update_by_query?pretty' -H 'Content-Type: application/json' -d'{
"script":{
"source":"ctx._source.last_update_time=1576736982;ctx._source.register_time=1576736982;ctx._source.heartbeat_time=1576736982"
},
"query":{"match_all":{}
}
}'

6、endpoint_inventory多了last_update_time、register_time、heartbeat_time

curl -XPOST 'localhost:9210/sw_endpoint_inventory/_update_by_query?pretty' -H 'Content-Type: application/json' -d'{
"script":{
"source":"ctx._source.last_update_time=1576736982;ctx._source.register_time=1576736982;ctx._source.heartbeat_time=1576736982"
},
"query":{"match_all":{}
}
}'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值