SlideShare a Scribd company logo
1 of 63
Download to read offline
Learning MogileFS
        Building scalable storage system




    Toru Yamaguchi <zigorou@cpan.org>
   Yet Another Hackadelic (d:id:ZIGOROu)

                        Shibuya Perl Mongers Technical Talk #7
about ZIGOROu

 - Toru Yamaguchi -
株式会社ガイアックス
   ICDグループマネージャ
 散財.com Graffiti SNS
 初参戦なので、緊張気味w
 よろしくお願いします。:-)

0.begining            Shibuya Perl Mongers Technical Talk #7
Agenda
     Overview
     Installation and Configuration
     Demo and Using MogileFS
     MogileFS with Catalyst
     TODO, etc



0.begining                    Shibuya Perl Mongers Technical Talk #7
Overview




             Overview


1.overview         Shibuya Perl Mongers Technical Talk #7
File storaging
     What do you use as file storaging?
       rsync
       NAS/SAN       それ                         で
       FTPd          出来るよ!
       WebDAV
 いずれにせよ毎回神経使った運⽤になりがち

1.overview                   Shibuya Perl Mongers Technical Talk #7
About MogileFS (1)
     MogileFSって何?
       danga.com(SixApart)で開発された、
       オープンソースの分散ファイルシステ
       ムです。
       File storageサービスには持って来い

   まだまだ⽇本語のソースは少ないです。
本家のドキュメントも更新が追いついてない。

1.overview              Shibuya Perl Mongers Technical Talk #7
About MogileFS (2)
     MogileFSの作者は?
       Brad Fitzpatrick さんです。読めない…
       イケメン、モテ系?
       memcached
       Perlbal
       その他、多数。
       まさにHacker!
1.overview              Shibuya Perl Mongers Technical Talk #7
About MogileFS (3)
     MogileFSの良いところは?
       特殊なカーネルモジュール不要
       シングルポイントが無い
       ⾃動で無駄なくレプリカ作成
       RAID, SANなど⼀切不要
       ファイルシステムに依存しない

1.overview               Shibuya Perl Mongers Technical Talk #7
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
About MogileFS (5)
     MogileFSを使える⾔語は?
       公式ではPerlだけです。
       MogileFS::Client
             http://search.cpan.org/~bradfitz/MogileFS-Client-1.03/

       でもPHP,Ruby,Python,Javaなどの実装
       もあります!
       Note of MogileFS #02 – mogilefs client
             http://d.hatena.ne.jp/ZIGOROu/20061012/1160670015


1.overview                                             Shibuya Perl Mongers Technical Talk #7
History around MogileFS
                              MogileFS Summit
                              MogileFS Summit
                              SixApart TechBlog(jp)
                              SixApart TechBlog(jp)
                              Shibuya.pm TechTalk #7
                              Shibuya.pm TechTalk #7

                        MogileFS release (*1)
                        MogileFS release (*1)
                                                                  MogileFS
                       Perlbal release
                       Perlbal release
                                                                  ブームの予感!!
          memcached release
          memcached release

 LiveJournal open
 LiveJournal open

                                                  いまココ!
   1999                   2003      2004        2005     2006     2007
     は       と同時期に開設しています。

1.overview                                             Shibuya Perl Mongers Technical Talk #7
MogileFS Architecture (1)
     MogileFS components
       clients(MogileFS::Client)
       trackers(mogilefsd)
       mysql database cluster (recommend
       NDB Cluster)
       storage nodes(mogstored, Apache
       with WebDAV, lighthy or other)

1.overview                         Shibuya Perl Mongers Technical Talk #7
MogileFS Architecture (2)
     MogileFS Client
       MogileFSをネットワークを介したハンド
       ルとして取得できる。
       ファイルごとstoreしたりとか
       ファイルを消したり
       ファイルの実体(url)を取得したり


1.overview             Shibuya Perl Mongers Technical Talk #7
MogileFS Architecture (3)
     trackers(mogilefsd)
       MogileFSの司令塔役
       Clientからのリクエストを受け付ける
       query workerなどのdaemon
       状態をdatabaseで管理する
       mogstored(WebDAV)にファイル操作指
       令を出す

1.overview                 Shibuya Perl Mongers Technical Talk #7
MogileFS Architecture (4)
     mysql database cluster
       その名の通りNDB Cluster推奨
       storage nodeの管理
       nodeごとのdomain, device, classの管理
       Fileのインデックス化、状態管理
        は     でも構築可能




1.overview                    Shibuya Perl Mongers Technical Talk #7
MogileFS Architecture (5)
     storage node(mogstored)
       WebDAVサポートのhttpd
       だからApache2 with WebDAVとか
       lighttpdでも動作する (*1)
       mogstoredはPerlbalで出来てる
    今回は      での構築事例です。




1.overview                Shibuya Perl Mongers Technical Talk #7
MogileFS Architecture (6)
     Search ‘MogileFS’ by Google Image


              ちょww
             中国語wwww
                      http://pencywin.spaces.live.com/



1.overview                      Shibuya Perl Mongers Technical Talk #7
MogileFS Architecture (7)
      Component overview
                                                              mogilefs client
                               CommandをRESTで送信
 trackers (mogilefsd : 7001)


                                                          IO::Handleとして
                                                          送受信
storageの状態管理
                          replication



  database (mysql)                          storage node (mogstored: 7500)


1.overview                                   Shibuya Perl Mongers Technical Talk #7
MogileFS Architecture (8)
    File storaging overview
                                                             storage node 1


                                    dev1
                                    dev1           dev3
                                                   dev3            dev5
                                                                   dev5
      File
                    Replication w orker によって
                    ⾃動的にレプリカ⽣成
 domain : foo.com
 class : bar
 key : piyo                         dev2
                                    dev2           dev4
                                                   dev4            dev6
                                                                   dev6
 fid : 1
                              storage node 2
mindevcountが3の場合

                                               Shibuya Perl Mongers Technical Talk #7
Installation and Configuration



           Installation and
           Configuration

2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
Setup Environment
     Setup environment
       2台のFedora Core3で構築する例です。
       可能なものはserverを除きCPANからイ
       ンストール
       他のモジュールはsvnから2.0系を
       debianだとちょっと楽
       http://mogilefs.schtuff.com/another_how_to_install_mogilefs_debian_sarge


2.Installation and Configuration                   Shibuya Perl Mongers Technical Talk #7
Install CPAN Modules
      CPANからインストールする
        perl –MCPAN –e “install IO::AIO” (*1)
        perl –MCPAN –e “install Net::Netmask”
        perl –MCPAN –e “install Perlbal”
        perl –MCPAN –e “install
        MogileFS::Client”
(*1) debi
        anなら     を⼊れる。優先順位は            になってます。
   ついでに           もインストールして下さい。


2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
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
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
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
Setup database
     mogdbsetup
  $ cd ~zigorou/src/mogilefs/server
  $ ./mogdbsetup

       対話式でsetupできます
       storage engineを変えたい場合は
       ALTER TABLEで

2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
Setup mogstored (1)
     make directories
 # mkdir –p /etc/mogilefs
 # mkdir –p /var/mogdata

       /var/mogdataはApacheで⾔うところ
       のDocumentRoot
       このディレクトリ以下にファイルが置
       かれます。(storage nodeの実体)

2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
Setup mogstored (2)
         confファイルの作成
 # cd /etc/mogilefs
 #   cat > mogstored.conf << MOGSTORED_CONF
 >   httplisten=10.255.255.30:7500
 >   mgmtlisten=10.255.255.30:7501
 >   docroot=/var/mogdata
 >   MOGSTORED_CONF
(* 1 ) s erver/conf内の   は古くて使えません

2.Installation and Configuration    Shibuya Perl Mongers Technical Talk #7
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
Setup mogilefsd (1)
     copy mogilefsd.conf & adduser
 # cd ~zigorou/src/mogilefs/server/conf
 # cp mogilefsd.conf /etc/mogilefs
 # /usr/sbin/useradd –s /bin/false mogile




2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
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
Starting daemons
     start mogstored, mogilefsd
 # mogstored -d
 # sudo –u mogile mogilefsd




2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
Setup storage node (1)
     Setup steps
       register storage ‘host’
       register storage ‘device’
       register storage ‘domain’
       register storage ‘class’



2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
Setup storage node (2)
     keywords of storage nodes (1)
       hostとはstorage nodeで⽴ち上がって
       るhttpd(WebDAV)の事
       deviceはdocroot以下に出来るディレ
       クトリの名前の事
       イメージとしてはハードディスクみた
       いな物(実際そうmountするのもアリ)

2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
Setup storage node (3)
     keywords of storage nodes (2)
       domainは概念上のファイル区別のTOP
       に当たる。
       domainには複数のclassを定義出来る。
       classの中にkeyをインデックスとして
       fidが付いたファイルをstore
       keyはclassにひもづく階層ではなくフ
       ラットな構造
