Solr

princy | July 6th, 2011 - 14:16:59

About Solr

  • Based on Lucene, server-ization of Lucene
  • HTTP request processing for index and query
  • Has a web-based administrative interface
  • Configure file and schema file using  XML
  • Faceting of query results
  • Spell checking function
  • More like this function
  • Distributed solr server

Home page

  • http://lucene.apache.org/solr/

Solr books

  • 「Apache Solr 入門」
  • Solr 1.4 Enterprise Search Server

To be continued …

No SQL

princy | July 6th, 2011 - 13:53:04

Find all you want?

  • No SQL http://nosql-database.org/

Some other useful knowledges:

  • Google map reduce  http://labs.google.com/papers/mapreduce.html
  • Google big table  http://labs.google.com/papers/bigtable.html
  • Google file system http://labs.google.com/papers/gfs.html
  • Google Chubby  http://labs.google.com/papers/chubby.html

Hadoop

princy | July 6th, 2011 - 13:40:29

Hadoop:

  • Open source, reliable, distributed computing

Two Core Components:

  • HDFS: Distributed replicated file system, Self-healing high-bandwidth clustered storage, just stores bytes,
  • Map/Reduce: API for parallel computing, Fault-tolerant distributed processing, a batch system

Feature:

  • Hadoop scales linearly with data size or analysis complexity

TO Not NoSQL

  • Hive project adds SQL support to Hadoop
  • HiveQL compiles to a query plan
  • Query plan executes as MapReduce jobs

Hadoop users

  • Yahoo, Facebook, Twitter

Other words

  • Zookeeper – distributed synchronization
  • Avro – Data Serialization / RPC
  • H-BASE –  structured distributed database for horizontally scalable FS

EcoSystem of Hadoop

 

 

Useful links:

http://hadoop.apache.org/common/

http://www.cloudera.com/

http://www.slideshare.net/cloudera/tokyo-nosqlslidesonly

http://www.slideshare.net/xefyr/introduction-to-hadoop-hbase-and-nosql

http://www.slideshare.net/adorepump/hbase-nosql

 

 

在ubuntu11.04安装solr

princy | June 2nd, 2011 - 14:22:22

1 在ubuntu11.04下安装tomcat 6
sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user tomcat6-docs tomcat6-examples
sudo apt-get install libmysql-java

2.下载apache-solr-1.4.1.zip并解压
cd ~/
wget -c http://ftp.riken.jp/net/apache//lucene/solr/1.4.1/apache-solr-1.4.1.zip
unzip apache-solr-1.4.1.zip
sudo cp ~/apache-solr-1.4.1/dist/apache-solr-1.4.1.war /var/lib/tomcat6/webapps/solr.war
sudo cp -R ~/apache-solr-1.4.1/example/solr/ /var/lib/tomcat6/solr/

3. 在tomcat6里面设置solr环境
sudo vim /etc/tomcat6/Catalina/localhost/solr.xml

加入如下内容

<Context docBase=”/var/lib/tomcat6/webapps/solr.war” debug=”0″ privileged=”true” allowLinking=”true” crossContext=”true”> <Environment name=”solr/home” type=”java.lang.String” value=”/var/lib/tomcat6/solr” override=”true” /> </Context>

4. 设置solrconfig.xml环境,并建立data文件夹
mkdir /var/lib/tomcat6/solr/data

设置tomcat6访问data的权限

chown -R tomcat6:tomcat6 /var/lib/tomcat6/solr/data/

通过solr/conf/solrconfig.xml来设置data路径
<– Used to specify an alternate directory to hold all index data other than the default ./data under the Solr home. If replication is in use, this should match the replication configuration. –>
/var/lib/tomcat6/solr/data

5. 重启tomcat后进入solr
sudo service tomcat6 restart
http://localhost:8080/solr/admin

Done

在ubuntu上安装rails

princy | June 2nd, 2011 - 13:46:37
1 安装以下软件

apt-get install curl git-core build-essential zlib1g-dev libssl-dev libreadline5-dev

