老男孩教育oldboyedu.com.png
整體說明
1.系統(tǒng)
項(xiàng)目 | CentOS6 | CentOS7 |
---|---|---|
1. 安裝過程 | 6 一步一步 | 7隨意 |
2. 默認(rèn)的文件系統(tǒng) | ext4 | xfs |
3. 啟動(dòng)流程 | 串行 | 并行 |
4. 運(yùn)行級別 | runlevel | target |
5. 內(nèi)核 | 2.6.32 | 3.10.0 |
6. 開機(jī)自啟動(dòng)服務(wù) | chkconfig | systemctl enable/disable rsyncd |
7. 開啟或關(guān)閉服務(wù) | /etc/init.d/network stop/start | systemctl start/stop rsyncd |
8. 網(wǎng)卡命名 | eth0 eth1 | ens33 |
9. 普通用戶uid | >=500 | >=1000 |
10.修改主機(jī)名 | 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.管理網(wǎng)卡主要服務(wù): | network | NetworkManager network |
14.防火墻: | iptables | firewalld |
15.查看內(nèi)存free -h | 可用內(nèi)存需要看bufer/cache這一行的 | 可用內(nèi)存直接看 ava |
16./etc/fstab | /根分區(qū)和/boot分區(qū)默認(rèn)都是檢查 | /根分區(qū)和/boot分區(qū)默認(rèn)都是不檢查 |
2.服務(wù)軟件
項(xiàng)目 | CentOS6 | CentOS7 |
---|---|---|
1.rsync | 直接使用rsync用戶即可 | 需要使用fake super = yes |
2.數(shù)據(jù)庫 | yum源中默認(rèn)是MySQL | yum源中默認(rèn)是MariaDB |
3.時(shí)間同步 | ntpdate 或ntpd服務(wù) | chrony |
詳細(xì)操作
1 默認(rèn)的文件系統(tǒng)
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. 啟動(dòng)流程
3. 運(yùn)行級別
CentOS 6.x | CentOS 7.x |
---|---|
runlevel運(yùn)行級別 | 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 |
詳細(xì):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)
詳細(xì):CentOS 7.x
- poweroff.target
- rescue.target
- multi-user.target
- multi-user.target
- multi-user.target
- graphical.target
- reboot.target
查看與修改:
CentOS 6.x
修改/etc/inittab 文件 重啟生效
CentOS 7.x
systemctl get-default #查看運(yùn)行級別
systemctl set-default graphical.target #設(shè)置運(yùn)行級別
5.內(nèi)核版本
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. 開機(jī)自啟動(dòng)服務(wù)
如何讓1個(gè)軟件/服務(wù) 可以開機(jī)自啟動(dòng)
http://www.reibang.com/p/fc26d73fe050
CentOS 6.x
chkconfig iptables on/off #讓防火墻開機(jī)自啟動(dòng)/關(guān)閉自啟動(dòng)
CentOS 7.x
systemctl enable/disable rsyncd #讓rsyncd開機(jī)自啟動(dòng)/關(guān)閉自啟動(dòng)
7. 開啟或關(guān)閉服務(wù)
CentOS 6.x
/etc/init.d/sshd restart/stop/start/reload # 重啟/關(guān)閉/開啟/平滑重啟sshd服務(wù)
CentOS 7.x
systemctl restart/stop/start/reload sshd #重啟/關(guān)閉/開啟/平滑重啟sshd服務(wù)
8. 網(wǎng)卡命名
9. 普通用戶uid
用戶 | CentOS 6.x | CentOS 7.x |
---|---|---|
普通用戶uid | >=500 | >=1000 |
10.修改主機(jī)名
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.管理網(wǎng)卡主要服務(wù): .
CentOS 6.x network服務(wù)
CentOS 7.x NetworkManager network
14.防火墻:
iptables
firewalld
15.查看內(nèi)存free -h
可用內(nèi)存需要看bufer/cache這一行的
可用內(nèi)存直接看 ava
16./etc/fstab
/根分區(qū)和/boot分區(qū)默認(rèn)都是檢查 CentOS 6.x
/根分區(qū)和/boot分區(qū)默認(rèn)都是不檢查 CentOS 7.x
李導(dǎo)的博客目錄http://www.reibang.com/p/c5e6724f4c3d