MogileFS的架构如下
mogilefs-02
在一个MogileFS集群里,存在三种角色的节点
在MogileFS中file被定义为上传到storage node的一系列bits,在系统内以domain内唯一的key来标识。一个file属于一个class,class为一组属性值。
ip | hostname |
10.1.192.63 | cluster-database |
10.1.192.58 | cluster-master01 |
10.1.192.59 | cluster-master02 |
10.1.192.60 | cluster-segment01 |
10.1.192.61 | cluster-segment02 |
10.1.192.62 | cluster-segment03 |
此五台服务器是vmware vSphere上的五台虚拟机,虚拟机挂在一个新增vmware network2端口下,服务器之间通过vmware switch连接,端口速率为10000Mbps;
mogilefs-03
由于模块间的依赖关系并没有按照服务器角色区分严格,建议在所有的服务器下安装如下模块:
在cluster-database上初始化数据库
建立用户与database
1 2 3 4 5 6 | CREATE DATABASE mogilefs ; GRANT ALL ON mogilefs . * TO ‘mogile’ @ ‘cluster-database’ ; SET PASSWORD FOR ‘mogile’ @ ‘ibm01’ = OLD_PASSWORD ( ‘mo’ ) ; GRANT ALL ON mogilefs . * TO ‘mogile’ @ ‘%’ ; SET PASSWORD FOR ‘mogile’ @ ‘%’ = OLD_PASSWORD ( ‘mo’ ) ; FLUSH PRIVILEGES ; |
初始化数据库
1 | mogdbsetup — dbname = mogilefs — dbuser = mogile — dbpass = mo |
1 2 3 4 5 6 7 8 9 10 11 12 | mkdir – p / etc / mogilefs echo << END > mogilefsd . conf db_dsn = DBI : mysql : mogilefs : host = cluster – database ; port = 3306 ; mysql_connect_timeout = 5 #db连接串 db_user = mogile db_pass = mo conf_port = 7001 #管理端口 listener_jobs = 5 node_timeout = 5 rebalance_ignore_missing = 1 END |
1 2 3 4 5 6 7 | mkdir – p / etc / mogilefs echo << END > mogstored . conf httplisten = 0.0.0.0 : 7500 mgmtlisten = 0.0.0.0 : 7501 docroot = / data / mogData #http server侦听目录 END |
1 | mkdir – p / data / mogData / dev [ 1 – n ] |
启动tracker
1 | mogilefsd – c / etc / mogilefs / mogilefsd . conf — daemon |
增加host与device
1 2 3 4 5 6 | mogadm — trackers = cluster – master01 : 7001 host add segment01 — ip = 10.1.192.60 — status = alive mogadm — trackers = cluster – master01 : 7001 host add segment02 — ip = 10.1.192.61 — status = alive mogadm — trackers = cluster – master01 : 7001 host add segment03 — ip = 10.1.192.62 — status = alive mogadm — trackers = cluster – master01 : 7001 device add segment01 1 mogadm — trackers = cluster – master01 : 7001 device add segment02 2 mogadm — trackers = cluster – master01 : 7001 device add segment03 3 |
文章转载来自:trustauth.cn
上一篇:Redis 2.6.16 rotate.aof 功能说明
下一篇:PHP曝DOS漏洞可致CPU灌满 涉及多个PHP版本