HeartBeat-DRBD rpm安装包生成

请注意内核版本对应的软件包是否存在 kernel-devel-$(uname -r) kernel-headers-$(uname -r)

HeartBeat

RPM 包生成

# 配置yum源
rm -f /etc/yum.repos.d/*.repo
curl -so /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
curl -so /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i '/aliyuncs.com/d' /etc/yum.repos.d/Centos-7.repo /etc/yum.repos.d/epel-7.repo

# 配置cluster-glue-libs-devel 安装源
cat <<EOF   >/etc/yum.repos.d/gf-epel-7.repo
[epel-testing]
name=Extra Packages for Enterprise Linux 7 - $basearch - Testing
baseurl=http://mirror.ghettoforge.org/distributions/gf/el/7/testing/x86_64
enabled=1
gpgcheck=0
EOF

# 安装依赖环境
yum install -y glib2-devel libtool-ltdl-devel bzip2-devel ncurses-devel openssl-devel libtool \
  zlib-devel mailx cluster-glue-libs-devel libxslt docbook-dtds docbook-style-xsl libuuid-devel \
  bzip2 rpm-build wget kernel-headers-$(uname -r)

# 下载软件
wget http://hg.linux-ha.org/heartbeat-STABLE_3_0/archive/958e11be8686.tar.bz2

# heartbeat
mkdir -p /root/rpmbuild/SOURCES
mkdir heartbeat
tar xvf 958e11be8686.tar.bz2 -C heartbeat --strip-components 1
tar cjvf /root/rpmbuild/SOURCES/heartbeat.tar.bz2 heartbeat
rpmbuild -ba heartbeat/heartbeat-fedora.spec

客户端安装

# 配置yum源
rm -f /etc/yum.repos.d/*.repo
curl -so /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
curl -so /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i '/aliyuncs.com/d' /etc/yum.repos.d/Centos-7.repo /etc/yum.repos.d/epel-7.repo

# 配置cluster-glue-libs-devel 安装源
cat <<EOF   >/etc/yum.repos.d/gf-epel-7.repo
[epel-testing]
name=Extra Packages for Enterprise Linux 7 - $basearch - Testing
baseurl=http://mirror.ghettoforge.org/distributions/gf/el/7/testing/x86_64
enabled=1
gpgcheck=0
EOF

# 安装
yum install heartbeat-3.0.6-1.el7.centos.x86_64.rpm heartbeat-libs-3.0.6-1.el7.centos.x86_64.rpm

DRBD

生成RPM包

# 配置yum源
rm -f /etc/yum.repos.d/*.repo
curl -so /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
curl -so /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i '/aliyuncs.com/d' /etc/yum.repos.d/Centos-7.repo /etc/yum.repos.d/epel-7.repo


# 安装 DRBD
yum install -y gcc gcc-c++ make automake autoconf libxslt libxslt-devel flex rpm-build wget  kernel-devel-$(uname -r) kernel-headers-$(uname -r)


mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
wget -c www.linbit.com/downloads/drbd/8.4/drbd-8.4.11-1.tar.gz \
www.linbit.com/downloads/drbd/utils/drbd-utils-9.6.0.tar.gz

tar zxvf drbd-8.4.11-1.tar.gz
cd drbd-8.4.11-1
make km-rpm
cd
tar zxvf drbd-utils-9.6.0.tar.gz
cd drbd-utils-9.6.0
cp drbd.spec.in{,.bak}
sed -i '33a %undefine with_sbinsymlinks' drbd.spec.in
./configure
make rpm
cd /root/rpmbuild/RPMS/x86_64

客户端安装

rpm -Uvh drbd-km-3.10.0_862.el7.x86_64-8.4.11-1.x86_64.rpm \
  drbd-utils-9.6.0-1.el7.centos.x86_64.rpm \
  drbd-bash-completion-9.6.0-1.el7.centos.x86_64.rpm \
  drbd-heartbeat-9.6.0-1.el7.centos.x86_64.rpm

转载于:https://my.oschina.net/yx571304/blog/3030546

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值