After reading many blogs on the Internet, it is not very reliable. At least the hostname changed after I restarted. Later, I found that it only takes two steps.
first step:
vim /etc/hosts
Step 2:
vim /etc/sysconfig/network
complete .reboot reboot
Note: In the hosts file, do not move the original file, just add the name that needs to be changed.