设为首页 收藏本站
查看: 1041|回复: 0

[经验分享] Another How to Install MogileFS

[复制链接]

尚未签到

发表于 2016-5-5 12:30:06 | 显示全部楼层 |阅读模式
  coofucoo: because china government block this tech site, i access itvery slow. So i copy the content from offical wiki to make me and youconveniently.
  This is created from a bunch of sources. You may notice that some ofit comes from the other How To. I have tested this many times and itworks great!
  Doug Kersten
  INSTALLING MOGILEFS
  If you haven't already done so add user mogilefsd:
  adduser mogilefsd
  mkdir /etc/mogilefs
  cd /etc/mogilefs
  Apt-get install subversion
  svn checkout http://code.sixapart.com/svn/mogilefs/trunk/
  now you have the code.
  apt-get install liblinux-aio-perl
  apt-get install libbsd-resource-perl
  apt-get install libcompress-zlib-perl
  apt-get install libnet-netmask-perl
apt-get install libio-stringy-perl
apt-get install libwww-perl
  perl -MCPAN -e shell;
  Answer default to all questions until you get to the locationinformation and then choose your country and then your default ftp site.
  at the > prompt do this:
  install X::Y
  Do this with the following:
  install Danga::Socket
  install DBI
  Where X::Y is the name of the missing module.  You may have to do this several
  times.
  exit
  Install PerlBal
  Mkdir /etc/perlbal
  cd /etc/perlbal
  svn checkout http://code.sixapart.com/svn/perlbal/trunk
  cd /etc/perlbal/trunk
  perl Makefile.PL
  make
make test
  make install
  Install MogileFS (mogilefsd and mogstored)
  cd /etc/mogilefs/trunk/server
  perl Makefile.PL
  make
  make install
  now as root
  mkdir /var/mogdata/dev1
  As you add more devices add more of these directories
  Now for the interesting part.
  Install Mogadm (Mogile Utilities):
  cd /etc/mogilefs/trunk/utils
  perl Makefile.PL
  make
  make install
  CREATE MYSQL DATABASE
  You should have mysql installed.  I'm going to assume you do.
  Using phpadmin create a mog user (mog_user)
  create a password for mog user (mogpass)
  OR
  Grant access to remote user by doing:
$> mysql -u root -prootpassword
  $> GRANT usage ON .to mog_user@www.domainname.com (put the correct user/domain(source) here)
$> IDENTIFIED BY 'mogpassword';
  $> GRANT ALL PRIVILEGES
  $> ON .TO mog_uer@www.domainname.com WITH GRANT OPTION;
  exit
  /etc/init.d/mysql restart
  Automatically create a database for the mogilefs:
  cd etc/mogilefs/trunk/server
  vi mogdbsetup
  edit the following:
  dbhost => "localhost",
  dbname => "mogilefs",
  dbrootuser => "root",
  dbrootpass => "root_password",
  dbuser => "mog_user",
  dbpass => "mogpass",
  save and run /etc/mogilefs/trunk/server/mogdbsetup
  you will be asked a series of questions.  Answer yes to them all.
  The mogilefs database should be created.  Check in phpmyadmin to verify.
  Remove the id and password information when you are finished from mogdbsetup.
  YOU MUST DO THIS it solves errors about lib path when running mogadm are solved by the following:
  Do this - to set up MogileFS.pm go to the /etc/mogilefs/trunk/api/perl directory and do
  perl Makefile.PL
  make
  make test
  make install (assuming all goes well).
  You may have to cpan install something based on the errors from perl Makefile.PL.
  Install Mogilefs utils:
  cd /etc/mogilefs/trunk/utils
  perl Makefile.PL
  make
  make test
  make install
  Configure Mogstored:
  On each storage server, create a configuration file at /etc/mogilefs/mogstored.conf with the following:
  httplisten=0.0.0.0:7500
  mgmtlisten=0.0.0.0:7501
  docroot=/var/mogdata
  Startup Mogstored:
  open a putty session as root and type mogstored.  Mogstored should start.
  Configure MogileFS:
  edit the bold areas of the mogilefsd.conf file:
  cp /etc/mogilefs/trunk/server/conf/mogilefsd.conf /etc/mogilefs/mogilefsd.conf
  #daemonize = 1
  db_dsn = DBI:mysql:mogilefs:host=127.0.0.1
  db_user = mog_user
  db_pass = dbpass
  conf_port = 7001
  listener_jobs = 10
  delete_jobs = 1
  replicate_jobs = 5
  mog_root = var/mogdata
  reaper_jobs = 1
  launch new putty session ( I use putty: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
  for my ssh sessions to the server.).
  login as mogilefsd
  at the command prompt run mogilefsd
  Use 'mogadm' to add each storage server to the database.
  The following example would add the host mogilestorage.yourdomain.comas a storage server, assuming that mogilestorage.yourdomain.comhad an IP address of 192.168.42.3 (listening on port 7500) and yourtracker had an IP address of 192.168.42.1 (listening on port 6001):
  # mogadm --lib=/usr/local/share/perl/5.8.4--trackers=192.168.42.1:6001 host add mogilestorage --ip=192.168.42.3--port=7500 --status=alive
  You can confirm that your host(s) were added with the following command;
  # mogadm --lib=/usr/local/share/perl/5.8.4 --trackers=192.168.42.1:6001 host list
  You also need to add devices for each storage host. If you don'tprovide a device id mogadm is supposed to do it for you... in practiceI find it dies with an error, so you will need to manually add a uniquedevice id after the host:
