最近实在不能忍受84的抽风了,换服务器了,果然是便宜没好货,好货不便宜,在此强烈建议不买burst.net的vps,超售太严重了,服务器性能爆低,主要是磁盘,通过vmstat查看的话,cs常年在1w以上,母机一天要重启几次,一个字“烂”,算了。
快速搬家成功,几点经验,选择相同的版本,使用相同的软件,相同配置,基本上拷贝粘贴,网站、数据库什么的直接resync过来,启动,ok!新vps在网络驿站上买的,加州T2线路,速度不错,大家可以参考,这个是我的推介链接:http://member.netdak.com/aff.php?aff=016。
本文来自: 逃离burst.net
https://github.com/mojombo/jekyll/wiki/Deployment
jekyll&es-doc部署脚本
阅读这篇文章的其余部分 »
本文来自: jekyll&es-doc部署脚本
分享个刚写的python脚本,用来抓取新浪微博的数据,其实这个脚本写了很久了,之前用这个脚本抓了几十G的数据,扔硬盘里一直没有用,前阵子win8刚出来,头脑一热就装了,还全格式化了那块盘,后面想要用的时候,才发现忘记把里面抓到数据拷出来了,悲催啊,还好脚本还在,今天完善了下,共享给大家,主要有如下功能:
支持多线程下载
用户id通过文件加载
按时间分目录
通过用户id取模划分子目录(如果你的id够多的话,避免单个文件夹下太多文件)
支持参数配置skip_count
支持下载完之后自动关机
支持命令行参数配置,具体查看帮助: -h
打包下载
阅读这篇文章的其余部分 »
本文来自: 新浪微博数据集抓取脚本
试玩下gitpage并绑定域名 创建medcl.gihub.com,注:必须是这种格式的repo:你的用户名.github.com。
D:>mkdir medcl.github.com D:>cd medcl.github.com D:\medcl.github.com> git init Initialized empty Git repository in /cygdrive/d/github.medc l.com/.git/ D:\medcl.github.com>echo "I'll be back!">index.html D:\medcl.github.com>echo medcl.github.com>CNAME D:\medcl.github.com>cat CNAME medcl.github.com D:\medcl.github.com>git add . D:\medcl.github.com>git commit -m 'first commit' [master (root-commit) f09e419] first commit 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 README D:\medcl.github.com>git push -u origin master Counting objects: 3, done. Writing objects: 100% (3/3), 199 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@github.com:medcl/medcl.github.com.git * [new branch] master -> master Branch master set up to track remote branch master from origin.
DNS添加一条A记录
github.medcl.com 207.97.227.245
ok,访问下看看
http://github.medcl.com/
http://medcl.github.com/
http://github.medcl.com/ElasticSearch.Net/
参考:
http://pages.github.com/
http://kyle.xlau.org/2010/12/29/github-CNAME.html
本文来自: gitpage试玩并绑定域名
下午由于平台技术分享,错过了vForum2011的演讲,不过还是赶上了在线的“VMware技术专家专场技术交流”,这个必须赞,像这种直接的技术交流效果是最好的,大家问的问题也比较实际,学到不少,这份Q/A记录下。
ppt下载地址:http://vforum.cloudcommunity.com.cn/?mod=down_doc&id=62
或
http://vforum.cloudcommunity.com.cn/docs/1321368602__%E5%88%86%E4%BC%9A%E5%9C%BA1-%E8%99%9A%E6%8B%9F%E5%8C%96%E7%9A%84%E9%9D%A9%E5%91%BD%20%20-%20VMware%E4%BA%91%E8%AE%A1%E7%AE%97%E5%9F%BA%E7%A1%80%E6%9E%B6%E6%9E%84%E5%A5%97%E4%BB%B6%E6%A6%82%E8%A7%88%20%20.zip
本文来自: vForum2011第一场Q/A问答
基于私有云的elasticsearch批量部署
阅读这篇文章的其余部分 »
本文来自: 基于私有云的elasticsearch批量部署
elasticsearch里面的search_type共有如下几种:
The type of the search operation to perform. Can be
dfs_query_then_fetch,
dfs_query_and_fetch,
query_then_fetch,
query_and_fetch. 【removed,since:http://groups.google.com/group/elasticsearch/browse_thread/thread/7aa5ea823afb499/d9e3cf3a1e1f6964】
Defaults to query_then_fetch.
form google group:“
You get proper sorted results when you use query_then_fetch (across all top
"size" results), if you use query_and_fetch, then each shard return the size
requested hits, and then they are sorted between them.
”
直接看代码里面吧,里面都有注释。
public enum SearchType { /** * Same as {@link #QUERY_THEN_FETCH}, except for an initial scatter phase which goes and computes the distributed * term frequencies for more accurate scoring. */ DFS_QUERY_THEN_FETCH((byte) 0), /** * The query is executed against all shards, but only enough information is returned (not the document content). * The results are then sorted and ranked, and based on it, only the relevant shards are asked for the actual * document content. The return number of hits is exactly as specified in size, since they are the only ones that * are fetched. This is very handy when the index has a lot of shards (not replicas, shard id groups). */ QUERY_THEN_FETCH((byte) 1), /** * Same as {@link #QUERY_AND_FETCH}, except for an initial scatter phase which goes and computes the distributed * term frequencies for more accurate scoring. */ DFS_QUERY_AND_FETCH((byte) 2), /** * The most naive (and possibly fastest) implementation is to simply execute the query on all relevant shards * and return the results. Each shard returns size results. Since each shard already returns size hits, this * type actually returns size times number of shards results back to the caller. */ QUERY_AND_FETCH((byte) 3), /** * Performs scanning of the results which executes the search without any sorting. * It will automatically start scrolling the result set. */ SCAN((byte) 4), /** * Only counts the results, will still execute facets and the like. */ COUNT((byte) 5); /** * The default search type ({@link #QUERY_THEN_FETCH}. */ public static final SearchType DEFAULT = QUERY_THEN_FETCH; }
新建了2个qq群,欢迎大家一起交流elasticsearch方面的相关内容。
群1:190605846
群2:暂不开放
另外,已经刚申请了elasticsearch.cn域名,打算组建一个elasticsearch在国内的交流社区,整理收集相关的资料文档,方便新手学习elasticsearch和促进elasticsearch在国内的推广。
第一步,打算先将官方的站点的文档翻译下,毕竟目前还没有比那更完善的文档了,由于文档比较多,所以在这里希望能招募有共同想法的童鞋一起来完成这项伟大的工作。
有什么想法请留意或加QQ群吧。
you know for search , :)
本文来自: elasticsearch技术交流群,欢迎加入
Diving Into ElasticSearch(10)精确控制之Routing使用
<Date: 2011-10-22> <Category: Diving Into ElasticSearch> 发表评论前面一篇介绍parent-child的使用,我们来回顾一下:
1.先建好mapping和索引几条数据
curl -XPUT 'http://localhost:9200/news/comment/_mapping' -d '{ "comment" : { "_parent" : { "type" : "hot" } }}' curl -XPUT 'http://localhost:9200/news/comment/1?parent=1' -d '{ "uname" : "凤凰网安徽省六安市网友", "content" : "河南警方的话没人信"}' curl -XPUT 'http://localhost:9200/news/comment/2?parent=1' -d '{ "uname" : "凤凰网湖北省武汉市网友", "content" : "没有监督权\n没有调查\n一切当然只能是谣言"}' curl -XPUT 'http://localhost:9200/news/comment/3?parent=1' -d '{ "uname" : "ladygaga", "content" : "双下肢不活动,存在废用性肌肉萎缩。请问,这个是怎么做到的?"}' curl -XPUT 'http://localhost:9200/news/comment/4?parent=1' -d '{ "uname" : "medcl", "content" : "额"}'
2.获取一下这几条数据看看
http://localhost:9200/news/comment/1
结果:
{"_index":"news","_type":"comment","_id":"1","_version":1, "_source" : { "uname" : "凤凰网安徽省六安市网友", "content" : "河南警方的话没人信"}}
没有问题,我们再试试后面的
http://localhost:9200/news/comment/2
结果:
HTTP/1.1 404 Not Found Access-Control-Allow-Origin: * Content-Type: application/json; charset=UTF-8 Content-Length: 45 {"_index":"news","_type":"comment","_id":"2"}
嘿嘿,发现了么,居然是404,你可以继续试试后面的id为3的也是404,id为4的可以出来
试试:http://localhost:9200/news/comment/2?parent=1(索引时的path)
HTTP/1.1 404 Not Found
哈哈,貌似不行o.(ps:其实kimchy可以实现这个url pattern,但是目前没有)
那正确的方式是怎样的呢?
http://localhost:9200/news/comment/1?routing=1 http://localhost:9200/news/comment/1?routing=2 http://localhost:9200/news/comment/1?routing=3 http://localhost:9200/news/comment/1?routing=4
答案就在routing,ES帮助:http://www.elasticsearch.org/guide/reference/mapping/routing-field.html
使用我写的partial_update插件也是支持routing的,如下:
curl -XPUT 'http://localhost:9200/news/comment/4/_update?parent=1' -d '{ "content" : "连老卡都不斗争了,难道真的登船去了吗?"}'
结果:
curl -XGET http://localhost:9200/news/comment/4?routing=1 {"_index":"news","_type":"comment","_id":"4","_version":2, "_source" : {"content":"连老卡都不斗争了,难道真的登船去了吗?","uname":"medcl"}}
发散一下,parent=2试试:
curl -XPUT 'http://localhost:9200/news/comment/4/_update?parent=2' -d '{ "content" : "周公使管叔监殷"}'
结果:
curl -XGET http://localhost:9200/news/comment/4?routing=2 {"_index":"news","_type":"comment","_id":"4","_version":1, "_source" : {"content":"周公使管叔监殷","uname":"medcl"}} curl -XGET http://localhost:9200/news/comment/4?routing=1 {"_index":"news","_type":"comment","_id":"4","_version":2, "_source" : {"content":"连老卡都不斗争了,难道真的登船去了吗?","uname":"medcl"}}
很明细,/news/comment/4存在两条记录,routing的出现,使ES的id的唯一性丢失了,并且删除索引记录的时候也必须带上routing才行,此外,查询的结果中可能会出现重复的_id。
curl -XDELETE http://localhost:9200/news/comment/4?routing=1 curl -XDELETE http://localhost:9200/news/comment/4?routing=2
再看看查询的操作,查询的时候可以指定routing,默认不区分routing,即全部扫描:
curl -XGET http://localhost:9200/news/comment/_search?q=* curl -XGET http://localhost:9200/news/comment/_search?q=*&routing=3
总之,一旦你决定使用routing,你必须保证对这些routing做到心中有数。

