centos7 environment to build

centos7 environment to build

Change the network card name to eth0
  • vi /etc/sysconfig/grub
  • 修改行:GRUB_CMDLINE_LINUX=”crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet net.ifnames=0 biosdevname=0”
  • net.ifnames=0 biosdevname=0 is new
  • The grub2-mkconfig -o /boot/grub2/grub.cfg command updates the grub configuration. After restarting, the network card name is successfully modified.
eth0 static ip configuration
  • vi /etc/sysconfig/network-scripts/ifcfg-eth0
  • The detailed configuration is as follows
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
Make a local yum source
  • Create a new /mnt/iso /mnt/dvd /mnt/dvdiso directory
  • CentOS-7-x86_64-Everything-1611.iso file copy paper /mnt/iso directory
  • Mount: mount -o loop /mnt/iso/CentOS-7-x86_64-Everything-1611.iso /mnt/dvdiso/
  • Copy: cp -a /mnt/dvdiso/* /mnt/dvd/
  • Sort: cp /mnt/dvd/TRANS.TBL /mnt/dvd/TRANS.TBL_bk and sort /mnt/dvd/TRANS.TBL_bk > /mnt/dvd/TRANS.TBL
  • Delete: rm -rf dvd/TRANS.TBL_bk
  • Unmount: umount /mnt/dvdiso
  • Remove: rm -rf dvd/iso and rm -rf dvd/dvdiso
  • /mnt/dvd can be used as a local yum source
  • Prep yum placement: cd /etc/yum.repos.d sum rename .repo .repo.bak * .repo
  • New yum configuration: vi /etc/yum.repos.d/Centos-Media.repo
  • Update yum sources: yum clean all and yum upgrade
[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///mnt/dvd
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Local yum source verification
  • yum install net-tools
  • yum install gcc
  • yum install gcc-c++
  • yum install glibc-static installs the static library of c
  • yum install xulrunner.i686 installs the 32-bit program runtime
  • yum install keepalived
  • yum install boost boost-devel boost-doc 安装boost
  • yum install kernel
  • yum install kernel-devel kernel-doc Install the kernel source code
  • keepalived configuration file: vi /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
    router_id node_centos73
}
vrrp_script check_script {
    script "/root/this_is_check.sh"
    interval 60
    weight -10
}
vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 73
    priority 150
    nopreempt
    advert_int 3
    track_interface {
        eth0
    }
#    track_script {
#        check_script
#    }
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        192.168.1.101/24 brd 192.168.1.255 dev eth0 ! gateway 192.168.1.1
    }
#    notify_master "/root/you_are_master.sh"
#    notify_backup "/root/you_are_backup.sh"
#    notify_fault  "/root/you_are_fault.sh"
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325977981&siteId=291194637