当前位置: 首页 > wzjs >正文

网络推广团队分工广州seo优化排名公司

网络推广团队分工,广州seo优化排名公司,长沙网站建设价格,残联网站建设方案elasticsearch reindex 索引。 背景: 索引test1 reindex到test2 修改sharding数量 程序是通过别名test1_alias访问索引 1、创建目标索引test2 索引需要手动提前创建自动创建可能会有mapping 不一致性的风险。 The destination should be configured as wanted …

elasticsearch reindex 索引。

背景:

索引test1 reindex到test2 修改sharding数量
程序是通过别名test1_alias访问索引

1、创建目标索引test2

索引需要手动提前创建自动创建可能会有mapping 不一致性的风险。

The destination should be configured as wanted before calling _reindex. Reindex does not copy the settings from the source or its associated template.Mappings, shard counts, replicas, and so on must be configured ahead of time.

复制test1的创建索引语句,修改sharding数量,

GET test1 查看索引

去掉下面test1属性的部分。

  "test1" : {"aliases" : {"test1_alias" : { }},"provided_name" : "test1","creation_date" : "1742388051938",, #注意前面的","号也要去掉,因为处于底部"uuid" : "LG30E6iGSPu-09Ca5nGbPQ","version" : {"created" : "6070099"}

PUT test2 创建索引
修改后的json文件
“number_of_shards” : 修改到目标数量
执行命令返回的数据

{"acknowledged" : true,"shards_acknowledged" : true,"index" : "test2"
}

2、禁止源索引test1 写

防止reindex期间写入数据,无法同步到目标索引

PUT /test1/_settings
{"index.blocks.write": true
}

对应放开写的命令

PUT /test1/_settings
{"index.blocks.write": false
}

3、 执行reindex 命令

POST _reindex?wait_for_completion=false&requests_per_second=1000
{"source": {"index": "test1"},"dest": {"index": "test2"}
}

返回信息

{"task" : "KsO_WIvXRC2ccMCCxbuF3w:28779984"
}

wait_for_completion=false 后台执行命令,requests_per_second=500限制速度500

调整同步速度命令:
POST _reindex/KsO_WIvXRC2ccMCCxbuF3w:28779984/_rethrottle?requests_per_second=500
取消任务命令
POST _tasks/KsO_WIvXRC2ccMCCxbuF3w:28779984/_cancel
查看reindex任务
GET _tasks?actions=*reindex&detailed

4、 查看任务是否完成

GET _tasks/KsO_WIvXRC2ccMCCxbuF3w:28779984

返回 true的时候就是完成了reindx
“completed” : true

5、修改别名指向新的索引别名

test1_alias指向test2

POST _aliases
{"actions": [{ "remove": { "index": "test1", "alias": "test1_alias" } },{ "add": { "index": "test2", "alias": "test1_alias" } }]
}
6、查看别名
GET test2

删除原来的索引(可以保留归档)

DELETE test1

加速执行速度的方法
1、增加size 默认1000

POST _reindex?wait_for_completion=false
{"source": {"index": "test1","size": 5000},"dest": {"index": "test2"}
}

2、副本改成0

PUT /test2/_settings
{"number_of_replicas": 0
}

3、禁止自动刷新

PUT /test2/_settings
{ "refresh_interval": -1 }

4、提高scroll的并行度


POST _reindex?slices=5&refresh

参考文档:
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html

https://blog.csdn.net/wwd0501/article/details/132192692

http://www.dtcms.com/wzjs/184130.html

相关文章:

  • 2015做外贸网站好做吗企业网络组建方案
  • 百度网站优化排名互联网营销策划
  • 什么是网站栏目标题seo成创网络
  • 视频分享网站模板企业如何注册自己的网站
  • 购物网站排名第一的有哪些网络营销的目的和意义
  • 安徽招标网官网郑州seo顾问阿亮
  • 免费ppt模板下载大全网站搜索广告是什么意思
  • 青岛seo网站排名北京seo代理公司
  • 建设建材网站什么网站推广比较好
  • 做新闻网站的素材中国新闻网发稿
  • 注册公司流程图片对seo的理解
  • 电商网站运营团队建设方案模板关键字挖掘机爱站网
  • 网页界面设计案例赏析惠州seo关键词排名
  • 沧州网站建设哪家专业合肥网站seo费用
  • 单页式网站模板教你如何建立网站
  • 幼儿园网站建设合同网络推广方案例子
  • wordpress建站技巧专业培训seo的机构
  • 吴江网站建设公司重庆关键词排名推广
  • 公司网站页面设计思路seo霸屏软件
  • seo网站地图怎么做推广软件app
  • 做网站为什么要服务器搜索大全
  • 小广告制作模板seo日常工作都做什么的
  • 绍兴网站建设专业的公司天津关键词优化网排名
  • 做网站卖东西送上门网络推广专员岗位职责
  • 大丰做网站价格怎么查询百度收录情况
  • 想学做网站要去哪里学百度网站推广价格查询
  • html 5电影网站源码搜索引擎优化涉及的内容
  • thinkphp 做网站如何西安做推广优化的公司
  • 用php做网站流程百度论坛
  • 广州网站设计网站制作杭州seo软件