Commit 6e3fb3c7 authored by 吴升宇's avatar 吴升宇

Merge branch 'wsy3' into 'master'

add es script && fix majia args

See merge request !568
parents 2611aa17 573049e3
......@@ -55,3 +55,22 @@ celery -A physical beat
### physical策略端脚本
在Alp-Test-Cos-test001服务器上,通过crontab -l查看
### es常用命令
```bash
#修改别名:
curl -X POST -H "Content-Type: application/json" "http://172.17.32.22:9200/_aliases" -d '{"actions":[{"remove":{"index":"mv-alpha-product-prod-190904001","alias":"gm-dbmw-product-read"}},{"add":{"index":"mv-alpha-product-prod-191018401","alias":"gm-dbmw-product-read"}}]}'
#查看别名
curl -H "Content-Type: application/json" "http://172.17.32.22:9200/_aliases?pretty"
#查看所有索引
curl -H "Content-Type: application/json" "http://172.17.32.22:9200/_cat/indices?v"
#简单查询
curl -H "Content-Type: application/json" "http://172.17.32.22:9200/gm-dbmw-topic-high-star-read/_search?pretty" -d '{"query":{"term":{"id":"46710078"}}}'
```
### es同步确认脚本
cd /data/log/physical/app/index_contrast/
import os
os.system(
"""
source /srv/envs/physical/bin/activate
&& curl -X POST -H "Content-Type: application/json" "http://172.17.32.22:9200/_aliases" -d '{"actions":[{"remove":{"index":"mv-alpha-user-prod-190905002","alias":"gm-dbmw-user-read"}},{"add":{"index":"mv-alpha-user-prod-191018401","alias":"gm-dbmw-user-read"}}]}'
&& curl -X POST -H "Content-Type: application/json" "http://172.17.32.22:9200/_aliases" -d '{"actions":[{"remove":{"index":"mv-alpha-topic-prod-190928002","alias":"gm-dbmw-topic-read"}},{"add":{"index":"mv-alpha-topic-prod-191018401","alias":"gm-dbmw-topic-read"}}]}'
&& curl -X POST -H "Content-Type: application/json" "http://172.17.32.22:9200/_aliases" -d '{"actions":[{"remove":{"index":"mv-alpha-topic-high-star-prod-190928002","alias":"gm-dbmw-topic-high-star-read"}},{"add":{"index":"mv-alpha-topic-high-star-prod-191018401","alias":"gm-dbmw-topic-high-star-read"}}]}'
&& curl -X POST -H "Content-Type: application/json" "http://172.17.32.22:9200/_aliases" -d '{"actions":[{"remove":{"index":"mv-alpha-tag-prod-190904001","alias":"gm-dbmw-tag-read"}},{"add":{"index":"mv-alpha-tag-prod-191018401","alias":"gm-dbmw-tag-read"}}]}'
&& curl -X POST -H "Content-Type: application/json" "http://172.17.32.22:9200/_aliases" -d '{"actions":[{"remove":{"index":"mv-alpha-product-prod-190904001","alias":"gm-dbmw-product-read"}},{"add":{"index":"mv-alpha-product-prod-191018401","alias":"gm-dbmw-product-read"}}]}'
"""
)
\ No newline at end of file
......@@ -57,7 +57,7 @@ def auto_click_per_1d_by_post():
numtime1, numtime2 = time_convs(1, 1)
topic_ids = get_commnet_id(numtime2, numtime1, content_level_low=0, content_level_top=3)
for topic_id in topic_ids:
click_num = random.randint(3, 6)
click_num = random.randint(6, 12)
for i in range(click_num):
auto_click_list.append(topic_id)
......
......@@ -45,7 +45,7 @@ def auto_follow_per_1d_by_regist():
numtime1, numtime2 = time_convs(1, 1)
user_ids= get_commnet_id(numtime2, numtime1)
for user_id in user_ids:
follow_num = random.randint(3, 6)
follow_num = random.randint(10, 20)
for i in range(follow_num):
auto_follow_list.append(user_id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment