Upgrade to Pro — share decks privately, control downloads, hide ads and more …

glusterfs-pmux

maebashi
November 13, 2013

 glusterfs-pmux

GlusterFSを利用した軽量MapReduceフレームワークpmux
2013/11/13 Gluster Cloud Night 発表資料
(於 レッドハット株式会社)

maebashi

November 13, 2013
Tweet

More Decks by maebashi

Other Decks in Technology

Transcript

  1. ©ɹ2013 Internet Initiative Japan Inc. ©ɹ2013 Internet Initiative Japan Inc.

    GlusterFSΛར༻ͨ͠ ܰྔMapReduceϑϨʔϜϫʔΫ Pmux גࣜձࣾΠϯλʔωοτΠχγΞςΟϒ [email protected]
  2. ©ɹ2013 Internet Initiative Japan Inc. ࣗݾ঺հ •  લڮ޹޿(Takahiro Maebashi) • 

    גࣜձࣾΠϯλʔωοτΠχγΞςΟϒ(IIJ) •  ITpro: ITݕূϥϘ -- ෼ࢄϑΝΠϧγεςϜͷ GlusterFSɿ͜Μͳͱ͖ɺͲ͏ͳΔ – http://itpro.nikkeibp.co.jp/ article/COLUMN/20130104/447701/!
  3. ©ɹ2013 Internet Initiative Japan Inc. What is GlusterFS? (2) (ྫ:

    distributed volume ͷ৔߹) ϑΝΠϧ୯ҐͰɺϑΝΠϧ໊ʹԠͯ͡෼ࢄ
  4. ©ɹ2013 Internet Initiative Japan Inc. What is pmux? (1) • 

    pipeline multiplexer ʹ༝དྷ •  RubyͰهड़͞Ε͍ͯΔ • https://github.com/iij/pmux! • https://forge.gluster.org/pmux!
  5. ©ɹ2013 Internet Initiative Japan Inc. What is pmux? (2) • 

    ϑΝΠϧϕʔεͷ map/reduce πʔϧ •  Unix ͷඪ४ೖྗ/ग़ྗΛΠϯλϑΣʔεͱͯ͠ ࢖͏ $ pmux --mapper="grep PATTERN" *.log Example: ෼ࢄgrep GlusterFS্ͷϑΝΠϧ
  6. ©ɹ2013 Internet Initiative Japan Inc. Install $ gem install pmux

    $ gem install pmux $ gem install gflocator $ sudo gflocator
  7. ©ɹ2013 Internet Initiative Japan Inc. ֦ுϑΝΠϧଐੑ (2) $ sudo getfattr

    -n trusted.glusterfs.pathinfo \! access_log.20131020! # file: access_log.20131020! trusted.glusterfs.pathinfo="(<DISTRIBUTE:d2r2-! dht> (<REPLICATE:d2r2-replicate-0> <POSIX(/glu! sterfs/brick/d2r2):ex01.example.com:/glusterfs! /brick/d2r2/log/0000/access_log.20131020> <POS! IX(/glusterfs/brick/d2r2):ex00.example.com:/gl! usterfs/brick/d2r2/log/0000/access_log.2013102! 0>))"
  8. ©ɹ2013 Internet Initiative Japan Inc. 3. map tasks Λ֤ϊʔυʹׂΓ౰ͯ tasks

    are assigned to nodes(workers) dynamically dispatcher worker
  9. ©ɹ2013 Internet Initiative Japan Inc. example(1): εςʔλείʔυΛ਺͑Δ Apache log ͷHTTPεςʔλείʔυͷग़ݱ਺Λ਺͑Δ

    $ pmux --mapper='cut -d" " -f 9’ \ --reducer='sort|uniq -c’ /mnt/glusterfs/*.log 176331 200 106360 206 809 400 21852 403 533 404 27 406 805 416 25 500
  10. ©ɹ2013 Internet Initiative Japan Inc. example(2): word count $ pmux

    --mapper=map.rb --reducer=reduce.rb \ --file=map.rb –-file=reduce.rb \ /mnt/glusterfs/*.txt #! /usr/bin/ruby -an $F.each {|f| print "#{f}\t1\n"} #! /usr/bin/ruby -an BEGIN {$c = Hash.new 0} $c[$F[0]] += $F[1].to_i END {$c.each {|k, v| print "#{k} #{v}\n"}} map.rb reduce.rb command line
  11. ©ɹ2013 Internet Initiative Japan Inc. ੑೳ 14:00:00.416011 IP 21.44.60.29.http >

    170.73.162.175.58546: . 3523999974:3524001422(1448) ack 3401170238 win 1716 <nop,nop,timestamp 1070614671 1955062367> ҎԼͷΑ͏ͳύέοτΩϟϓνϟϩά (by tcpdump) ֤ϑΝΠϧͰ࠷΋ग़ݱ਺ͷଟ͍IPΞυϨεΛநग़͢Δ 8344 files, 500K lines/file, total 4 billion lines
  12. ©ɹ2013 Internet Initiative Japan Inc. ݁Ռ 8 hr 49 min

    6 sec 1 min 45 sec 300ഒ! 1 node, without pmux 60 nodes (֤ϊʔυ8ίΞ)