最近の投稿
人気のページと投稿
アーカイブ
月 | 火 | 水 | 木 | 金 | 土 | 日 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
AWS, Content Delivery Network and Debian
自分がはまったところ.
「gitoriousを動かすvirtualhostにパスワード認証がかかっている」が故の問題
gitoriousは内部から内部に対して正確には gitorious_client_host と gitorious_client_port で指定した先にアクセスがある.
ここに認証をかけたりすると,あっさりあきらめられてしまうので,このアクセスが通るように指定しておく必要がある.
例:
Require valid-user Allow from 192.168.1 Satisfy Any
gitoriousはgit pushをするのに内部でsshをする.
それゆえ,git ユーザはsshで外部から接続できなければならない.ダミーでいいのでパスワードを設定しないと,sshは空のパスワードのアカウントには例え公開鍵ログインの場合でも許可してくれない.
正直いって、gitoriousにそれほど大きな価値があるわけではない。
githubのほうがいいケースは無数にあげられる
これを満たさない人か、GPL大好きな人ならgitoriousはトライする価値はある。
以下は,gitorious.orgにある2009年11月7日版にCentOS5.3でgitoriousを動かすまでの記録。
おおむね,http://gitorious.org/gitorious/mainline/blobs/master/doc/recipes/install-centos.txt にある通りやればいいのだが,いかんせんupdateされていないので,酔狂な人以外はubuntuでやるのがいいと思います.
CentOSのpackage以外で利用したものは以下の通り.
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はもういらない.
[Elastic MapReduceの話] 大倉努さん ->後半になった.
[Hadoop World 2009報告] mikio@yanashita.com
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つけなのがイイ.
[Clounderaの人のビジネストーク]
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 (技術研究所)
Apache MAHOUTにあるHadoopで動く機械学習アルゴリズムを利用.参考になる.
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を動かすvirtualhostにパスワード認証がかかっている」が故の問題
gitoriousは内部から内部に対して正確には gitorious_client_host と gitorious_client_port で指定した先にアクセスがある.
ここに認証をかけたりすると,あっさりあきらめられてしまうので,このアクセスが通るように指定しておく必要がある.
例えば、同じネットワーク上にいる人にはウェブサイトのある部分について 無制限のアクセスを許したいけれど、外のネットワークの人には パスワードを提供させるようにするためには、次のような設定をすることが できます:
Require valid-user Allow from 192.168.1 Satisfy Any
バージョン 2.0.51 からは セクションと セクションを使用することで Satisfy ディレクティブが 適用されるメソッドを制限することが できるようになりました。
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以外で利用したものは以下の通り.
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はもういらない.
参考
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
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>
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
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]
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 .
adduser git chown -R git:git /home/gitorious su - git
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 tmp:create rake db:create RAILS_ENV=production rake db:migrate RAILS_ENV=production rake ultrasphinx:bootstrap RAILS_ENV=production
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の設定.
broker.ymlを設定する.
gem install stompserver ln -s /opt/ruby-enterprise-1.8.7-20090928/bin/stompserver /usr/bin
さらに /etc/init.d/stompを設定する.
http://millarian.com/programming/installing-aspell-and-raspell-for-ultrasphinx/ をまず見る.
rootでこれをやる.
rake ultrasphinx:spelling:build RAILS_ENV=production
東京駅におもいのほかはやくついたので,hotspot探し.銀の鈴にmobilepointがあったので行ってみたが,電波はでているもののDHCPでIPもらえなかったので,別のところを探す.グランスタの中央部にある休憩スペースが電波はいったので,そこで作業する.
夏休みの土曜日のせいか,おこさまだらけで大変だったが,こっちもやりたいことがあるのでやる.
というわけで,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.
今日はさくっと修正するつもりが,いろいろはまっていた.で,論文まで手が届いていない..と.