CentOS 6和 CentOS 7的区别【转】 整体说明 详细操作 CentOS 7.x CentOS 7.x

虽然,redhat 8在今年已经推出了,但是centos 8还没有推出。而且公司好多都在用centos 6和7

来了解一下6和7的区别吧

1.系统

项目CentOS 6CentOS7

1. 安装过程6 一步一步7 随意

2. 默认的文件系统ext4xfs3. 启动流程串行并行

4. 运行级别runleveltarget

5. 内核2.6.323.10.0

6. 开机自启动服务chkconfigsystemctl enable/disable rsyncd

7. 开启或关闭服务/etc/init.d/network stop/startsystemctl start/stop rsyncd

8. 网卡命名eth0 eth1ens33

9. 普通用户uid>=500>=1000

10.修改主机名hostname和/etc/sysconfig/networkhostnamectl和/etc/hostname

11.修改字符集/etc/sysconfig/i18nlocalectl 和/etc/locale.conf

12.软件包名字tree-1.6.0-10.el6.x86_64 el6 C6tree-1.6.0-10.el7.x86_64 el7 C7

13.管理网卡主要服务:networkNetworkManager network

14.防火墙:iptablesfirewalld

15.查看内存free -h可用内存需要看bufer/cache这一行的可用内存直接看 ava

16./etc/fstab/根分区和/boot分区默认都是检查/根分区和/boot分区默认都是不检查

2.服务软件

项目CentOS6 CentOS7

1.rsync直接使用rsync用户即可需要使用fake super = yes

2.数据库yum源中默认是MySQLyum源中默认是MariaDB

3.时间同步ntpdate 或ntpd服务chrony

详细操作

1 默认的文件系统

CentOS 7.5

[root@shell ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda3 xfs 48G 7.1G 41G 15% /
devtmpfs devtmpfs 477M 0 477M 0% /dev
tmpfs tmpfs 488M 0 488M 0% /dev/shm
tmpfs tmpfs 488M 7.7M 480M 2% /run
tmpfs tmpfs 488M 0 488M 0% /sys/fs/cgroup
/dev/sda1 xfs 1014M 124M 891M 13% /boot
tmpfs tmpfs 98M 0 98M 0% /run/user/0

CentOS 6.10

[root@oldboyedu ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/vda1 ext4 40G 1.3G 36G 4% /
tmpfs tmpfs 939M 0 939M 0% /dev/shm
[root@oldboyedu ~]# free -m
 total used free shared buffers cached
Mem: 3832 2973 859 0 265 1771
-/+ buffers/cache: 936 2896
Swap: 2047 0 2047

2. 启动流程

 

CentOS 6和 CentOS 7的区别【转】
整体说明
详细操作
CentOS 7.x
CentOS 7.x

 

3. 运行级别

CentOS 6.x CentOS 7.x

runlevel运行级别

targetrunlevel0.

targetpoweroff.

targetrunlevel1.

targetrescue.

targetrunlevel2.

targetmulti-user.

targetrunlevel3.

targetmulti-user.

targetrunlevel4.

targetmulti-user.

targetrunlevel5.

targetgraphical.

targetrunlevel6

.targetreboot.target

详细:CentOS 6.x

  • 0 - halt (Do NOT set initdefault to this)
  • 1 - Single user mode
  • 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
  • 3 - Full multiuser mode 命令行模式
  • 4 - unused
  • 5 - X11 桌面模式
  • 6 - reboot (Do NOT set initdefault to this)

详细:CentOS 7.x

  • poweroff.target
  • rescue.target
  • multi-user.target
  • multi-user.target
  • multi-user.target
  • graphical.target
  • reboot.target

4.查看与修改

CentOS 6.x

修改/etc/inittab 文件 重启生效

CentOS 7.x

systemctl get-default #查看运行级别

systemctl set-default graphical.target #设置运行级别

5.内核版本

CentOS 6.x

2.6.32

[root@oldboyedu ~]# uname -r 
2.6.32-754.11.1.el6.x86_64
[root@oldboyedu ~]# rpm -qa tree 
tree-1.5.3-3.el6.x86_64

CentOS 7.x

3.10.0

[root@shell ~]# uname -r 
3.10.0-862.el7.x86_64
[root@shell ~]# rpm -qa tree 
tree-1.6.0-10.el7.x86_64

6. 开机自启动服务

如何让1个软件/服务 可以开机自启动

https://www.jianshu.com/p/fc26d73fe050

CentOS 6.x

chkconfig iptables on/off #让防火墙开机自启动/关闭自启动

CentOS 7.x

systemctl enable/disable rsyncd #让rsyncd开机自启动/关闭自启动

7. 开启或关闭服务

CentOS 6.x

/etc/init.d/sshd restart/stop/start/reload # 重启/关闭/开启/平滑重启sshd服务

CentOS 7.x

systemctl restart/stop/start/reload sshd #重启/关闭/开启/平滑重启sshd服务

8. 网卡命名

9. 普通用户uid

用户CentOS 6.xCentOS 7.x普通用户uid>=500>=1000

10.修改主机名

CentOS 6.x

[root@oldboyedu ~]# hostname oldboyedu-ecs
[root@oldboyedu ~]# hostname 
oldboyedu-ecs
[root@oldboyedu ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=oldboyedu-ecs

CentOS 7.x

hostnamectl set-hostname oldboyedu-CentOS7
[root@oldboyedu-centos7 ~]# cat /etc/hostname 
oldboyedu-centos7

11.修改字符集

CentOS 6.x

[root@oldboyedu ~]# export LANG=zh_CN.UTF-8
[root@oldboyedu ~]# 
[root@oldboyedu ~]# echo 'LANG=zh_CN.UTF-8' >/etc/sysconfig/i18n
[root@oldboyedu ~]# source /etc/sysconfig/i18n
[root@oldboyedu ~]# cat /etc/sysconfig/i18n
LANG=zh_CN.UTF-8

CentOS 7.x

[root@oldboyedu-centos7 ~]# localectl set-locale LANG=zh_CN.UTF-8
[root@oldboyedu-centos7 ~]# cat /etc/locale.conf 
LANG=zh_CN.UTF-8

12.软件包名字

软件包版本tree-1.6.0-10.el6.x86_64el6 C6tree-1.6.0-10.el7.x86_64el7 C7

13.管理网卡主要服务

CentOS 6.x network服务

CentOS 7.x NetworkManager network

14.防火墙

iptables

firewalld

15.查看内存free -h

可用内存需要看bufer/cache这一行的

可用内存直接看 ava

16./etc/fstab

/根分区和/boot分区默认都是检查 CentOS 6.x

/根分区和/boot分区默认都是不检查 CentOS 7.x

转自

作为Linux运维,你知道CentOS 6和 CentOS 7的区别吗? https://www.toutiao.com/i6727071857842848267/