研究でレコメンドエンジンを使いそうなので、cicindelaを入れてみる。
エンジンは他にも色々あるっぽいけど、これはREST形式で使いやすそう。
https://gist.github.com/dex1t/5749800.js?file=1st.sh
インスコしたディレクトリに従ってパスの修正しなきゃならんらしいが、sedで大量のエラーが…
cicindela/misc/substitute_project_paths.plの以下を修正(-i "" を -i""に変更)
https://gist.github.com/dex1t/5749800.js?file=diff
https://gist.github.com/dex1t/5749800.js?file=1st-2.sh
Perlモジュールのインストール
以下をざくっとインストール
https://gist.github.com/dex1t/5749800.js?file=2nd.sh
MySQLの設定
MySQLはすでに入れてるので、my.cnfの設定をいじる。
既存サーバを流用する際は要注意。
以下(/usr/local/cicindela/etc/mysql/my.cnfより)を/etc/my.cnfのmysqld項目に追加
https://gist.github.com/dex1t/5749800.js?file=my.cnf
んで、MySQL立ち上げてみると、innodb_log_file_size = 256Mが原因で失敗。
innodb_log_file_sizeで設定した値と、実際のログファイルのサイズが異なるからみたい。
ここを見て、ログファイル(/var/lib/mysql/のib_logfile0とib_logfile1)をリネーム。
これで無事、MySQL が立ち上がった。
cicindela用DB作成
miscのcreate_init_sql.plを使ってcicindela用DBを作る。
オプションでユーザ名、パスワードとか指定。
https://gist.github.com/dex1t/5749800.js?file=4th.sh
cicindelaの設定
lib/cicindela/lib/Cicindela/Config/_common.pmの中に集計セット?を定義
https://gist.github.com/dex1t/5749800.js?file=_common.pm
Apacheの設定と再起動
/etc/httpd/conf/httpd.confに以下を追記
https://gist.github.com/dex1t/5749800.js?file=httpd.conf
で、再起動。 パーミッション関係でエラー出たので、cicindelaディレクトリ以下の所有権を調整。
https://gist.github.com/dex1t/5749800.js?file=7th.sh
MySQLのcicindela用DBの、picks_bufferテーブルにデータが入ってたらOK
cicindela/bin/flush_buffer.plを実行するとpicks_bufferテーブルをクリア
cicindela/bin/batch.plの実行で、スコアを算出(初回は2回実行する必要あり)
daemontoolsのインストール
flush_buffer.plとbatch.plの実行を自動化するために、daemontoolsをインスコ
https://gist.github.com/dex1t/5749800.js?file=8th.sh
cicindelaのスクリプトへのシンボリックリンク作成
https://gist.github.com/dex1t/5749800.js?file=8th-2.sh
https://gist.github.com/dex1t/5749800.js?file=8th-3.sh
以下を実行してsvscanを起動、ps -ALL等でsvscan,superviseの起動を確認できたらOK
https://gist.github.com/dex1t/5749800.js?file=8th-4.sh
logroteteの設定
ログが肥大化していくので、以下の内容でログローテーション用ファイル作成
https://gist.github.com/dex1t/5749800.js?file=9th.sh
とりあえずこれで、基本的な設定は終了。 なにかとハマった。
参考: https://code.google.com/p/cicindela2/wiki/Install