你好,游客 登录 注册 搜索
背景:
阅读新闻

CentOS 6安装sheepdog 虚拟机分布式储存

[日期:2013-08-20] 来源:Linux社区  作者:kisops [字体:大 中 小]

前言
sheepdog是一个专门为qemu设计的虚拟机分布式文件系统,采用完全对称的结构,没有元数据服务的中心节点,因此免除了单点故障的隐患.本文基于最新的0.7.0版本测试,介绍sheepdog的安装配置和使用。

sheepdog的后端集群管理
sheepdog的后端集群管理用于管理节点间的成员关系和消息通讯.目前可使用四种模式,分别是local driver(用于单机测试),corosync (默认), zookeeper and Accord.

推荐阅读:

Hadoop在Linux下伪分布式的安装 wordcount实例的运行 http://www.linuxidc.com/Linux/2012-01/50706.htm

Hadoop实例WordCount程序一步一步运行 http://www.linuxidc.com/Linux/2011-09/44092.htm

分为两种模型:

– 全对称 (依赖 Corosync ,运行于 Sheepdog 的地址空间)

● 缺点:规模小 [<100]

● 优点:无需配置

– 单独的控制集群 (依赖 Accord* 或者 Zookeeper ,运行于独立地址空间)

● 缺点:需要配置控制集群

● 优点:规模大 [>1000]

本测试使用的就是默认的Corosync模式.

安装前准备:
先做一些系统设置

echo "* soft nofile 65533" >> /etc/security/limits.conf
echo "* hard nofile 65533" >> /etc/security/limits.conf
yum install -y make automake autoconf gcc nss-devel wget git glib2
安装epel源

rpm -ivh http://dl.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

安装sheepdog
1).安装corosync
CentOS6自带的版本过旧,我们需要安装新版

yum remove corosync corosynclib corosynclib-devel -y
git clone git://github.com/corosync/corosync.git
cd corosync
git checkout -b flatiron origin/flatiron
./autogen.sh
./configure --enable-nss
make install
 

2).安装sheepdog
cd /home2/install
git clone git://github.com/collie/sheepdog.git
cd sheepdog
./autogen.sh
./configure
make install
 

配置corosync和sheepdog
cd /etc/corosync
cp corosync.conf.example corosync.conf
编辑corosync.conf修改bindnetaddr成你的网段如192.168.1.0

# Please read the corosync.conf 5 manual page
compatibility: whitetank
totem {
  version: 2
  secauth: off
  threads: 0
  # Note, fail_recv_const is only needed if you're
  # having problems with corosync crashing under
  # heavy sheepdog traffic. This crash is due to
  # delayed/resent/misordered multicast packets.
  # fail_recv_const: 5000
  interface {
    ringnumber: 0
    bindnetaddr: 192.168.1.0
    mcastaddr: 226.94.1.1
    mcastport: 5405
  }
}
logging {
  fileline: off
  to_stderr: no
  to_logfile: yes
  to_syslog: yes
  # the pathname of the log file
  logfile: /var/log/cluster/corosync.log
  debug: off
  timestamp: on
  logger_subsys {
    subsys: AMF
    debug: off
  }
}
amf {
  mode: disabled
}启动服务

/etc/init.d/corosync start
#或通过命令启动(/var/lib/sheepdog是sheepdog使用的数据目录,你可以更改到其他)
#sheep /var/lib/sheepdog
 

sheepdog要求/var/lib/sheepdog目录所在的分区支持xattr

mount -o remount,user_xattr /以上操作需要在每一台sheepdog节点执行

格式化sheepdog集群并设置3个副本,只需要在其中一台节点执行

collie cluster format  --copies=3查看节点状态

collie node list至此sheepdog集群已经配置完毕

接下来请看第2页精彩内容:http://www.linuxidc.com/Linux/2013-08/89109p2.htm

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款