2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
Setup storage node (4)
     mogadm
       storage nodeを管理する為のツール
       MogileFS::Utilsの中にあります
       /etc/mogilefs/mogilefs.conf,
       ~/.mogilefs.conf, --configで指定された
       ファイルを設定ファイルに出来る。
       ⾯倒なtrackers指定はココに⼊れると吉。
             では無いので注意!

2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
Setup storage node (5)
         register storage host
             mogadm host addを使います。

  # mogadm host add 10.255.255.30
  # mogadm host add 10.255.255.31
(* 1 ) m og ilefs .confに   設定があること前提




2.Installation and Configuration       Shibuya Perl Mongers Technical Talk #7
Setup storage node (6)
     register storage device (1)
       device分だけディレクトリを作成しま
       しょう。

 # mkdir –p /var/mogdata/{“dev1”,”dev3”}

       全てのstorage nodeで登録したい
       device分ディレクトリを作成

2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
Setup storage node (7)
     register storage device (2)
       mogadm device addを使います。

 # mogadm device add 10.255.255.30 1
 # mogadm device add 10.255.255.31 2

       異なるhostに同⼀deviceは追加できま
       せん!

2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
Setup storage node (8)
     check trackers, hosts and devices
       mogadm checkを使います。

 # mogadm check

       trackers, host, deviceのリスト及び状
       態が表⽰されます。



2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
Setup storage node (9)
     register storage domain
       mogadm domain addを使います。

 # mogadm domain add www.3zai.com




2.Installation and Configuration   Shibuya Perl Mongers Technical Talk #7
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
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
Demo and Using MogileFS



           Demo and
           Using MogileFS

3.Demo and Using MogileFS   Shibuya Perl Mongers Technical Talk #7
mogtool (1)
     What is mogtool?
       コマンドラインでmogilefsにデータを
       保存、取得、削除などが出来る
       動作テストなんかにも使える
       /etc/mogilefs/mogtool.confで設定書
       けるので、trackers指定をmogadmと同
       じように書くと吉。

3.Demo and Using MogileFS   Shibuya Perl Mongers Technical Talk #7
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
mogtool (3)
     Demonstration of mogtool
       WebDAVにデータが保存されているか
       --mindevcountの指定とreplication




3.Demo and Using MogileFS   Shibuya Perl Mongers Technical Talk #7
MogileFS::Client (1)
     Constructor
       パラメーターにdomainも指定しないと
       いけない
       同じClientオブジェクトではdomainを
       またがって扱う事は出来ない
       readonlyで読み出し専⽤化も出来る



3.Demo and Using MogileFS   Shibuya Perl Mongers Technical Talk #7
MogileFS::Client (2)
     new_file method
       ファイルを⽣成するメソッドはこのメ
       ソッドに依存する
       trackersにcreate_openコマンドを送信
       ランダムにdeviceを取り出し、PATHで
       指定されたディレクトリ作成
       そのpathへのPUTをIO::Handleとして取
       得する
3.Demo and Using MogileFS   Shibuya Perl Mongers Technical Talk #7
MogileFS::Client (3)
     rename method
       rename($from_key, $to_key)
       当初指定したclassを変更する事が出来
       ない。
       mindevcountによる重要度の変更が簡
       単に出来ない


3.Demo and Using MogileFS    Shibuya Perl Mongers Technical Talk #7
MogileFS with Catalyst



           MogileFS with
           Catalyst

4.MogileFS with Catalyst   Shibuya Perl Mongers Technical Talk #7
Hook upload process (1)
     Idea1 : Hook upload process
       まさにuploadされたファイルを
       MogileFSに突っ込んだら便利ではと考
       えた。
       応⽤としてはconfirm付きのupload
       formとか。
                これはかなり無謀でした

4.MogileFS with Catalyst    Shibuya Perl Mongers Technical Talk #7
Hook upload process (2)
     Catalyst::Engine->prepare_body
       Multipart部の処理とtmpfile化は
       HTML::Body(::Multipart)モジュール依
       存
       Engine, HTML::Bodyとか書き換え⼤杉
       そもそも拡張ポイントじゃないしw



4.MogileFS with Catalyst   Shibuya Perl Mongers Technical Talk #7
Catalyst::Model::MogileFS (1)
     idea2 : file access model class
       やはり能動的にファイルアクセスする
       べきと考えた。
       script/myapp_create.pl model
       FileStorage::Some MogileFS [options]
       MogileFS::Client wrapper
       Coming soon…

4.MogileFS with Catalyst          Shibuya Perl Mongers Technical Talk #7
TODO, etc



              TODO, etc


