‘pplife’ Posts

 

mysql explain type 优先级

Read full article  | 评论关闭

 

 

system/const/eq_ref/ref/range/index/ALL

Read More

ubuntu nodejs 8

Read full article  | 评论关闭

 

 

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

sudo apt-get install -y nodejs

 

 

npm install pm2 -g

Read More

mongo explain

Read full article  | 评论关闭

 

db.test.explain("executionStats").find({"user":"1332200000"})

Read More

mongo add index

Read full article  | 评论关闭

 

db.user.ensureIndex({“name”:1,”age”:1})

 

db.COLLECTION_NAME.getIndexes()

db.sites.dropIndex("name_1_domain_-1")

Read More

mongo count distinct

Read full article  | 评论关闭

 

 

db.collection_name.distinct(‘types2′)

Read More

delete old data from elasticsearch

Read full article  | 评论关闭

 

get indices info

curl 'localhost:9200/_cat/indices?v'

delete old data:
curl -v -X DELETE http://localhost:9200/logstash-$day*

Read More

mongo collection name have -

Read full article  | 评论关闭

 

 

db['construction-places'].count()
42

Read More

BMI 计算公式

Read full article  | 评论关闭

 

EX:70kg÷(1.75×1.75)=22.86

成人的BMI数值:
过轻:低于18.5
正常:18.5-23.9
过重:24-27
肥胖:28-32
非常肥胖, 高于32
bmi 标准

Read More

AWS RDS 跨区域同步

Read full article  | 评论关闭

 

CALL mysql.rds_set_external_master (‘mymasterserver.mydomain.com’, 3306, ‘repl_user’, ‘<password>’, ‘mysql-bin-changelog.000031′, 107, 0);

CALL mysql.rds_start_replication;

 

Read More

redis key 迁移

Read full article  | 评论关闭

 

当slave, migrate 等方法不能用时,直接用dump/restore

redis-cli  -h cn-vpc-redis-session.aftjvu.0001.cnn1.cache.amazonaws.com.cn -n 1 keys “*”  | while read key  ;do redis-cli -h cn-vpc-redis-session.aftjvu.0001.cnn1.cache.amazonaws.com.cn -n 1 –raw dump $key  | head -c-1 | redis-cli -n 0 -x restore  $key  0 ;done

Read More