3. Agenda
Overview
Installation and Configuration
Demo and Using MogileFS
MogileFS with Catalyst
TODO, etc
0.begining Shibuya Perl Mongers Technical Talk #7
5. File storaging
What do you use as file storaging?
rsync
NAS/SAN それ で
FTPd 出来るよ!
WebDAV
いずれにせよ毎回神経使った運⽤になりがち
1.overview Shibuya Perl Mongers Technical Talk #7
9. About MogileFS (4)
MogileFSはどこで使われてる?
LiveJournalで使われてます。
最近ではvoxでも使われています。
MogileFS summit review
-lots of people (25-30) showed up -most people are using mogile in
development, but not in production
http://lists.danga.com/pipermail/mogilefs/2006-September/000488.html
まだ運⽤実績は少ないみたいです。
1.overview Shibuya Perl Mongers Technical Talk #7
23. Install from svn (1)
svn co
$ mkdir –p ~zigorou/src/mogilefs
$ cd ~zigorou/src/mogilefs
$ svn co
http://code.sixapart.com/svn/mogilefs/trun
k/ ./
2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
24. Install from svn (2)
install server
$ cd ~zigorou/src/mogilefs/server
$ perl Makefile.PL
$ make && make install
(* 1 ) m ake testは のテストがハードコードされているので割愛
2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
25. Install from svn (3)
install utils
$ cd ~zigorou/src/mogilefs/utils
$ perl Makefile.PL
$ make && make install
(* 1 ) 今度は が存在しないので割愛
2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
26. Setup database
mogdbsetup
$ cd ~zigorou/src/mogilefs/server
$ ./mogdbsetup
対話式でsetupできます
storage engineを変えたい場合は
ALTER TABLEで
2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
29. Setup mogstored (3)
config options detail
mogstoredファイルの%config_opts
m %conf i g_opt s = (
y
' daem ze|d'
oni => ¥$opt _daem ze, # daem
oni onS
' conf i g=s' => ¥$opt _conf i g, # conf i g0Õ0¡ 0¤0ë0nX4b@
' htt pl i s ten=s' => ¥$htt p_l i s ten, # htt pd l i s ten
' m tl i s ten=s' => ¥$m t _l i s ten, # m
gm gm anaged s er ver l i s ten
' docr oot =s ' => ¥$docr oot, # Docum entRoot
'm axconns=i ' => ¥$max_conns, # M axConnecti on
);
‘key = value’で並べるだけ
2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
31. Setup mogilefsd (2)
editing mogilefsd.conf
daem ze = 1
oni
db_dsn = DBI : m ql : m l ef s: hos t=m tor e01
ys ogi ogs
db_user = m l e ogi
# db_pas s =
conf _por t = 7001 # m l ef sd0Ll i s ten0Y0‹ 0Ý0ü0È
ogi
l i st ener _j obs = 10 # l i s tener = quer y w ker 0npr ocess
or
del ete_j obs = 1 # del ete w ker 0npr ocess
or
r epl i cat e_j obs = 5 # r epl i cati on w ker 0npr ocess
or
#m og_r oot = /m /m l ef s
nt ogi
r eaper _j obs = 1
MogileFS::Configのソース嫁 (*1)
(* 1 ) そのうち、はてダでまとめます^^;
2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
42. Setup storage node (10)
register storage class
mogadm class addを使います。
# mogadm class add www.3zai.com zigorou
2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
43. Setup storage node (11)
--mindevcount class option
CLASS OPTI ONS
- - m ndevcount =<val ue>
i
Num of devi ces t he f i l es i n t hi s cl as s s houl d be r epl i cated
ber
acr os s . Can be s et t o anyt hi ng >= 1.
レプリカを作るdevice数を指定します
class単位で指定できます
mogadm class modifyで後から変更可能
以上を設定した⽅が良さそうです。 は
2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
44. Demo and Using MogileFS
Demo and
Using MogileFS
3.Demo and Using MogileFS Shibuya Perl Mongers Technical Talk #7
45. mogtool (1)
What is mogtool?
コマンドラインでmogilefsにデータを
保存、取得、削除などが出来る
動作テストなんかにも使える
/etc/mogilefs/mogtool.confで設定書
けるので、trackers指定をmogadmと同
じように書くと吉。
3.Demo and Using MogileFS Shibuya Perl Mongers Technical Talk #7
46. mogtool (2)
inject file to mogilefs
# mogtool --domain=www.3zai.com --
class=zigorou inject /var/tmp/piyo.txt piyo
piyo.txtが’piyo’と⾔うkeyで保存される
3.Demo and Using MogileFS Shibuya Perl Mongers Technical Talk #7
47. mogtool (3)
Demonstration of mogtool
WebDAVにデータが保存されているか
--mindevcountの指定とreplication
3.Demo and Using MogileFS Shibuya Perl Mongers Technical Talk #7
48. MogileFS::Client (1)
Constructor
パラメーターにdomainも指定しないと
いけない
同じClientオブジェクトではdomainを
またがって扱う事は出来ない
readonlyで読み出し専⽤化も出来る
3.Demo and Using MogileFS Shibuya Perl Mongers Technical Talk #7