17.Centos6-->Centos7

1.centos7镜像介绍

下载地址 http://mirrors.aliyun.com/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1708.iso
镜像名字解释CentOS-7-x86_64-DVD-1708.iso
从 CentOS 7 之后,版本命名就跟发行的日期有关了。

CentOS-7 系统是7.x版本
x86_64 64 位操作系统,并且从7以后不再提供32位镜像。
1708 2017年08月发表的版本

2.Centos7安装

按上下箭头,选择第一个,第三个是救援模式

17.Centos6-->Centos7

按下tab

修改内核参数net.ifnames=0 biosdevname=0,使网卡名统一

17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7

3.模板机优化

1.停止NetworkManager

[root@oldboyedu-7 ~]# systemctl stop NetworkManager

[root@oldboyedu-7 ~]# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.

[root@oldboyedu-7 ~]# systemctl is-active NetworkManager
inactive

[root@oldboyedu-7 ~]# systemctl is-enabled NetworkManager
disabled

[root@oldboyedu-7 ~]#

2.删除UUID

[root@oldboyedu-7 ~]# sed -id '/UUID/d' /etc/sysconfig/network-scripts/ifcfg-eth1
3.关闭selinux,防火墙

[root@oldboyedu-7 ~]# setenforce 0

[root@oldboyedu-7 ~]# cat /etc/selinux/config

SELINUX=disabled

[root@oldboyedu-7 ~]# systemctl stop firewalld.service

[root@oldboyedu-7 ~]# systemctl disable firewalld.service

[root@oldboyedu-7 ~]# systemctl is-active firewalld.service
unknown

[root@oldboyedu-7 ~]# systemctl is-enabled firewalld.service
disabled

3.下载yum源

17.Centos6-->Centos7
17.Centos6-->Centos7

更改系统默认yum源

[root@oldboyedu-7 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
更改epel源

[root@oldboyedu-7 ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
缓存yum列表

[root@oldboyedu-7 ~]# yum makecache

17.Centos6-->Centos7
17.Centos6-->Centos7
17.Centos6-->Centos7

4.centos6-7的区别

区别一:
网卡名称不同,centos6中是eth0,eth1,centos7中默认是enp5s0,ens33

区别二:
网络配置相关命令
centos7推荐使用ip,ss命令
centos6使用ifconfig
centos6中的setup,centos7中是nmtui

区别三:
主机名等配置文件修改
修改主机名:
hostname m01-->临时生效
编辑/etc/hostname-->主机名配置文件变了
hostnamectl set-hostname m01 -->本质修改配置文件

修改字符集
localectl set-locale LANG=zh_CN.UTF-8
编辑/etc/locale.conf

区别四:
兼容/etc/rc.local

区别五:
查看当前启动级别
[root@m02 ~]# systemctl get-default 
multi-user.target
设置启动级别
systemctl set-default  multi-user.target

区别六:
systemd替代了init

区别七:
文件系统不同,centos7是xfs系统,centos6是ext4

区别八:
服务管理,centos7中使用systemctl,centos6中使用chkconfig

17.Centos6-->Centos7

猜你喜欢

转载自blog.51cto.com/10983441/2426054
今日推荐