write down,forget

elasticsearch插件bug fix

<Category: Diving Into ElasticSearch, 小道消息>

lucene4变化不少:http://blog.mikemccandless.com/2012/07/lucene-400-alpha-at-long-last.html
自定义的analyzer的要求也更加严格,之前写的几个插件,都报错了。
错误具体表现在第一次分词没有问题,第二次及后续的分词都是空,感谢各位网友的积极响应和测试反馈,谢谢。

具体是什么原因呢?

仔细研究了下代码,发现reset多加了一个参数,汗,fix如下:

-    public void reset(Reader input) throws IOException {
+    public void reset() throws IOException {

 

受影响的插件:pinyin、string2int、stconvert

这次都是按jdk6重新编译的,上次反映的jdk7的问题也一并解决了。

 

阅读这篇文章的其余部分

本文来自: elasticsearch插件bug fix

Adobe Media Server 5安装错误及解决

<Category: 流媒体>

已经多年不再接触flash及相关东东了。,fms现在的ams,
3.5的在centos6试了一会,果断放弃折腾

Error: Flash Media Server needs the NSPR library installed.
 yum install nspr

阅读这篇文章的其余部分

本文来自: Adobe Media Server 5安装错误及解决

[tutorial]clustering search result with plugin:tools-carrot2

<Category: Diving Into ElasticSearch>

this tutorial is write for this ,https://github.com/medcl/-
阅读这篇文章的其余部分

本文来自: [tutorial]clustering search result with plugin:tools-carrot2

webrtc rocks

<Category: Webrtc>

今天RP爆发,不用翻墙也能打开appspot网站,体验了一把webrtc的各种特性,前2周被easyrtc搞伤心了,easyrtc真是愧对它的这个名字,client端的js写的太差,bug一大堆,视频demo死活不出来

用下面的这个repo,一切顺利,视频,语音,传文件,文字聊天都ok,是时候开整webrtc了.

https://-experiment.appspot.com/

https://github.com/muaz-khan/WebRTC-Experiment

本文来自: webrtc rocks

WebRTC for newbies!

<Category: Webrtc>

懒得翻墙,贴过来,慢慢看

for newbies!

Copyright © 2013 Muaz Khan<@muazkh>.

阅读这篇文章的其余部分

本文来自: WebRTC for newbies!

WebRTC for Beginners

<Category: Webrtc>

懒得翻墙,贴过来,慢慢看

 

for Beginners

Copyright © 2013 Muaz Khan<@muazkh>.

阅读这篇文章的其余部分

本文来自: WebRTC for Beginners

nginx,luajit编译报错

<Category: Nginx>

checking for library in /usr/local/lib/ and /usr/local/include/-2.0 (specified by the _LIB and _INC env) ... not found        ./configure: error: ngx_http_lua_module requires the Lua or library and _LIB is defined as /usr/local/lib/ and _INC (path for lua.h) /usr/local/include/-2.0, but we cannot find there.

 

centos5.6下,同样脚本centos6没有问题

http://www.quwenqing.com/read-213.html

 

编辑 Makefile文件,找到ldconfig位置(75行)
原内容是:LDCONFIG= ldconfig -n
修改为:LDCONFIG= /sbin/ldconfig -n
然后对LuaJIT重新make install

 

本文来自: nginx,luajit编译报错

Gitorious

<Category: DevOPS>

试用了下Gitorious,是github enterprise的很好的替代品,大部分操作和github基本一致,github以人的repo为主,Gitorious更强调project以及team,作为内部的源码管理平台实在很合适。

推荐使用bitnami的installer来安装

http://bitnami.com/stack//

安装很简单,唯一需要注意的是,必须设置一个domain,用ip不行

如果想换一下域名,在配置“/opt/gitorious-2.4.12-1/apps/gitorious/htdocs/config/gitorious.yml”里面替换就行了

另外本地hosts文件配置一下域名的解析,这步应该是可选的。

这下gitolite可以功成身退了。

本文来自: Gitorious

发布个插件:elasticsearch-river-email

<Category: Diving Into ElasticSearch>

最近发现vps上面跑的用来收邮件的python脚本占用了30%的cpu,并且一直就有写个邮件river的想法,不过一直没有付诸行动,今天下班抽空完成了这个插件,理论支持的协议:
/**
now support:
imap
imaps
pop3s
pop3
*/
不过只有时间测试了pop3协议,正常收取。
地址:https://github.com/medcl/-

创建river的方式:

$ curl -XPUT 'localhost:9200/_river/google/_meta' -d '{
  "type": "email",
  "email": {
    "config" : [ {
        "host": "pop.exmail.qq.com",
        "port": 110,
        "type":"pop3",
        "username":"river@infinitbyte.com",
        "password":"ail?sid=9UL",
        "check_interval": 5000,
        "skip_count": 1,
        }
    ]
  },
  "index":{
    "index":"google",
    "type":"gmail"
  }
}'

RTF已经包含该插件,并测试通过:

https://github.com/medcl/elasticsearch-rtf/tree/master/elasticsearch/plugins/river-email

本文来自: 发布个插件:elasticsearch-river-email

mongodb-river重新同步数据

<Category: Diving Into ElasticSearch>

elasticsearch的mongodb-river没有提供对一个库重新同步数据的方法,在很多情况下我们需要这么做,比如修改了elasticsearch的mapping,这个时候,就只能重建数据,所以需要重新从mongodb里面pull数据,然后重建索引,怎么办?

其实我们只需要清除mongodb-river记录的同步信息就行了,然后mongodb就能自动重新初始化,就跟新安装的一样。

1.第一步,查看那些信息需要删除,所有的信息都在_river索引里面

curl -XGET http://192.168.2.99:9200/_river/_search?q=*

返回结果,类似这样的,就是记录数据同步的位置信息了

 {
                "_index": "_river",
                "_type": "mongodb",
                "_id": "testmongo.person",
                "_score": 1,
                "_source": {
                    "mongodb": {
                        "_last_ts": "{ \"$ts\" : 1363082244 , \"$inc\" : 1}"
                    }
                }
            },

怎么处理呢?干掉就行,这个记录其实也就是一条elasticsearch的索引文档数据,找到index,type,id删除就行了。
我这里全部删除了,你可别照着来

curl -XDELETE http://192.168.2.99:9200/_river/_query?q=*

第二步,目标索引如果需要修改mapping,删除数据,等等
第三步,重新创建river配置信息,啥,没有备份,慢慢哭去吧

到这里,数据应该就可以马上看到了,速度非常快。

本文来自: mongodb-river重新同步数据