您的位置:首页 > 运维架构 > Linux

centos7下sheepdog环境的搭建

2017-11-13 10:41 573 查看
注意事项:

在开始安装sheepdog之前,应该先安装如下内容

yum install -y make automake autoconf gcc nss-devel wget git glib2

yum isntall -y libtool yasm userspace-rcu-devel 

再有就是安装2.0以上版本的corosync

1.epel的安装

epel全称Extra Packages for Enterprise Linux,由
Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目。装上了 EPEL之后,就相当于添加了一个第三方源。弥补官方的rpm repository提供的rpm包往往是很滞后的,的不足。

1、
如果以前安装过,则先卸载以前装的epel 以免影响
  rpm -e epel-release 
2、 下载阿里提供的epel 
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo(下载对应的软件包)
3、yum
clean all(清除YUM缓存)
4、yum makecache(把服务器的包信息下载到本地电脑缓存起来)
全部改成阿里云的源(自选)
1、rm -rf /etc/yum.repos.d/*  
2、wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repohttp://mirrors.aliyun.com/repo/Centos-7.repo

执行 yum repolist的结果如下,源全改成阿里云的了
[root@]# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com

方法2:

 wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm

 yum repolist 
2.安装corosync

yum install corosynclib-devel 

如果是centos6.x版本,需要先卸载crosync再安装,因为携带版本过旧。步骤如下:

1、卸载原corosync

yum remove corosync corosynclib corosynclib-devel 

2、源代码安装

网上方法:(出现问题)

**可能需要先安装几个包

**yum install git**

**yum install autoconf**

**yum
install automake**

**yum
-y install userspace-rcu-devel**

需要安装版本corosync>=2,用资源下载

yum install nss-devel -y  

git clone https://github.com/corosync/corosync.git  

cd corosync  

git checkout -b flatiron origin/flatiron  

./autogen.sh  

./configure --enable-nss  

make install 

3、修改corosync配置文档

cd /etc/corosync/

cp corosync.conf.example corosync.conf

vim corosync.conf

(红色为修改部分)

# Please read the corosync.conf.5 manual page

compatibility: whitetank

totem {
version: 2
secauth: off  //安全认证
threads: 0    //线程数 0 表示不基于线程模式工作而是进程
interface {

                # Rings must be consecutively numbered, starting at 0.
ringnumber: 0   //环数目   一般保持为0
bindnetaddr: 192.168.1.0
mcastaddr: 239.255.1.1   //多播地址
mcastport: 5405
ttl: 1
}

}

logging {
fileline: off
to_stderr: no
to_logfile: yes          //是否记录日志 
logfile: /var/log/cluster/corosync.log          //日志文件保存位置
to_syslog: yes    //是否记录系统日志  一般只记录一份  设置为NO 
debug: off
timestamp: on     //是否开启时间戳功能
logger_subsys {
subsys: AMF
debug: off
}

}

#######
amf {  

mode: disabled  



aisexec {  #表示启动corosync的ais功能,以哪个用户的身份运行

user: root  

group: root  

}  

service {  #定义corosync在启动时自动启动pacemaker

name: pacemaker  

ver: 0  #0表示pacemaker作为corosync的插件来运行



4、启动corosync

/bin/systemctl start corosync.service

3.安装qemu

网上给的方法:

git clone git://git.sv.gnu.org/qemu.git  

cd qemu  

./configure  

make

make install  

有用的方法:

yum -y install qemu-kvm

4.安装sheepdog

git clone https://github.com/sheepdog/sheepdog.git
cd sheepdog

./autogen.sh

./configure

make install
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息