CentOS安装

CentOS安装

​ 服务器使用的Linux操作系统都使用了CentOS来进行安装,CentOS是一个开源的Linux发行版,具有很好的稳定性和更多的可扩展行。为了能够正常使用Docker,我们将使用CentOS7及以上版本。

​ 下载地址:https://www.centos.org/download/

​ 安装完成后分别对IP地址设置、安全设置(防火墙)、语言配置、时间同步配置。

​ 1、IP地址设置:

​ 先进入网路配置文件目录:cd /etc/sysconfig/network-scripts

​ 查看目录下内容,找到网卡配置文件:ls
CentOS安装

​ 用vi命令编辑网卡配置

CentOS安装

​ service network restart //重启网络,立即生效

​ 查看IP地址信息: ip addr

​ 2、安全设置

​ 为了省略后面服务的防火墙配置,可以将Linux的安全选项禁用掉。

​ "SELINUX=enforcing"改为“SELINUX=disabled”
CentOS安装

​ 禁用防火墙命令:

​ systemctl stop firewalld.service//停止firewall

​ systemctl disable firewalld.service//禁止开机启动

​ 3、语言配置

​ 编辑语言配置:

​ vi /etc/locale.conf

CentOS安装

​ 保存退出,使配置立即生效:

​ source /etc/locale.conf

​ 4、时间同步配置

​ 安装一个时间同步服务:

​ yum -y install ntp

​ 启动服务,将其设为开机启动:

​ systemctl enable ntpd

​ systemctl start ntpd

启动:

​ systemctl enable ntpd

​ systemctl start ntpd