# mogadm --lib=/usr/local/share/perl/5.8.4 --trackers=192.168.42.1:6001 device add mogilestorage 1
  Finally, add the correctly-name device (folder) to each storagehost. I have been unable to get the tools to handle this well, so I amprobably doing something wrong. As a workaround, I used the modadmdevice list command to see what device names were assigned and then Iadded the folders to my storage hosts. Run the following command:
  # mogadm --lib=/usr/local/share/perl/5.8.4 --trackers=192.168.42.1:6001 device list
  It will list each host and the device name followed by its status and storage available. Here is example output:
  mogilestorage 1: alive
  used(G) free(G) total(G)
  dev1: alive 0.892 67.772 68.664
  This means "mogilestorage" has a host id of "1" and it has onedevice named "dev1" on it and that device is in the "alive" state (yourother statistics will probably be zeros). Using the example outputabove, you would simply create the directory on mogilestorage.yourdomain.com:
  You can also test using mogadm:
  mogadm -–trackers=127.0.0.1:7001 check
  use mogadm to add the host:
mogadm --trackers=127.0.0.1:7001 host add host1
domain:
mogadm --trackers=127.0.0.1:7001 domain add storage
and class:
mogadm --trackers=127.0.0.1:7001 class add storage files.
  Go into phpmyadmin, open the hosts table and change the host statusto alive and add a device with device id 1, host id 1 and status =alive in the device table.
  OR
  mogadm -–trackers=127.0.0.1:7001 device add device1 1
  and mark the device alive
  mogadm -–trackers=127.0.0.1:7001 device mark host1,cin 1 alive
  check your devices:
  mogadm -–trackers=127.0.0.1:7001 device list
  Check it out:
  mogadm -–trackers=127.0.0.1:7001 check
  If everything checks out ok you will see the following:
  Checking trackers...
  127.0.0.1:7001 ... OK
  Checking hosts...
  1host1 ... OK
  Checking devices...
  host device            size(G)    used(G)    free(G)   use%
  1dev1              138.236      0.143    138.094   0.10%
  total:   138.236      0.143    138.094   0.10%
  Once everything is working you can daemonize mogilefsd:
  edit the mogilefsd.conf file and remove the # in front of daemonize:
  vi /etc/mogilefs/mogilefsd.conf
  daemonize = 1
  db_dsn = DBI:mysql:mogilefs:host=127.0.0.1
  db_user = mog_user
  db_pass = dbpass
  conf_port = 7001
  listener_jobs = 10
  delete_jobs = 1
  replicate_jobs = 5
  mog_root = var/mogdata
  reaper_jobs = 1
  To start mogstored as a daemon type:
  mogstored -d
  To test and see if it's mogstored that's messed up or something along
  the way, try telnetting to your mogstored (port 7500 by default) and
  doing this:
  PUT /dev1/test HTTP/1.0
  Content-length: 4
  test
  See if that creates the 'test' file in your /var/mogdata/dev1 directory.
  If it works, good, if it doesn't, you should get back a 404/something with
  a more detailed error message.
  Now put a file onto mogstored via mogilefsd (tracker):
  cd /etc
  mogtool –-trackers=127.0.0.1:7001  --domain=domainname –-class=classname inject motd motd
  check /var/mogdata/dev1/0/000/000 for a file named xxxxxxxxxx.fid . If the file exists everything is successful.
  Now delete the file:
  mogtool –-trackers=127.0.0.1:7001  --domain=domainname –-class=classname delete motd
  check /var/mogdata/dev1/0/000/000 and the file should be gone.
  It's all good!

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-212970-1-1.html 上篇帖子: Linux分布式mogilefs文件系统 下篇帖子: 分布式系统介绍及MogileFS安装、基本配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表