Redhat 7 的新功能 (centos7)

最後更新: 2017-05-31


* Installer: Kickstart (a single file is created, containing the answers to all the questions)
* Boot Loader: GRUB2 (GPT, NTFS)


* iSCSI: LIO kernel Target Subsystem
* /tmp directory can now be used as a temporary file storage system (tmpfs)
* LVM Cache
* Default file system: XFS
  (XFS file system can also be defragmented and expanded while mounted and active. )
* pNFS (NFS v4.1)(layouts: files, objects, and blocks. )


* kernel version 3.10
* Dynamic kernel Patching (kpatch), AMD64 and Intel 64 architectures only
* swap memory compression
* includes the Open vSwitch kernel module


* virtio-blk-data-plane (dedicated thread that is optimized for I/O performance. )
* virtio_net
* virtio_scsi
  (each virtual CPU can have a separate transmit or receive queue and separate interrupts)
* live migration: Page Delta Compression
* Live Migration Thread
* virtio-rng
* Bridge Zero Copy Transmit (disabled by default. )
* QCOW2 version 3 Image Format


 - Docker Format
 - lxc
    = net_cls — tags network packets with a class identifier (classid)
    = hugetlb — allows to use virtual memory pages of large sizes


 * bond2team (Network Teaming has been introduced as an alternative to bonding for link aggregation.)
 * firewalld (Dynamic Firewall Daemon)
 * SYNPROXY (filters out false SYN-ACK and ACK packets before the socket enters the "listen" state lock)
 * Network Hardware Offload (Mellanox ConnectX3-pro Ethernet NIC card)


 * Init: systemd
 - On-demand starting of daemons
 - Managing of control groups


- Apache 2.4 ( "Event" processing module )
 - MariaDB 5.5
 - Samba 4.1
    = SMB3 transport enables encrypted transport
    = server-side copy operations

 - Pacemaker (pcs)
 - HAProxy (TCP/HTTP reverse proxy)
    = add, modify, and delete HTTP headers
    = persistence through the use of HTTP cookies
    = block requests matching particular patterns
 - Keepalived (Layer-4 load balancing.)[Virtual Router Redundancy Protocol (VRRPv2)]







安裝 net-tools

# 找不到 ifconfig 及 netstat

yum install net-tools



# 不想用 firewalld

yum install iptables-services



systemctl stop avahi-daemon

systemctl disable avahi-daemon

service --status-all

nic name

CentOS7 has a default nic name as "en????"

修改 /etc/default/grub

GRUB_CMDLINE_LINUX="... net.ifnames=0 biosdevname=0 ..."

grub2-mkconfig -o /boot/grub2/grub.cfg


# Disable the NetworkManager service



systemctl stop NetworkManager

systemctl disable NetworkManager



timedatectl list-timezones

timedatectl set-timezone region/timezone


timedatectl set-timezone  Asia/Hong_Kong


fallocate -l 4G /swapfile

chmod 600 /swapfile

mkswap /swapfile

swapon /swapfile

sh -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab'


set hostname

新的 Centos 一共有以下 hostname 類型

 (1) static,
 (2) transient, and
 (3) pretty.
The "static" hostname is also known as kernel hostname, which is initialized from /etc/hostname automatically at boot time.

The "transient" hostname is a temporary hostname assigned at run time, for example, by a DHCP or mDNS server.

"pretty" hostname is allowed to have a free-form

# 查看

hostnamectl status

   Static hostname: localhost.localdomain
Transient hostname: x.y.z
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 80a476a9db4d449b8928ea7cf47ced6d
           Boot ID: a4742856ccb94c3ba247f2af1f0a239d
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-123.13.2.el7.x86_64
      Architecture: x86_64

# To change all three hostnames

hostnamectl set-hostname <host-name>





systemctl restart systemd-hostnamed

# Other CMD: 

hostname <-- transient

rc.local 沒有執行

In CentOS 7, the /etc/rc.local not enabled by default,

ls -l /etc/rc.local

lrwxrwxrwx 1 root root 13 Jul 21 22:57 /etc/rc.local -> rc.d/rc.local

ls -l /etc/rc.d/rc.local

-rw-r--r--. 1 root root 474 Jul 21 22:57 /etc/rc.d/rc.local


chmod +x /etc/rc.d/rc.local


It is executed as root.

lt run as separate processes, which means they have no way to modify their parent's environment.

It runs before the operating system is fully booted but has not yet started the login shell,

so the environment variables we configured in /etc/profiles or bashrc are not executed.


systemctl start rc-local

systemctl enable rc-local

systemctl status rc-local

cat /usr/lib/systemd/system/rc-local.service

Service start on boot

systemctl status mariadb

Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)

enabled => will start on boot


CentOS 7 NetInstall


Step0: 下載 ISO

# 362M

Step1: Setup Network and Hostname


NetInstall URL


website 的 root directory 有



Grub boot menu


 * Do not attempt to manually edit the boot menu ("/boot/grub2/grub.cfg")

grub2-mkconfig -o /boot/grub2/grub.cfg




grub2-editenv list

saved_entry=CentOS Linux (3.10.0-514.16.1.el7.x86_64) 7 (Core) with debugging

# 由 1 開始

grub2-set-default 1

# To list all the menu entries that will be displayed at system boot

grep "^menuentry" /boot/grub2/grub.cfg | cut -d "'" -f2