创建一台虚拟机
1.安装VM
2.修改VMware网络
1)点击VMware的“虚拟网络编辑器” - “VMnet8” - “更改设置” - 子网IP:10.4.7.0/子网掩码:255.255.255.0 2)在上边1点的界面:“点击NAT设置” - 网关IP:10.4.7.254 3)“控制面板” - “网络和共享中心” - “更改适配设置”- “VMnet8” - “ipv4属性” - IP:10.4.7.1/子网掩码:255.255.255.0 - “高级” - 自动跃点:10
2.修改centos网络
~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 TYPE="Ethernet" BOOTPROTO="none" NAME="eth0" DEVICE="eth0" ONBOOT="yes" IPADDR=10.4.7.12 NETMASK=255.255.255.0 GATEWAY="10.4.7.254" DNS1="10.4.7.254" ~]# systemctl restart network ~]# hostnamectl set-hostname hdss7-12.host.com 如需修改网卡名则 ~]# mv ifcfg-xxx ifcfg-eth0 ~]# vi /etc/default/grub GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos_hadoop2/root rd.lvm.lv=centos_hadoop2/swap rhgb quiet net.ifnames=0 biosdevname=0" ~]# grub2-mkconfig -o /boot/grub2/grub.cfg ~]# reboot
修改主机名
~]# hostnamectl set-hostname XXX
3. 验证SELinux是否关闭
~]# getenforce
Disabled
~]# vi /etc/sysconfig/selinux
修改 SELINUX=disabled
4.验证内核版本,是否>3.8
~]# uname -a
Linux hdss7-200.host.com 3.10.0-1062.el7.x86_64 #1 SMP Wed Aug 7 18:08:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
5.关闭firewalld
/]# systemctl status firewalld
~ ]# systemctl stop firewalld
~ ]# systemctl disable firewalld
~ ]# systemctl list-unit-files | grep enabled --查看开机启动的列表
~ ]# systemctl is-enabled firewalld.service --查看是否开机启动
6.chrony同步服务器时间
1、安装 yum -y install chrony
2、启动:systemctl start chronyd 开机启动:systemctl enable chronyd 查看服务状态:systemctl status chronyd
3、配置chrony:vi /etc/chrony.conf #server 0.centos.pool.ntp.org iburst #server 1.centos.pool.ntp.org iburst #server 2.centos.pool.ntp.org iburst #server 3.centos.pool.ntp.org iburst server ntp.aliyun.com iburst 4.重启systemctl restart chronyd
5.校验时间 chronyc tracking
6.运行以下命令查看时间同步服务器列表。chronyc -n sources -v