centos7下sheepdog環境的搭建

注意事項:

在開始安裝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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章