整体说明
1.系统
项目 | CentOS6 | CentOS7 |
---|---|---|
1. 安装过程 | 6 一步一步 | 7 随意 |
2. 默认的文件系统 | ext4 | xfs |
3. 启动流程 | 串行 | 并行 |
4. 运行级别 | runlevel | target |
5. 内核 | 2.6.32 | 3.10.0 |
6. 开机自启动服务 | chkconfig | systemctl enable/disable rsyncd |
7. 开启或关闭服务 | /etc/init.d/network stop/start | systemctl start/stop rsyncd |
8. 网卡命名 | eth0 eth1 | ens33 |
9. 普通用户uid | >=500 | >=1000 |
10.修改主机名 | hostname和/etc/sysconfig/network | hostnamectl和/etc/hostname |
11.修改字符集 | /etc/sysconfig/i18n | localectl 和/etc/locale.conf |
12.软件包名字 | tree-1.6.0-10.el6.x86_64 el6 C6 | tree-1.6.0-10.el7.x86_64 el7 C7 |
13.管理网卡主要服务: | network | NetworkManager network |
14.防火墙: | iptables | firewalld |
15.查看内存free -h | 可用内存需要看bufer/cache这一行的 | 可用内存直接看 ava |
16./etc/fstab | /根分区和/boot分区默认都是检查 | /根分区和/boot分区默认都是不检查 |
2.服务软件
项目 | CentOS6 | CentOS7 |
---|---|---|
1.rsync | 直接使用rsync用户即可 | 需要使用fake super = yes |
2.数据库 | yum源中默认是MySQL | yum源中默认是MariaDB |
3.时间同步 | ntpdate 或ntpd服务 | chrony |
详细操作
1 默认的文件系统
CentOS 7.5
[root@tdh16 ~]# df -Th |less
文件系统 类型 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root xfs 500G 7.3G 493G 2% /
devtmpfs devtmpfs 110G 0 110G 0% /dev
tmpfs tmpfs 110G 0 110G 0% /dev/shm
tmpfs tmpfs 110G 7.1M 110G 1% /run
tmpfs tmpfs 110G 0 110G 0% /sys/fs/cgroup
/dev/sda1 xfs 1014M 146M 869M 15% /boot
/dev/sda5 xfs 403G 194G 210G 49% /registry-data
/dev/sda7 xfs 200G 107G 94G 54% /var/log
/dev/sda8 xfs 300G 33G 268G 11% /var/lib/docker
/dev/sdb xfs 1.7T 1.6T 78G 96% /mnt/disk2
/dev/sdc xfs 1.7T 1.3T 446G 74% /mnt/disk3
/dev/sdd xfs 1.7T 1.2T 509G 70% /mnt/disk4
overlay overlay 300G 33G 268G 11% /var/lib/docker/overlay2
[root@tdh16 ~]# free -m
total used free shared buff/cache available
Mem: 225120 126478 81395 7 17246 95404
Swap: 0 0 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
2. 启动流程
略
3. 运行级别
CentOS 6.x | CentOS 7.x |
---|---|
runlevel运行级别 | target |
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 |
详细: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@tdh16 ~]# uname -r
3.10.0-957.el7.x86_64
[root@tdh16 ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
[root@tdh16 ~]# cat /proc/version
Linux version 3.10.0-957.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018
6. 开机自启动服务
如何让1个软件/服务 可以开机自启动
https://www.jianshu.com/p/fc26d73fe050
7. 开启或关闭服务
CentOS 6.x
chkconfig iptables on/off #让防火墙开机自启动/关闭自启动
CentOS 7.x
systemctl enable/disable rsyncd #让rsyncd开机自启动/关闭自启动
8. 网卡命名
9. 普通用户uid
用户 | CentOS 6.x | CentOS 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_64 | el6 C6 |
tree-1.6.0-10.el7.x86_64 | el7 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