カテゴリ: devel の記事
[リスト]
- Elastic MapReduceは入出力はS3になる.
- http://s3sync.net/wiki のRubyのシンクツールが便利.
- データは複数のfileにわけないと,EC2はジョブをわけてくれない.
- AWS management consoleで実行,確認ができる.->一般人
- JSONで指定する elastic-mapreduceがおすすめ.-> プログラマならこっちだろう
- elastic mapreduceにはamazonのほうでHDFSを用意してくれるので,中間出力はS3ではなく,こっちを使うべき.
- blogeye.jpでは800GBあったが80台 70時間でokだった.
- 小規模なJobだとMasterはamazonが用意してくれるから安い.
- わるいところもいろいろ.独自のディスクイメージが使いたかったらEC2で自分で構築する.1時間1台0.1ドル=100台1時間1000円.しかし,1分使っても1時間分のお金がとられる.ログがみにくい.
yahoo: 82PB, 25000nodesの話,FacebookはHiveの話.ChinaTelecomのCDRデータがでかい話(BC-PDM)など.
[NTTデータにおけるHadoopへの取り組み]
Prossione(R)とLinaccident(R)のところ.
kemari(今はXen, KVM版開発中)をつかったMaster serverの冗長化.
[Hadoop/HBase 開発:Liberty インデクサプロジェクトの例] 松岡,小宮山
元はメールやグループウェアを連携させるためのDBがほしくてはじめた.最初はBDBでやった.
行IDは気をつけて選べ.
[Setting up your Hadoop cluster]
わりと知られてる情報のまとめ.というかんじだった.debian的なversionつけなのがイイ.
VERTICAがSQLベンダとして最初にきた.
Clouderaはコミュから何を学んだか.->むずかしい,(説得,インストール,などなど)
Cloudera Distribution for Hadoop (CDH).
CDH1,CDH2と進化してきた.CDH2はHbase,Zookeeper, Hadoop0.20.1+152パッチ
75%の新ユーザが利用している.9月の時点ではダウンロード数はapacheの10倍以上.
OpenPDC(ストリームセンサDB)でもつかってる.
Cloudera Desktop = アプリ開発フレームワーク, 管理コンソール.
グラフ機能の実装はもうすぐ.コマンドラインtoolのおきかえではない.
Window managerはオソ.
desktop-api-subscribe@cloudera.com
[楽天の人のはなし] by @kkawamura, @nishiokamegane (技術研究所)
- データ管理はROMA, データ処理はHadoop.
- 行動TG 40GB/day, 1億レコード.
- 購買data 2億件,10GBほどをつかってrecommendation.
POJO HadoopというJavaからHadoopを楽につくる簡易フレームワークをつくった.
fairy: Hadoop streamingでrubyつかったらおわりじゃないか,という話もあるが.. 実装中.
[Elastic MapReduceの話] 大倉努さん ->後半になった.
[Scala on Hadoop] はてな stanaka
一日20Gくらいのログ.300jobs/day
1時間毎にHDFS上(1時間毎dir名)にログをコピー.
出力は,はてなグラフ,フォトライフに使う.
11月からScalaで使うようになった.
SHadoop(on googlecode)を使えばok. HDFSの処理とかでPerlが毎度JVM起動してたのがなくなってだいぶはやくなった(調査してない)
CentOS5.3にgitoriousをいれる続き.
自分がはまったところ.
- gitorious_client_hostには制限をかけないこと.
「gitoriousを動かすvirtualhostにパスワード認証がかかっている」が故の問題
gitoriousは内部から内部に対して正確には gitorious_client_host と gitorious_client_port で指定した先にアクセスがある.
ここに認証をかけたりすると,あっさりあきらめられてしまうので,このアクセスが通るように指定しておく必要がある.
例えば、同じネットワーク上にいる人にはウェブサイトのある部分について 無制限のアクセスを許したいけれど、外のネットワークの人には パスワードを提供させるようにするためには、次のような設定をすることが できます:
Require valid-user
Allow from 192.168.1
Satisfy Any
バージョン 2.0.51 からは セクションと セクションを使用することで Satisfy ディレクティブが 適用されるメソッドを制限することが できるようになりました。
- ユーザgitにはパスワードをつけること.
gitoriousはgit pushをするのに内部でsshをする.
それゆえ,git ユーザはsshで外部から接続できなければならない.ダミーでいいのでパスワードを設定しないと,sshは空のパスワードのアカウントには例え公開鍵ログインの場合でも許可してくれない.
CentOS5.3でgitoriousを動かすまで.
以下は,gitorious.orgにある2009年11月7日版で動かす話.
おおむね,http://gitorious.org/gitorious/mainline/blobs/master/doc/recipes/install-centos.txt にある通りやればいいのだが,いかんせんupdateされていないので,酔狂な人以外はubuntuでやるのがいいと思います.
CentOSのpackage以外で利用したものは以下の通り.- ImageMagickのインストール.ImageMagick-6.5.5-3を自分は使った.
- http://ftp.de.debian.org/debian/pool/main/i/imagemagick/imagemagick_6.5.5.3.orig.tar.gz
- aspellとaspell-enのインストール.
- http://ftp.de.debian.org/debian/pool/main/a/aspell/aspell_0.60.6.orig.tar.gz
- http://ftp.de.debian.org/debian/pool/main/a/aspell-en/aspell-en_6.0-0.orig.tar.gz
- sphinxのインストール
- http://www.sphinxsearch.com/downloads.html
- gitのインストール
- git-1.6.5.2
- oniguruma
- onig-5.9.1.tar.gz
- ruby enterprise.
http://gitorious.org/gitorious/mainline/blobs/master/doc/recipes/install-centos.txtにある通りなのだが違うところ.
/etc/init.d/git-daemon
#!/bin/bash
#
# Init file for Gitorious GIT-Daemon daemon
#
# chkconfig: 2345 55 25
# description: GIT-Daemon server daemon
#
# processname: git-daemon
# pidfile: /var/www/gitorious/log/git-daemon.pid
# source function library
. /etc/rc.d/init.d/functions
PATH=/usr/local/ruby-enterprise/bin:/usr/local/bin:$PATH
RETVAL=0
PROG="git daemon"
GIT_DAEMON="/usr/local/ruby-enterprise/bin/ruby /var/www/gitorious/script/git-da
emon -d"
LOCK_FILE=/var/lock/git-daemon
PID_FILE=/var/www/gitorious/log/git-daemon.pid
do_check_pid() {
if [ -f $PID_FILE ]; then
PID=`cat $PID_FILE`
RUNNING=`ps --pid $PID | wc -l`
else
PID=0
RUNNING=0
fi
}
runlevel=$(set -- $(runlevel); eval "echo \$$#" )
start()
{
do_check_pid
if [ $RUNNING != 2 ] ; then
echo -n $"Starting $PROG: "
/bin/su git -c "$GIT_DAEMON"
sleep 1
if [ -f $PID_FILE ] ; then
success
else
failure
fi
RETVAL=$?
else
echo -n $"$PROG already running"
failure
fi
[ "$RETVAL" = 0 ] && touch $LOCK_FILE
echo
}
stop()
{
do_check_pid
echo -n $"Stopping $PROG: "
if [ $RUNNING != 2 ] ; then
failure $"Stopping $PROG"
else
killproc -p $PID_FILE
fi
RETVAL=$?
# if we are in halt or reboot runlevel kill all running sessions
# so the TCP connections are closed cleanly
if [ "x$runlevel" = x0 -o "x$runlevel" = x6 ] ; then
killproc -p $PID 2>/dev/null
fi
[ "$RETVAL" = 0 ] && rm -f $LOCK_FILE
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
condrestart)
if [ -f $LOCK_FILE ] ; then
if [ "$RETVAL" = 0 ] ; then
stop
# avoid race
sleep 5
start
fi
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart}"
RETVAL=1
esac
exit $RETVAL
/etc/init.d/ultrasphinx
#!/bin/bash
#
# Init file for Gitorious Ultrasphinx daemon
#
# chkconfig: 2345 55 25
# description: Ultrasphinx server daemon
#
# processname: searchd
# pidfile: /var/www/gitorious/db/sphinx/log/searchd.pid
PATH=/usr/local/ruby-enterprise/bin:/usr/local/bin:$PATH
RETVAL=0
START_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:start RAILS_ENV=production"
STOP_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:stop RAILS_ENV=production"
RESTART_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:restart RAILS_ENV=production"
STATUS_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:status RAILS_ENV=production"
LOCK_FILE=/var/lock/git-ultrasphinx
PID_FILE=/var/www/gitorious/db/sphinx/log/searchd.pid
case "$1" in
start)
/bin/su git -c "$START_CMD"
;;
stop)
/bin/su git -c "$STOP_CMD"
;;
status)
/bin/su git -c "$STATUS_CMD"
;;
restart)
/bin/su git -c "$RESTART_CMD"
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
esac
exit $RETVAL
/etc/init.d/stomp
#!/bin/bash
#
# Init file for Gitorious stomp daemon
#
# chkconfig: 2345 55 25
# description: stomp server daemon
#
# processname: stomp
# pidfile: /var/www/gitorious/log/stomp.pid
# source function library
. /etc/rc.d/init.d/functions
PATH=/usr/local/ruby-enterprise/bin:/usr/local/bin:$PATH
RETVAL=0
PROG=/usr/local/bin/stompserver
DAEMON=/usr/local/bin/stompserver
LOCK_FILE=/var/lock/stomp
#PID_FILE=/var/www/gitorious/log/stomp.pid
runlevel=$(set -- $(runlevel); eval "echo \$$#" )
start()
{
echo -n $"Starting $PROG: "
$DAEMON > /dev/null &
sleep 1
}
stop()
{
echo -n $"Stopping $PROG: "
killall stompserver
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL
おわったらこの3つの/etc/init.d以下のファイルはchkconfig -add file名 で追加.
crontabにtask_performerはもういらない.
参考
- http://d.hatena.ne.jp/bannyan/20090131/1233399237
- http://d.hatena.ne.jp/Hirohiro/20090522/1243016921 (おすすめ)
- http://gitorious.org/gitorious/mainline/blobs/master/doc/recipes/install-ubuntu.txt と
- http://gitorious.org/gitorious/mainline/blobs/master/doc/README
- http://gitorious.org/gitorious/pages/UbuntuInstallation
- http://cjohansen.no/en/ruby/setting_up_gitorious_on_your_own_serverにかかれているとおり.
基本ライブラリをdebでいれる.
apt-get install -y build-essential apache2 mysql-server mysql-client git git-svn apg geoip-bin libgeoip1 libgeoip-dev sqlite3 libsqlite3-dev imagemagick libpcre3 libpcre3-dev zlib1g zlib1g-dev libyaml-dev libmysqlclient15-dev apache2-dev postfix apt-get install libonig2 memcached aspell-en aspell libaspell-dev
wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz tar xvfz sphinx-0.9.8.tar.gz cd sphinx-0.9.8 ./configure && make && make install
cd /home/gitorious git clone git@gitorious.org/gitorious/mainline.git
apt-get install uuid uuid-dev openjdk-6-jre wget http://www.powertech.no/apache/dist/activemq/apache-activemq/5.2.0/apache-activemq-5.2.0-bin.tar.gz tar xzvf apache-activemq-5.2.0-bin.tar.gz -C /usr/local/ adduser --system --no-create-home activemq echo "export ACTIVEMQ_HOME=/usr/local/apache-activemq-5.2.0" >> /etc/activemq.conf echo "export JAVA_HOME=/usr/" >> /etc/activemq.conf chown -R activemq /usr/local/apache-activemq-5.2.0/data
/usr/local/apache-activemq-5.2.0/conf/activemq.xml の書き換え
<networkConnector name="localhost" uri="static://(tcp://127.0.0.1:61616)"/>
wget http://launchpadlibrarian.net/15645459/activemq mv activemq /etc/init.d chmod +x /etc/init.d/activemq
REEのインストール
wget http://rubyforge.org/frs/download.php/64475/ruby-enterprise-1.8.7-20090928.tar.gz apt-get install libreadline5-dev
展開して installというスクリプトを叩くとインストール開始.
おわるとこんなのが表示.
If want to use Phusion Passenger (http://www.modrails.com) in combination with Ruby Enterprise Edition, then you must reinstall Phusion Passenger against Ruby Enterprise Edition, as follows: /opt/ruby-enterprise-1.8.7-20090928/bin/passenger-install-apache2-module Make sure you don't forget to paste the Apache configuration directives that the installer gives you. If you ever want to uninstall Ruby Enterprise Edition, simply remove this directory: /opt/ruby-enterprise-1.8.7-20090928
/etc/profileに追加
export PATH=/opt/ruby-enterprise-1.8.7-20090928/bin:$PATH export LD_LIBRARY_PATH="/usr/local/lib" export LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
source /etc/profile
passengerのインストーラ起動
passenger-install-apache2-module
/etc/apache2/mods-available/passenger.loadを作る
LoadModule passenger_module /opt/ruby-enterprise-1.8.7-20090928/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so PassengerRoot /opt/ruby-enterprise-1.8.7-20090928/lib/ruby/gems/1.8/gems/passenger-2.2.5 PassengerRuby /opt/ruby-enterprise-1.8.7-20090928/bin/ruby
a2enmod passenger
/etc/apache2/sites-available/gitoriousを編集してからa2ensite gitorious
<VirtualHost *:80> ServerName codes.mlab.t.u-tokyo.ac.jp DocumentRoot /home/gitorious/gitorious/public # <-- be sure to point to 'pu blic'! </VirtualHost>
gitoriousに必要なgemをいれる.
apt-get install libonig-dev libmagick9-dev gem install raspell mime-types oniguruma textpow chronic BlueCloth ruby-yadis ruby-openid rmagick geoip ultrasphinx rspec rspec-rails RedCloth echoe daemons geoip --no-rdoc --no-ri
gitoriousの設定
public/.htaccsss 以下のように書いてあるのを消した.
RewriteEngine on RewriteRule ^projects/([a-zA-z0-9\-_]+)/?$ /$1 [R=301,L] RewriteRule ^projects/([a-zA-z0-9\-_]+)/repos/([a-zA-z0-9\-_]+)(.+)?$ /$1/$2$3 [R=301,L]
/etc/init.dに必要なdaemonを追加
doc/templates/ubuntu/{git-ultrasphinx,git-daemon} を /etc/init.d以下にコピーしてかきかえる.そして chmod +x しとく.
root@codes:/etc/init.d# update-rc.d git-ultrasphinx start 99 2 3 4 5 . root@codes:/etc/init.d# update-rc.d git-daemon start 99 2 3 4 5 .
git userをつくる
adduser git chown -R git:git /home/gitorious su - git
*.ymlの設定
config/database.ymlをexampleからコピーして作成.rootのパスワードを設定する.
config/gitorious.ymlをいじる.重要なのは,cookie_secret, gitorious_host
rake をうごかしてみるといくつか足りないgemがあるようなので追加.
gem install rdiscount stomp diff-lcs json mocha gem install rdiscount -v 1.3.1.1 gem install ruby-hmac
rakeしまくり.
rake tmp:create rake db:create RAILS_ENV=production rake db:migrate RAILS_ENV=production rake ultrasphinx:bootstrap RAILS_ENV=production
.bash_profile
export RUBY_HOME=/opt/ruby-enterprise-1.8.7-20090928 export GEM_HOME=$RUBY_HOME/lib/ruby/gems/1.8/gems export PATH=$RUBY_HOME/bin:$PATH
logrotateの設定.
apacheにSSL設定
起動
- 本体はpassengerであがる.
- RAILS_ENV=production ./script/poller start
トラブル
ssh鍵が登録できない
broker.ymlを設定する.
gem install stompserver ln -s /opt/ruby-enterprise-1.8.7-20090928/bin/stompserver /usr/bin
さらに /etc/init.d/stompを設定する.
aspellがおかしい.
http://millarian.com/programming/installing-aspell-and-raspell-for-ultrasphinx/ をまず見る.
rootでこれをやる.
rake ultrasphinx:spelling:build RAILS_ENV=production
夏休みの土曜日のせいか,おこさまだらけで大変だったが,こっちもやりたいことがあるのでやる.
というわけで,git://github.com/armaniacs/donrails.git をつくる.自分の場合はオフラインのときにコード書くことが多いのでgitが便利だから..あわせて,JRuby1.3.1に対応させてみた.
一日目は夜までに宿に集合.メシはよくある海辺の旅館なかんじ.そのあと間をおいてから宴会.
こんなことがでたとき.
外部項目を 'vendor/plugins/acts_as_nested_set' に取得していますsvn: リポジトリは恒久的に 'http://dev.rubyonrails.org/svn/rails/plugins/acts_as_nested_set' へ移動しました。relocate (参照 URL の変更) を実行してください
というのが出たら.
vendor/plugins$ svn propedit svn:externals .
をかまして.editorで変更すればok.
今日はさくっと修正するつもりが,いろいろはまっていた.で,論文まで手が届いていない..と.
# 無料のコミュニティー版、DB2 Express-C を使って pureXML 技術を評価してください。
# オープンソースの NXD、eXist-DB をダウンロードしてください。eXist-DB は MySQL にとって徐々に NXD による競合となりつつあります。
# パフォーマンスとスケーラビリティーの要件が eXist の機能を上回る場合には、eXist に代わる候補として Mark Logic が適切です。
自分のためのメモ.正直Mark Logicというのはしらなかった.こないだ調べたdb4oもまだ調べてないし..やることがいっぱいあるな.
git init
をNFS環境の上でやろうとしたときに,何も考えずに
git add .
をかましてしまうと,
# new file: ._tex
などとNFSのlockファイルが登録されてしまうのでありました.
http://ogijun.g.hatena.ne.jp/secondlife/20080306/1204774860
にgitで特定ファイルをグローバルに無視する方法が紹介されていて,とてもよくできているので
こいつにNFSのlockfile形式である ._* を追加することにした.
*.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store *.sw[po] tags ._*
というかんじ.