2 用RVM来安装ruby1.9.2
bash &lt; &lt;( curl https://rvm.beginrescueend.com/releases/rvm-install-head )

添加到默认路径里面
<pre><code>echo '[[ -s "/home/&lt;yourhome&gt;/.rvm/scripts/rvm" ]] &amp;&amp; source "/home/&lt;yourhome&gt;/.rvm/scripts/rvm"' &gt;&gt; ~/.bashrc </code>

重新登入终端后用一下命令测试

rvm notes

用rvm来安装ruby 1.9.2

rvm install 1.9.2

设定默认的ruby版本

rvm --default ruby-1.9.2

查看新设定的版本

ruby -v

3 安装rails

gem install rails

查看版本

rails -v 

Rails 3.0.7

4 安装自带的数据库

安装数据库

apt-get install sqlite3 libsqlite3-dev

用gem来设定数据库

gem install sqlite3-ruby

5  例子测试

rails new myproject

cd myproject

rails server

=> Booting WEBrick
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-06-02 22:44:07] INFO  WEBrick 1.3.1
[2011-06-02 22:44:07] INFO  ruby 1.9.2 (2011-02-18) [i686-linux]
[2011-06-02 22:44:07] INFO  WEBrick::HTTPServer#start: pid=18129 port=3000

进入以下页面查看

http://localhost:3000

成功

Ubuntu11.04下开发Ruby

princy | May 29th, 2011 - 08:17:35

0 由于学习需要,摸摸索索的在Ubuntu 11.04下安装和配置了一下Ruby。采用的是Ruby+Rails+yums+eclipse+RDT(Apatana)的方法。

1安装Ruby,目前最新版是1.9.1

#apt-get install ruby1.9.1

2 安装Rails,目前版本是2.3.5

#apt-get install rails

3 安装gems

#apt-get install rubygems

上面全部安装完后依次敲入ruby, rails, gem来确认是否安全安装好了

4 安装eclipse。 因为Ubuntu源里面的版本还是3.5,所以就从官网下的最新版来安装编译的。

4.1 下载eclipse,目前版本是3.7RC3

http://download.eclipse.org/eclipse/downloads/

4.2 解压到想要安装的目录,自己是 /usr/local

#cd /usr/local

sudo tar xf /*<下载地址>*/eclipse-SDK-3.7RC3-linux-gtk.tar.gz

4.3 设置启动

#cd /usr/bin

#vim eclipse

#!/bin/sh
export GDK_NATIVE_WINDOWS=true
export MOZILLA_FIVE_HOME=”/usr/lib/xulrunner-$(/usr/bin/xulrunner-2.0 –gre-version)”
ECLIPSE=/opt/eclipse/eclipse
exec $ECLIPSE “$@”

最后

#chomd +x eclipse

4.4 添加桌面图标

#cd /usr/share/applications

sudo vi eclipse.desktop

[Desktop Entry]
Type=Application
Name=Eclipse
Comment=Eclipse Integrated Development Environment
Icon=eclipse
Exec=eclipse
Terminal=false
Categories=Development;IDE;Java;

4.5 退出进入后发现eclipse的图标没有搞好。换到root账户下去/usr/share/applications下找到eclipse后手动给它添加日蚀的小图标

4.6 重新进入后发下eclipse已经安装好了。

5 在eclipse下安装Aptana插件

进入eclipse的help下面的Install New Software,把http://download.aptana.com/studio3/plugin/install贴到Work With那后按回车,然后一步步按照提示安装就好了

6 最后重启eclipse后就可以新建ruby project来学习ruby了。

7 其余步骤

7.1 其实是在第2步以后安装了rvm , 管理版本用的,不知道不装可不可以。。。

$ bash &lt; &lt;(curl -s https://rvm.beginrescueend.com/install/rvm)

7.2 另外还安装了irb,类似于ruby shell的东西

8 参考链接

http://www.ibm.com/developerworks/opensource/library/os-rubyeclipse/

http://www.aptana.com/

http://www.ruby-lang.org/en/

http://ankyo.blog.so-net.ne.jp/2011-03-22