Centos7默认采用systemd风格,主要设计目标是克服sysvinit固有的缺点,提高系统启动速度。systemd的目标是尽可能启动更少进程,尽可能将更多进程并行启动(centos6采用的sysvinit风格是串行启动各个进程及服务),系统主要区别如下:
系统功能 | Centos6 | Centos7 |
init系统 | sysvinit | systemd |
桌面系统 | gnome 2.x | gnome 3.x/gnome shell |
文件系统 | EXT4 | XFS |
内核版本 | 2.6.x | 3.10.x |
启动加载器 | grub legacy(+efibootmgr) | grub2 |
防火墙 | iptables | firewalld |
数据库 | mysql | mariaDB |
文件目录 | /bin,/sbin,/lib,/lib64在/根下 | /bin,/sbin,/lib,/lib64在/usr下 |
主机名 | /etc/sysconfig/network | /etc/hostname |
时间同步 | ntp, ntpq -p | chrony, chronyc sources |
修改时间 | #vi /etc/sysconfig/clock ZONE="Asia/Tokyo" UTC=false #ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime | #timedatectl set-timezone Asia/Tokyo #timedatectl status |
区域及字符设置 | /etc/sysconfig/il8n | /etc/locale.conf localectl set-locale LANG=zh_ CN.utf8 localeetc status |
启动停止服务 | #service service_name start #service service_name stop #service sshd restart/status/reload | #systemctl start service_name #systemctl stop service_name #systemctl restart/status/reload sshd |
自动启动 | chkconfig service_name on/off | #systemctl enable service_name #systemctl disable service_name |
服务列表 | chkconfig --list | #systemctl list-unit-file #systemctl --type service |
Kill服务 | kill -9 <PID> | systemctl kill --signal=9 sshd |
网络及端口信息 | netstat | ss |
IP信息 | ifconfig | ip address show |
路由信息 | route -n | ip route show |
关闭停止系统 | shutdown -h now | systemctl poweroff |
单用户模式 | init S | systemctl rescue |
运行模式 | vim /etc/inittab id:3:initdefault: | systemctl set-default graphical.target systemctl set-default multi-user.target |
ext3 、ext4、xfs 文件系统区别:
- ext4是第四代扩展文件系统,是linux下的日志文件系统,是ext3的后继版本;
- ext3类型的文件系统支持最大16TB文件系统和最大2TB文件;
- ext4分别支持1EB(1EB=1024PB,1PB=1024TB)的文件系统,以及16TB的单个文件;
- ext3只支持32000个子目录,而ext4支持无限数量的子目录;
- ext4磁盘结构的incode个数支持40亿,且ext4的单个文件大小支持到16TB;
- xfs是一个64位文件系统,最大支持8EB减1字节的单个文件系统,实际部署时取决于宿主操作系统的最大块限制,常用于64位操作系统,发挥更好的性能;
- xfs是一种高性能日志文件系统,特别擅长处理大文件,同时提供平滑的数据传输;