HeartBeat-DRBD rpm安装包生成

a 夏天 提交于 2019-12-06 05:44:41

请注意内核版本对应的软件包是否存在 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!