5.TODO, etc               Shibuya Perl Mongers Technical Talk #7
Inside MogileFS
     MogileFS::Worker::*
       Clientからquery workerまでの処理につ
       いて、はてダでメモってます。
              http://d.hatena.ne.jp/ZIGOROu/20061018/1161155472


       他のworkerの処理もきちんと⾒ておき
       たい。
       随時、はてダで更新します!

5.TODO, etc                            Shibuya Perl Mongers Technical Talk #7
MySQL NDB Cluster
     NDB Cluster
      透過的にスケール出来る
      最近、情報追ってない
              http://hogehoge.que.jp/thh4601/wiki/index.php?MySQLCluster


      実運⽤されてる⽅が居たら是⾮お話聞
      きたいです。


5.TODO, etc                                     Shibuya Perl Mongers Technical Talk #7
X-Sendfile Header on lighttpd
     from storage to user via webapp
       MogileFSを使う上でそのままで使った
       らアーキテクチャ的にボトルネックが
       多すぎないか?
       X-Sendfile Headerのような事は出来な
       いか?
                   http://unknownplace.org/memo/2006/07/21




5.TODO, etc                       Shibuya Perl Mongers Technical Talk #7
Perlbal
     Using MogileFS with Perlbal
       どうもPerlbalでそれらが解決できるん
       じゃないか?
       Perlbal::BackendHTTPモジュールがど
       うもそれっぽぃ
       Perlbalも勉強せねば!



5.TODO, etc                 Shibuya Perl Mongers Technical Talk #7
Gearman
     Gearman
       Bradが作ったtaskの並列処理システム
       Productで使わないから本⼈余り興味が
       無いらしい
       すっごい⾯⽩そうwww



