摘要: 如何设计一把分布式锁 我们用 redis 来实现这把分布式的锁,redis 速度快、支持事务、可持久化的特点非常适合创建分布式锁。 分布式环境中如何消除网络延迟对锁获取的影响 锁,简单来说就是存于 redis 中一个唯一的 key。一般而言,redis 用 set 命令来完成一个 key 的设置(加 阅读全文
posted @ 2017-02-22 20:22 bonelee 阅读(2787) 评论(0) 推荐(0) 编辑
摘要: 针对分布式锁的实现,目前比较常用的有以下几种方案: 基于数据库实现分布式锁 基于缓存(redis,memcached,tair)实现分布式锁 基于Zookeeper实现分布式锁 在分析这几种实现方案之前我们先来想一下,我们需要的分布式锁应该是怎么样的?(这里以方法锁为例,资源锁同理) 可以保证在分布 阅读全文
posted @ 2017-02-22 20:12 bonelee 阅读(1400) 评论(1) 推荐(0) 编辑
摘要: 原始数据:835MB ES 设置了_source _all disabled 且设置了仅仅存docs倒排Wed Feb 22 11:58:27 CST 2017Before size:1 /home/bone/elasticsearch-2.4.1/data/OK, waiting...0After 阅读全文
posted @ 2017-02-22 18:20 bonelee 阅读(2010) 评论(0) 推荐(0) 编辑
摘要: 转自:http://kangrui.iteye.com/blog/2262860 转自:http://kangrui.iteye.com/blog/2262860 众所周知_source字段存储的是索引的原始内容,那store属性的设置是为何呢?es为什么要把store的默认取值设置为no?设置为y 阅读全文
posted @ 2017-02-22 14:24 bonelee 阅读(1262) 评论(0) 推荐(0) 编辑
摘要: store store By default, field values are indexed to make them searchable, but they are not stored. This means that the field can be queried, but the o 阅读全文
posted @ 2017-02-22 14:06 bonelee 阅读(2511) 评论(0) 推荐(0) 编辑
摘要: 1._all 1.1_all field _all字段是一个很少用到的字段,它连接所有字段的值构成一个用空格(space)分隔的大string,该string被analyzed和index,但是不被store。当你不知道不清楚document结构的时候,可以用_all。如,有一document: [ 阅读全文
posted @ 2017-02-22 13:14 bonelee 阅读(4782) 评论(0) 推荐(0) 编辑
摘要: 摘自:https://es.xiaoleilu.com/070_Index_Mgmt/31_Metadata_source.html The _source field stores the JSON you send to Elasticsearch and you can choose to o 阅读全文
posted @ 2017-02-22 12:24 bonelee 阅读(7127) 评论(0) 推荐(0) 编辑
摘要: 此外,强制merge也可以大大降低索引的大小! curl -XPOST 'localhost:9200/hec_test3/_forcemerge' 阅读全文
posted @ 2017-02-22 12:06 bonelee 阅读(4120) 评论(0) 推荐(0) 编辑
摘要: for i in *;do sed -ie 's/_test2/_test3/g' $i; sed -ie 's/_type2/_type3/g' $i; done 539down voteaccepted 1. Replacing all occurrences of one string wit 阅读全文
posted @ 2017-02-22 11:31 bonelee 阅读(1888) 评论(0) 推荐(0) 编辑
摘要: 2015年各银行无抵押信用贷款利率及额度是多少? 时间:2015-05-05 来源:融360整理 作者:小康 银行无抵押信用贷款的利率是多少,一般能贷到多少额度?数据显示,近几年银行的不良贷款率依旧在攀升,其中信用卡占款及无抵押贷款不良率占比较大,于是不少银行开始收紧个人信用贷款且对资质审核也愈加严 阅读全文
posted @ 2017-02-22 10:03 bonelee 阅读(836) 评论(0) 推荐(0) 编辑