首页 > 代码库 > ipvsadm+keepalived+inotify-tools自动安装脚本
ipvsadm+keepalived+inotify-tools自动安装脚本
#!/bin/bash # # #this is install keepalived+lvs-DR # # tar_dir=/usr/src configure_yum() { echo "[rhel-local]">/etc/yum.repos.d/rhel-local.repo echo "baseurl=file:///media/Server">>/etc/yum.repos.d/rhel-local.repo echo "enabled=1">>/etc/yum.repos.d/rhel-local.repo echo "gpgcheck=1">>/etc/yum.repos.d/rhel-local.repo echo "gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release">>/etc/yum.repos.d/rhel-local.repo mount /dev/cdrom /media } install_keepalived() { keepalived_dir=/usr/local/keepalived kernel=$(uname -r) yum install gcc gcc-c++ autoconf automake wget openssl-devel kernel-devel -y cd /root/software tar -zxf keepalived-*.tar.gz -C $tar_dir cd /usr/src/keepalived-* ./configure --prefix=$keepalived_dir --sysconf=/etc --with-kernel-dir=/usr/src/kernels/$kernel* make && make install if [ $? -eq 0 ];then echo "keepalived install is ok!!!" else echo "keepalived install is no!!!" exit fi } configure_keepalived() { cp /usr/local/keepalived/sbin/keepalived /usr/sbin cp /usr/local/keepalived/bin/genhash /usr/sbin/ /etc/init.d/keepalived start chkconfig --add keepalived chkconfig keepalived on } install_ipvsadm() { kernel=$(uname -r) ln -s /usr/src/kernels/$kernel* /usr/src/linux cd /root/software tar -zxf ipvsadm-*.tar.gz -C $tar_dir cd $tar_dir/ipvsadm-* make && make install if [ $? -eq 0 ];then echo "ipvsadm install is ok!!!" else echo "ipvsadm install is no!!!" exit fi } install_inotify-tools() { cd /root/software tar -zxf inotify-tools-* -C $tar_dir cd $tar_dir/inotify-tools-* ./configure --prefix=/usr/local/inotify_tools make && make install if [ $? -eq 0 ];then echo "inotify-tools install is ok!!!" else echo "inotify-tools install is no!!!" exit fi cp /usr/local/inotify_tools/bin/inotifywait /usr/sbin/ cp /usr/local/inotify_tools/bin/inotifywatch /usr/sbin/ } configure_yum install_keepalived configure_keepalived install_ipvsadm install_inotify-tools
本文出自 “小杩的幸福生活” 博客,谢绝转载!
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。