5.TODO, etc          Shibuya Perl Mongers Technical Talk #7
まとめ
       MogileFS使うとスケーラビリティの⾼
       いストレージが安価で構築できるよ
       運⽤に⾄るまでにはまだまだ実験が必要
       関連CPANモジュール増えてきた

   MogileFS使おう!それMog(ry


5.TODO, etc          Shibuya Perl Mongers Technical Talk #7
PR
     PR of our company
       ⼀緒に開発してくれるPerlな⽅とか
       JavaScriptな⽅とか絶賛募集中!

      http://www.3zai.com/global/staff
       やる気重視です。
       お待ちしてます^^


5.TODO, etc                   Shibuya Perl Mongers Technical Talk #7
Thanks

           ご清聴
       ありがとうございました。
                               Toru Yamaguchi
                               <zigorou@cpan.org>




Special thank Sakai@SixApart
5.TODO, etc                    Shibuya Perl Mongers Technical Talk #7

More Related Content

Similar to shibuya_pm_tt07_mogilefs_with_catalyst

Accurate and efficient software microbenchmarks
Accurate and efficient software microbenchmarksAccurate and efficient software microbenchmarks
Accurate and efficient software microbenchmarksDaniel Lemire
 
Pse2010 rel storage
Pse2010 rel storagePse2010 rel storage
Pse2010 rel storageLars Noldan
 
MySQL Tuning using digested slow-logs
MySQL Tuning using digested slow-logsMySQL Tuning using digested slow-logs
MySQL Tuning using digested slow-logsBob Burgess
 
One Click Provisioning With Enterprise Manager 12c
One Click Provisioning With Enterprise Manager 12cOne Click Provisioning With Enterprise Manager 12c
One Click Provisioning With Enterprise Manager 12cJosh Turner
 
yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909Yusuke Wada
 
Day1 CourseIntroduction
Day1 CourseIntroductionDay1 CourseIntroduction
Day1 CourseIntroductionRon Liu
 
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...HostedbyConfluent
 
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedBrendan Gregg
 
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java DevelopersHostedbyConfluent
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslogamiable_indian
 
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey GordeychikCODE BLUE
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache KafkaShiao-An Yuan
 
Rails Deployment with NginX
Rails Deployment with NginXRails Deployment with NginX
Rails Deployment with NginXStoyan Zhekov
 
20150918 klug el performance tuning-v1.4
20150918 klug el performance tuning-v1.420150918 klug el performance tuning-v1.4
20150918 klug el performance tuning-v1.4Jinkoo Han
 

Similar to shibuya_pm_tt07_mogilefs_with_catalyst (20)

Blogopolisの裏側
Blogopolisの裏側Blogopolisの裏側
Blogopolisの裏側
 
iSoligorsk #3 2013
iSoligorsk #3 2013iSoligorsk #3 2013
iSoligorsk #3 2013
 
Accurate and efficient software microbenchmarks
Accurate and efficient software microbenchmarksAccurate and efficient software microbenchmarks
Accurate and efficient software microbenchmarks
 
Pse2010 rel storage
Pse2010 rel storagePse2010 rel storage
Pse2010 rel storage
 
MySQL Tuning using digested slow-logs
MySQL Tuning using digested slow-logsMySQL Tuning using digested slow-logs
MySQL Tuning using digested slow-logs
 
Implementing SSH in Java
Implementing SSH in JavaImplementing SSH in Java
Implementing SSH in Java
 
One Click Provisioning With Enterprise Manager 12c
One Click Provisioning With Enterprise Manager 12cOne Click Provisioning With Enterprise Manager 12c
One Click Provisioning With Enterprise Manager 12c
 
yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909yusukebe in Yokohama.pm 090909
yusukebe in Yokohama.pm 090909
 
Day1 CourseIntroduction
Day1 CourseIntroductionDay1 CourseIntroduction
Day1 CourseIntroduction
 
Survey of Percona Toolkit
Survey of Percona ToolkitSurvey of Percona Toolkit
Survey of Percona Toolkit
 
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
 
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started
 
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
🐲 Here be Stacktraces — Flink SQL for Non-Java Developers
 
Centralized Logging with syslog
Centralized Logging with syslogCentralized Logging with syslog
Centralized Logging with syslog
 
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
Development Principles & Philosophy
Development Principles & PhilosophyDevelopment Principles & Philosophy
Development Principles & Philosophy
 
Racing with Droids
Racing with DroidsRacing with Droids
Racing with Droids
 
Rails Deployment with NginX
Rails Deployment with NginXRails Deployment with NginX
Rails Deployment with NginX
 
20150918 klug el performance tuning-v1.4
20150918 klug el performance tuning-v1.420150918 klug el performance tuning-v1.4
20150918 klug el performance tuning-v1.4
 

More from Hiroshi Ono

Voltdb - wikipedia
Voltdb - wikipediaVoltdb - wikipedia
Voltdb - wikipediaHiroshi Ono
 
Gamecenter概説
Gamecenter概説Gamecenter概説
Gamecenter概説Hiroshi Ono
 
EventDrivenArchitecture
EventDrivenArchitectureEventDrivenArchitecture
EventDrivenArchitectureHiroshi Ono
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdfHiroshi Ono
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdfHiroshi Ono
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfHiroshi Ono
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdfHiroshi Ono
 
BOF1-Scala02.pdf
BOF1-Scala02.pdfBOF1-Scala02.pdf
BOF1-Scala02.pdfHiroshi Ono
 
TwitterOct2008.pdf
TwitterOct2008.pdfTwitterOct2008.pdf
TwitterOct2008.pdfHiroshi Ono
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfHiroshi Ono
 
SACSIS2009_TCP.pdf
SACSIS2009_TCP.pdfSACSIS2009_TCP.pdf
SACSIS2009_TCP.pdfHiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfHiroshi Ono
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdfHiroshi Ono
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdfHiroshi Ono
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfHiroshi Ono
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfHiroshi Ono
 

More from Hiroshi Ono (20)

Voltdb - wikipedia
Voltdb - wikipediaVoltdb - wikipedia
Voltdb - wikipedia
 
Gamecenter概説
Gamecenter概説Gamecenter概説
Gamecenter概説
 
EventDrivenArchitecture
EventDrivenArchitectureEventDrivenArchitecture
EventDrivenArchitecture
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdf
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdf
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdf
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
downey08semaphores.pdf
downey08semaphores.pdfdowney08semaphores.pdf
downey08semaphores.pdf
 
BOF1-Scala02.pdf
BOF1-Scala02.pdfBOF1-Scala02.pdf
BOF1-Scala02.pdf
 
TwitterOct2008.pdf
TwitterOct2008.pdfTwitterOct2008.pdf
TwitterOct2008.pdf
 
camel-scala.pdf
camel-scala.pdfcamel-scala.pdf
camel-scala.pdf
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
 
SACSIS2009_TCP.pdf
SACSIS2009_TCP.pdfSACSIS2009_TCP.pdf
SACSIS2009_TCP.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdfstateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
stateyouredoingitwrongjavaone2009-090617031310-phpapp02.pdf
 
program_draft3.pdf
program_draft3.pdfprogram_draft3.pdf
program_draft3.pdf
 
nodalities_issue7.pdf
nodalities_issue7.pdfnodalities_issue7.pdf
nodalities_issue7.pdf
 
genpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdfgenpaxospublic-090703114743-phpapp01.pdf
genpaxospublic-090703114743-phpapp01.pdf
 
kademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdfkademlia-1227143905867010-8.pdf
kademlia-1227143905867010-8.pdf
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

shibuya_pm_tt07_mogilefs_with_catalyst

  • 1. Learning MogileFS Building scalable storage system Toru Yamaguchi <zigorou@cpan.org> Yet Another Hackadelic (d:id:ZIGOROu) Shibuya Perl Mongers Technical Talk #7
  • 2. about ZIGOROu - Toru Yamaguchi - 株式会社ガイアックス ICDグループマネージャ 散財.com Graffiti SNS 初参戦なので、緊張気味w よろしくお願いします。:-) 0.begining Shibuya Perl Mongers Technical Talk #7
  • 3. Agenda Overview Installation and Configuration Demo and Using MogileFS MogileFS with Catalyst TODO, etc 0.begining Shibuya Perl Mongers Technical Talk #7
  • 4. Overview Overview 1.overview 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
  • 6. About MogileFS (1) MogileFSって何? danga.com(SixApart)で開発された、 オープンソースの分散ファイルシステ ムです。 File storageサービスには持って来い まだまだ⽇本語のソースは少ないです。 本家のドキュメントも更新が追いついてない。 1.overview Shibuya Perl Mongers Technical Talk #7
  • 7. About MogileFS (2) MogileFSの作者は? Brad Fitzpatrick さんです。読めない… イケメン、モテ系? memcached Perlbal その他、多数。 まさにHacker! 1.overview Shibuya Perl Mongers Technical Talk #7
  • 8. About MogileFS (3) MogileFSの良いところは? 特殊なカーネルモジュール不要 シングルポイントが無い ⾃動で無駄なくレプリカ作成 RAID, SANなど⼀切不要 ファイルシステムに依存しない 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
  • 10. About MogileFS (5) MogileFSを使える⾔語は? 公式ではPerlだけです。 MogileFS::Client http://search.cpan.org/~bradfitz/MogileFS-Client-1.03/ でもPHP,Ruby,Python,Javaなどの実装 もあります! Note of MogileFS #02 – mogilefs client http://d.hatena.ne.jp/ZIGOROu/20061012/1160670015 1.overview Shibuya Perl Mongers Technical Talk #7
  • 11. History around MogileFS MogileFS Summit MogileFS Summit SixApart TechBlog(jp) SixApart TechBlog(jp) Shibuya.pm TechTalk #7 Shibuya.pm TechTalk #7 MogileFS release (*1) MogileFS release (*1) MogileFS Perlbal release Perlbal release ブームの予感!! memcached release memcached release LiveJournal open LiveJournal open いまココ! 1999 2003 2004 2005 2006 2007 は と同時期に開設しています。 1.overview Shibuya Perl Mongers Technical Talk #7
  • 12. MogileFS Architecture (1) MogileFS components clients(MogileFS::Client) trackers(mogilefsd) mysql database cluster (recommend NDB Cluster) storage nodes(mogstored, Apache with WebDAV, lighthy or other) 1.overview Shibuya Perl Mongers Technical Talk #7
  • 13. MogileFS Architecture (2) MogileFS Client MogileFSをネットワークを介したハンド ルとして取得できる。 ファイルごとstoreしたりとか ファイルを消したり ファイルの実体(url)を取得したり 1.overview Shibuya Perl Mongers Technical Talk #7
  • 14. MogileFS Architecture (3) trackers(mogilefsd) MogileFSの司令塔役 Clientからのリクエストを受け付ける query workerなどのdaemon 状態をdatabaseで管理する mogstored(WebDAV)にファイル操作指 令を出す 1.overview Shibuya Perl Mongers Technical Talk #7
  • 15. MogileFS Architecture (4) mysql database cluster その名の通りNDB Cluster推奨 storage nodeの管理 nodeごとのdomain, device, classの管理 Fileのインデックス化、状態管理 は でも構築可能 1.overview Shibuya Perl Mongers Technical Talk #7
  • 16. MogileFS Architecture (5) storage node(mogstored) WebDAVサポートのhttpd だからApache2 with WebDAVとか lighttpdでも動作する (*1) mogstoredはPerlbalで出来てる 今回は での構築事例です。 1.overview Shibuya Perl Mongers Technical Talk #7
  • 17. MogileFS Architecture (6) Search ‘MogileFS’ by Google Image ちょww 中国語wwww http://pencywin.spaces.live.com/ 1.overview Shibuya Perl Mongers Technical Talk #7
  • 18. MogileFS Architecture (7) Component overview mogilefs client CommandをRESTで送信 trackers (mogilefsd : 7001) IO::Handleとして 送受信 storageの状態管理 replication database (mysql) storage node (mogstored: 7500) 1.overview Shibuya Perl Mongers Technical Talk #7
  • 19. MogileFS Architecture (8) File storaging overview storage node 1 dev1 dev1 dev3 dev3 dev5 dev5 File Replication w orker によって ⾃動的にレプリカ⽣成 domain : foo.com class : bar key : piyo dev2 dev2 dev4 dev4 dev6 dev6 fid : 1 storage node 2 mindevcountが3の場合 Shibuya Perl Mongers Technical Talk #7
  • 20. Installation and Configuration Installation and Configuration 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 21. Setup Environment Setup environment 2台のFedora Core3で構築する例です。 可能なものはserverを除きCPANからイ ンストール 他のモジュールはsvnから2.0系を debianだとちょっと楽 http://mogilefs.schtuff.com/another_how_to_install_mogilefs_debian_sarge 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 22. Install CPAN Modules CPANからインストールする perl –MCPAN –e “install IO::AIO” (*1) perl –MCPAN –e “install Net::Netmask” perl –MCPAN –e “install Perlbal” perl –MCPAN –e “install MogileFS::Client” (*1) debi anなら を⼊れる。優先順位は になってます。 ついでに もインストールして下さい。 2.Installation and Configuration 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
  • 27. Setup mogstored (1) make directories # mkdir –p /etc/mogilefs # mkdir –p /var/mogdata /var/mogdataはApacheで⾔うところ のDocumentRoot このディレクトリ以下にファイルが置 かれます。(storage nodeの実体) 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 28. Setup mogstored (2) confファイルの作成 # cd /etc/mogilefs # cat > mogstored.conf << MOGSTORED_CONF > httplisten=10.255.255.30:7500 > mgmtlisten=10.255.255.30:7501 > docroot=/var/mogdata > MOGSTORED_CONF (* 1 ) s erver/conf内の は古くて使えません 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
  • 30. Setup mogilefsd (1) copy mogilefsd.conf & adduser # cd ~zigorou/src/mogilefs/server/conf # cp mogilefsd.conf /etc/mogilefs # /usr/sbin/useradd –s /bin/false mogile 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
  • 32. Starting daemons start mogstored, mogilefsd # mogstored -d # sudo –u mogile mogilefsd 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 33. Setup storage node (1) Setup steps register storage ‘host’ register storage ‘device’ register storage ‘domain’ register storage ‘class’ 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 34. Setup storage node (2) keywords of storage nodes (1) hostとはstorage nodeで⽴ち上がって るhttpd(WebDAV)の事 deviceはdocroot以下に出来るディレ クトリの名前の事 イメージとしてはハードディスクみた いな物(実際そうmountするのもアリ) 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 35. Setup storage node (3) keywords of storage nodes (2) domainは概念上のファイル区別のTOP に当たる。 domainには複数のclassを定義出来る。 classの中にkeyをインデックスとして fidが付いたファイルをstore keyはclassにひもづく階層ではなくフ ラットな構造 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 36. Setup storage node (4) mogadm storage nodeを管理する為のツール MogileFS::Utilsの中にあります /etc/mogilefs/mogilefs.conf, ~/.mogilefs.conf, --configで指定された ファイルを設定ファイルに出来る。 ⾯倒なtrackers指定はココに⼊れると吉。 では無いので注意! 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 37. Setup storage node (5) register storage host mogadm host addを使います。 # mogadm host add 10.255.255.30 # mogadm host add 10.255.255.31 (* 1 ) m og ilefs .confに 設定があること前提 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 38. Setup storage node (6) register storage device (1) device分だけディレクトリを作成しま しょう。 # mkdir –p /var/mogdata/{“dev1”,”dev3”} 全てのstorage nodeで登録したい device分ディレクトリを作成 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 39. Setup storage node (7) register storage device (2) mogadm device addを使います。 # mogadm device add 10.255.255.30 1 # mogadm device add 10.255.255.31 2 異なるhostに同⼀deviceは追加できま せん! 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 40. Setup storage node (8) check trackers, hosts and devices mogadm checkを使います。 # mogadm check trackers, host, deviceのリスト及び状 態が表⽰されます。 2.Installation and Configuration Shibuya Perl Mongers Technical Talk #7
  • 41. Setup storage node (9) register storage domain mogadm domain addを使います。 # mogadm domain add www.3zai.com 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
  • 49. MogileFS::Client (2) new_file method ファイルを⽣成するメソッドはこのメ ソッドに依存する trackersにcreate_openコマンドを送信 ランダムにdeviceを取り出し、PATHで 指定されたディレクトリ作成 そのpathへのPUTをIO::Handleとして取 得する 3.Demo and Using MogileFS Shibuya Perl Mongers Technical Talk #7
  • 50. MogileFS::Client (3) rename method rename($from_key, $to_key) 当初指定したclassを変更する事が出来 ない。 mindevcountによる重要度の変更が簡 単に出来ない 3.Demo and Using MogileFS Shibuya Perl Mongers Technical Talk #7
  • 51. MogileFS with Catalyst MogileFS with Catalyst 4.MogileFS with Catalyst Shibuya Perl Mongers Technical Talk #7
  • 52. Hook upload process (1) Idea1 : Hook upload process まさにuploadされたファイルを MogileFSに突っ込んだら便利ではと考 えた。 応⽤としてはconfirm付きのupload formとか。 これはかなり無謀でした 4.MogileFS with Catalyst Shibuya Perl Mongers Technical Talk #7
  • 53. Hook upload process (2) Catalyst::Engine->prepare_body Multipart部の処理とtmpfile化は HTML::Body(::Multipart)モジュール依 存 Engine, HTML::Bodyとか書き換え⼤杉 そもそも拡張ポイントじゃないしw 4.MogileFS with Catalyst Shibuya Perl Mongers Technical Talk #7
  • 54. Catalyst::Model::MogileFS (1) idea2 : file access model class やはり能動的にファイルアクセスする べきと考えた。 script/myapp_create.pl model FileStorage::Some MogileFS [options] MogileFS::Client wrapper Coming soon… 4.MogileFS with Catalyst Shibuya Perl Mongers Technical Talk #7
  • 55. TODO, etc TODO, etc 5.TODO, etc Shibuya Perl Mongers Technical Talk #7
  • 56. Inside MogileFS MogileFS::Worker::* Clientからquery workerまでの処理につ いて、はてダでメモってます。 http://d.hatena.ne.jp/ZIGOROu/20061018/1161155472 他のworkerの処理もきちんと⾒ておき たい。 随時、はてダで更新します! 5.TODO, etc Shibuya Perl Mongers Technical Talk #7
  • 57. MySQL NDB Cluster NDB Cluster 透過的にスケール出来る 最近、情報追ってない http://hogehoge.que.jp/thh4601/wiki/index.php?MySQLCluster 実運⽤されてる⽅が居たら是⾮お話聞 きたいです。 5.TODO, etc Shibuya Perl Mongers Technical Talk #7
  • 58. X-Sendfile Header on lighttpd from storage to user via webapp MogileFSを使う上でそのままで使った らアーキテクチャ的にボトルネックが 多すぎないか? X-Sendfile Headerのような事は出来な いか? http://unknownplace.org/memo/2006/07/21 5.TODO, etc Shibuya Perl Mongers Technical Talk #7
  • 59. Perlbal Using MogileFS with Perlbal どうもPerlbalでそれらが解決できるん じゃないか? Perlbal::BackendHTTPモジュールがど うもそれっぽぃ Perlbalも勉強せねば! 5.TODO, etc Shibuya Perl Mongers Technical Talk #7
  • 60. Gearman Gearman Bradが作ったtaskの並列処理システム Productで使わないから本⼈余り興味が 無いらしい すっごい⾯⽩そうwww 5.TODO, etc Shibuya Perl Mongers Technical Talk #7
  • 61. まとめ MogileFS使うとスケーラビリティの⾼ いストレージが安価で構築できるよ 運⽤に⾄るまでにはまだまだ実験が必要 関連CPANモジュール増えてきた MogileFS使おう!それMog(ry 5.TODO, etc Shibuya Perl Mongers Technical Talk #7
  • 62. PR PR of our company ⼀緒に開発してくれるPerlな⽅とか JavaScriptな⽅とか絶賛募集中! http://www.3zai.com/global/staff やる気重視です。 お待ちしてます^^ 5.TODO, etc Shibuya Perl Mongers Technical Talk #7
  • 63. Thanks ご清聴 ありがとうございました。 Toru Yamaguchi <zigorou@cpan.org> Special thank Sakai@SixApart 5.TODO, etc Shibuya Perl Mongers Technical Talk #7