Article directory
CentOS The biggest difference between 7 and 6 is the difference in initialization technique.
- The initialization technology used by CentOS 7 is Systemd.
- In addition, service startup, boot startup files, network commands, etc., all indicate differences from 6.
Let us first understand Linux The evolution of system CentOS initialization technology!
XNUMX. System initialization technology
- Sysvinit Technology
- Upstart Technology
- Systemd technology
Sysvinit Technology
characteristic:
- 1) The first process of the system is init;
- 2) The init process is the parent process of all processes and cannot be killed (killed);
- 3) Most Linux distribution init systems are compatible with SystemV, called sysvinti
- 4) Representative system: CentOS 5 CentOS 6
Advantage:
- Sysvinit works well and the concept is simple and clear.
- It mostly depends on shell scripting.
Weakness:
- 1) Execute in a specific order -> Startup is too slow.
- 2) Very easy to hang, fstab and NFS mount issues.
Upstart Technology
CentOS 6 uses SysVinit instead of boot technology to boot.
Upstart's rc.sysinit script has many optimizations to reduce system initialization startup time.
However, to simplify things for administrators, CentOS 6 does not highlight or outright support many new features.
Representative system:CentOS 6, Ubuntu 14.
- systemd is used since CentOS 7, Ubuntu15.
Systemd technology
Technologies used in new systems (RedHat7, CentOS 7, Ubuntu15, etc.)
- The purpose of the design is to solve the original shortcomings of sysvinit and effectively improve the system startup speed;
- Compatible with Sysvinit, reducing the cost of transfers;
main advantage:
- parallel start
- Process processing using PID 1
XNUMX. Optimization of yum source
In CentOS 6, the default is to download rpm packages from official sources.
- CentOS 7 is optimized here due to the slow speed of using foreign resources.
- when we use installsoftwareis no longer downloaded from the official website by default.
- Instead, it will automatically find the Yum source closest to its geographic location to start downloading.
XNUMX. Command
If you choose minimal (the smallest one) when installing the system, it will be installed in a smaller package than previous versions.For example: VIM, use ifconfig, route routing, setup to set parameters, netstat, etc.Many commands are gone.
After system installation, the following packages can be added:
yum install lrzsz tree net-tools nmap vim bash-completion lsof dos2unix nc telnet ntp wget rng-tools psmisc screen -y #lrzsz 支持用于上传和下载linux的windowns平台。 可以在windowns远程连接工具上使用。 #net-tools CentOS 7.2.11 默认没有ifconfig命令。网络工具提供了一些网络命令。 #bash-completion 自动命令完成工具。 #rng-tools 生成随机数字池的工具。 有了这个工具,tomcat启动速度非常快。 #psmisc 这包含killall命令。 #screen 创建一个新窗口并将任务置于后台。
Fourth, the character set modification
Character Set Profile ▼
/etc/locale.conf
The command line is in place in just one step ▼
[root@CentOS 7 ~] # localectl set-locale LANG = zh_CN.UTF-8 [root@CentOS 7 ~] # localectl status System Locale: LANG=zh_CN.UTF-8 VC Keymap: us X11 Layout: us
XNUMX. Startup management
/etc/rc.local
This file still exists, but if we want to continue using this method, we need to add execute permissions to it ▼
chmod +x /etc/rc.d/rc.local
View Scheduled Task Status ▼
systemctl status crond.service
Close scheduled tasks ▼
systemctl stop crond.service
View the operation of the situation ▼
systemctl status crond.service
View currently running services ▼
systemctl list-unit-files|grep enable
Disable Mail Service ▼
systemctl disable postfix.service
Check if mail service is enabled ▼
systemctl list-unit-files|grep postfix
Turn off the firewall ▼
systemctl stop firewalld.service
Start the service▼
systemctl is-enable
# close service ▼
systemctl disable
Start with /etc/rc.d/rc.local/:
/etc/rc.d/rc.local in CentOS 7 needs to execute the following commands to provide executable permissions ▼
chmod +x /etc/rc.d/rc.local
Six, runlevel (run level)
/etc/inittab is an invalid system target replacement
- Always valid for next login
switch to 5 ▼
systemctl get-default graphical.target
switch to 3 ▼
systemctl get-default multi-user.target
Temporarily effective ▼
INIT3
Only five runlevels ▼
[root@centos7 ~]# ls -lh /usr/lib/systemd/system/runlevel*.target
lrwxrwxrwx. 1 root root 15 Mar 20 22:31 /usr/lib/systemd/system/runlevel0.target -> poweroff.target
lrwxrwxrwx. 1 root root 13 Mar 20 22:31 /usr/lib/systemd/system/runlevel1.target -> rescue.target
lrwxrwxrwx. 1 root root 17 Mar 20 22:31 /usr/lib/systemd/system/runlevel2.target -> multi-user.target
lrwxrwxrwx. 1 root root 17 Mar 20 22:31 /usr/lib/systemd/system/runlevel3.target -> multi-user.target
lrwxrwxrwx. 1 root root 17 Mar 20 22:31 /usr/lib/systemd/system/runlevel4.target -> multi-user.target
lrwxrwxrwx. 1 root root 16 Mar 20 22:31 /usr/lib/systemd/system/runlevel5.target -> graphical.target
lrwxrwxrwx. 1 root root 13 Mar 20 22:31 /usr/lib/systemd/system/runlevel6.target -> reboot.target
Seven, configure yum source code
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
Official EPEL source ▼
wget http://dl.fedorMaroject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -ivh epel-release-latest-7.noarch.rpm
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "What is the difference between CentOS6.5 and 7?How about choosing a CentOS7 version? , to help you.
Welcome to share the link of this article:https://www.chenweiliang.com/cwl-692.html
Welcome to the Telegram channel of Chen Weiliang's blog to get the latest updates!
📚 This guide contains huge value, 🌟This is a rare opportunity, don’t miss it! ⏰⌛💨
Share and like if you like!
Your sharing and likes are our continuous motivation!
2 people commented on "What is the difference between CentOS6.5 and 7? How about choosing the CentOS7 version?"
systemctl status cron.service is wrong and correct is systemctl status crond.service
Thanks for the correction, it has been corrected.