前段时间学习hadoop全分布部署,由于一味求新,我居然安装了centos7,之后才发现变化太大了,耗费了不少时间,如下是用到的几个跟之前版本有变化的地方。
1. centos7设置ip地址
cd /etc/sysconfig/network-scripts/ #进入网络配置
vi ifcfg-eno16777736 #编辑配置文件
BOOTPROTO=static #启用静态IP地址
ONBOOT=yes #开启自动启用网络连接
IPADDR=192.168.2.10 #设置ip地址
NETMASK=255.255.255.0 #设置子网掩码
GATEWAY=192.168.2.1 #设置默认网关
2. centos7关闭防火墙
firewall-cmd --state #查看防火墙状态
systemctl stopfirewalld.service #临时关闭防火墙
systemctl disablefirewalld.service #禁止开机启动
3. centos7设置系统时间
timedatectl #查看系统时间信息
timedatectl set-local-rtc 1 # 将硬件时钟调整为本地时钟, 0 ,设置为 UTC 时间
timedatectl list-timezones # 列出所有时区
timedatectl set-timezone Asia/Shanghai #设置时区为上海