配置网卡
root@mfs-master:~# vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 10.10.1.219
netmask 255.255.255.0
gateway 10.10.1.1
# vi /etc/hosts
10.10.1.219 mfs-master
10.10.1.220 mfs-metalogger
10.10.1.221 mfs-chunk
10.10.1.223 mfs-chunk2
10.10.1.224 mfs-chunk3
10.10.1.222 mfs-client
安装软件
(1)安装编译依赖包
root@mfs-master:~# apt-get install -y build-essential pkg-config zlib1g-dev gcc
(2)下载软件
root@mfs-master:~# wget http://sourceforge.net/projects/moosefs/files/latest/download
由于下载的文件名是download,所以需要重命名
root@mfs-master:~# mv download mfs-1.6.26.tar.gz
(3)添加mfs用户和组
root@mfs-master:~# groupadd mfs
root@mfs-master:~# useradd -g mfs mfs
(4)解压mfs软件包
root@mfs-master:~# tar -zxvf mfs-1.6.26.tar.gz
(5)安装mfs-master软件包
root@mfs-master:~# cd /root/moosefs-packages-all-2.0.89/linux/ubuntu/14.04
root@mfs-master:~/moosefs-packages-all-2.0.89/linux/ubuntu/14.04# dpkg -i moosefs-master_2.0.89-1_amd64.deb
root@mfs-master:~/moosefs-packages-all-2.0.89/linux/ubuntu/14.04# dpkg -i moosefs-cgiserv_2.0.89-1_amd64.deb
root@mfs-master:~/moosefs-packages-all-2.0.89/linux/ubuntu/14.04# dpkg -i moosefs-cli_2.0.89-1_amd64.deb
root@mfs-master:~/moosefs-packages-all-2.0.89/linux/ubuntu/14.04# dpkg -i moosefs-cgi_2.0.89-1_amd64.deb
(6)修改配置文件
root@mfs-master:~# cd /etc/mfs
root@mfs-master:/etc/mfs# cp mfsmaster.cfg.dist mfsmaster.cfg
root@mfs-master:/etc/mfs# cp mfsexports.cfg.dist mfsexports.cfg
(7)将/etc/mfs文件夹授权给用户mfs
root@mfs-master:/etc/mfs# chown -R mfs:mfs /etc/mfs/
(8)启动mfs-master服务
root@mfs-master:/etc/mfs# /usr/sbin/mfsmaster start
open files limit has been set to: 4096
working directory: /var/lib/mfs
lockfile created and locked
initializing mfsmaster modules ...
exports file has been loaded
mfstopology configuration file (/etc/mfstopology.cfg) not found - using defaults
loading metadata ...
metadata file has been loaded
no charts data file - initializing empty charts
master <-> metaloggers module: listen on *:9419
master <-> chunkservers module: listen on *:9420
main master server module: listen on *:9421
mfsmaster daemon initialized properly
验证安装
root@mfs-master:/etc/mfs# netstat -lnpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:9420 0.0.0.0:* LISTEN 7252/mfsmaster
tcp 0 0 0.0.0.0:9421 0.0.0.0:* LISTEN 7252/mfsmaster
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 972/sshd
tcp 0 0 0.0.0.0:9419 0.0.0.0:* LISTEN 7252/mfsmaster
tcp6 0 0 :::22 :::* LISTEN 972/sshd
启动mfs-master的web管理服务
root@mfs-master:/etc/mfs# /usr/sbin/mfscgiserv start
lockfile created and locked
starting simple cgi server (host: any , port: 9425 , rootpath: /usr/share/mfscgi)
查看系统服务启动的监听端口
root@mfs-master:/etc/mfs# netstat -lnpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:9420 0.0.0.0:* LISTEN 7252/mfsmaster
tcp 0 0 0.0.0.0:9421 0.0.0.0:* LISTEN 7252/mfsmaster
tcp 0 0 0.0.0.0:9425 0.0.0.0:* LISTEN 7368/python
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 972/sshd
tcp 0 0 0.0.0.0:9419 0.0.0.0:* LISTEN 7252/mfsmaster
tcp6 0 0 :::22 :::* LISTEN 972/sshd
开机自动启动
root@mfs-master:/usr/share/mfscgi# echo "/usr/sbin/mfsmaster start" >> /etc/rc.local
root@mfs-master:/usr/share/mfscgi# echo "/usr/sbin/mfscgiserv start" >> /etc/rc.local
如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!
赞0
添加新评论0 条评论