浅谈RHEL7和RHEL6的主要变化

 

浅谈RHEL7和RHEL6的主要变化
 RHEL7RHEL6
文件系统XFSEXT4
内核版本3.10.x-x系列2.6.x-x系列
内核名称MaipoSantiago
发布时间2014-06-09(3.10.0-123)2010-11-09(2.6.32-71)
进程名称systemdinit
运行级别runlevel0.target->poweroff.target
runlevel1.target->rescue.target
runlevel2.target->multi-user.target
runlevel3.target->multi-user.target
runlevel4.target->multi-user.target
runlevel5.target->graphical.target
runlevel6.target->reboot.target
/etc/systemd/system/default.target
runlevel0
runlevel1
runlevel2
runlevel3
runlevel4
runlevel5
runlevel6
/etc/inittab
主机名称/etc/hostname/etc/sysconfig/network
最大文件500TB16TB
检查工具xfs.repaire2fsck
启动工具GRUB2GRUB0.97
服务启动SystemdUpstart
服务管理systemctl enable xxx.service
systemctl start xxx.service
systemctl stop xxx.service
systemctl restart xxx.service
兼容chkconfig,service命令
service enable xxx.service
service stop xxx.service
service start xxx.service
chkconfig --level 3 5 nfs on
防火墙Firewalld兼容IptablesIptables
网络绑定Team DriverBonding
网络时间Chrony,ntpdntpd
NFS版本NFS4.1 支持NFSv3,NFSv4.0,NFSv4.1客户端NFS4
集群管理工具PacemakerRgmanager
负载均衡工具Keepalived,HAProxyRgmanager
桌面环境GNOME3,KDE4.10GNOME2
数据库MariaDBMySQL
RHEL7和RHEL6的管理命令和配置文件的变化
订阅信息RHEL7RHEL6
订阅信息工具subscription-manager identity/etc/sysconfig/rhn/systemid 
subscription-manager identity
配置订阅信息subscription-manager rhn_registerrhn_register rhnreg_ks subscription-manager identity
基本配置RHEL7RHEL6
GUI配置工具gnome-control-centersystem-config-*
网络配置工具nmcli nmtui nm-connection-editorsystem-config-network
语言配置工具localectlsystem-config-language
时间配置工具timedatectl datesystem-config-date date
时间同步ntpdate /etc/chrony.confntpdate /etc/ntp.conf
键盘配置localectlsystem-config-keyboard
服务管理RHEL7RHEL6
服务列表systemctl -at service
ls /{usr/lib,etc}/systemd/system/*.service
chkconfig 
ls /etc/init.d/
服务启动systemctl start name.serviceservice name start
服务停止systemctl stop name.serviceservice name stop
服务查看systemctl status name.serviceservice name status
服务重启systemctl restart name.serviceservice name restart
服务开机自启systemctl enable name.servicechkconfig name on
服务开机不自启systemctl disable name.servicechkconfig name off
添加服务systemctl daemon-reloadachkconfig --add
服务列表查看systemctl -t service --state=activeservice --status-all
查看运行级别systemctl get-defaultrunlevel
修改运行级别systemctl isolate name.target
init runlevel
init runlevel
日志文件/etc/rsyslog.conf
/etc/rsyslog.d/*.conf
/var/log/journal/
/etc/systemd/journald.conf
/etc/rsyslog.conf
查看日志文件/var/log//var/log/journalctl
内核硬件RHEL7RHEL6
启动提示符append rd.break or init=/bin/bash to kernel cmdlineappend 1 or s or init=/bin/bash to kernel cmdline
关闭系统systemctl shutdownshutdown
关闭电源systemctl poweroffpoweroff
挂起系统systemctl halthalt
重启系统systemctl rebootreboot
修改运行级别systemctl set-default/etc/inittab
配置GRUB/etc/default/grub
grub2-mkconfig
grub-set-default
/boot/grub/grub.conf
软件管理RHEL7RHEL6
安装软件包yum install 
yum group install
yum install 
yum groupinstall
查看软件包yum info
yum group info
yum info
yum groupinfo
文件系统RHEL7RHEL6
建立文件系统fdisk parted gdiskfdisk parted
LVM管理vgextend lvextend xfs_growfsvgextend lvextend resize2fs
网络接口配置RHEL7RHEL6
配置名称/etc/hosts
/etc/resolv.conf
nmcli conmod
/etc/hosts
/etc/resolv.conf
主机名称配置/etc/hostname
hostnamectl
nmcli
/etc/sysconfig/network
Ip地址配置ip addr 
nmcli dev 
show 
teamdctl 
brctl 
bridge
ip add
ifconfig
brctl
配置防火墙firewall-cmd
firewall-config
iptables&ip6tables
/etc/sysconfig/ip*tables
system-config-firewall
查看端口命令ss
lsof
netstat
ss
lsof

 

关闭firewall:

firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
init 6  #重启虚拟机,然后再输入第一条命令查看防火墙状态

修改DNS:

编辑网卡配置文件,添加:DNS1,DNS2

列出所有可用单元

# systemctl list-unit-files

列出所有运行中单元

# systemctl list-units

列出所有失败的单元

[root@master ~]# systemctl --failed

检查某个单元是否启用

[root@master ~]# systemctl is-enabled mysqld.service

查看某个服务(单元)的状态

systemctl status mysqld.service

启动、重启、停止、重载服务

# systemctl start httpd.service
# systemctl restart httpd.service
# systemctl stop httpd.service
# systemctl reload httpd.service
# systemctl status httpd.service

激活/禁止自动启动

# systemctl enable httpd.service
# systemctl disable httpd.service

杀死服务

# systemctl kill httpd

使用Systemctl控制并管理挂载点:

systemctl list-unit-files --type=mount

# systemctl start tmp.mount
# systemctl stop tmp.mount
# systemctl restart tmp.mount
# systemctl reload tmp.mount
# systemctl status tmp.mount

# systemctl is-active tmp.mount
# systemctl enable tmp.mount
# systemctl disable tmp.mount

# systemctl mask tmp.mount

使用Systemctl控制并管理套接口

# systemctl list-unit-files --type=socket

# systemctl start cups.socket
# systemctl restart cups.socket
# systemctl stop cups.socket
# systemctl reload cups.socket
# systemctl status cups.socket

# systemctl is-active cups.socket
# systemctl enable cups.socket
# systemctl disable cups.socket

# systemctl mask cups.socket

使用Systemctl管理服务的CPU利用率

# systemctl show -p CPUShares httpd.service

# systemctl set-property httpd.service CPUShares=2000
# systemctl show -p CPUShares httpd.service

# systemctl show httpd

其他

# systemd-analyze critical-chain httpd.service

# systemctl list-dependencies httpd.service

# systemd-cgls
# systemd-cgtop

# systemctl emergency

# systemctl reboot
# systemctl halt
# systemctl suspend
# systemctl hibernate
# systemctl hybrid-sleep

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值