1.使用命令查看centos版本
cat /etc/redhat-release 查看CentOS版本
2.使用hostnamectl命令修改主机名
[root@xlucas1 ~]# hostnamectl set-hostname xlucas2
3.使用命令更换源(解决有些包安装不上的问题)
备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
centos7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
添加EPEL
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
4.解决openstack实例不能上网和不能使用Xshell问题
5.ping不通百度但能ping通百度的IP地址
修改配置文件在配置文件中添加网关地址
vim /etc/resolv.conf
添加 servername 8.8.8.8
6.xftp过期winscp 也是一个很好的替代
学习热迁移
一台机器出现故障能无感觉的迁移到另外一台机器