hadoop前提环境
环境准备
========================配置网络=====================
1. 查看网络接口状态 ifconfig
2. 编辑eth0网卡(善用补全键 Table)
vi /etc/sysconfig/network-scripts/ifcfg-eth0
注意查看自己虚拟机的网络编辑器中的VMnet8给予的子网IP
对照子网IP进行设置
3.shift+G 到最后一行 O 另取一行开始编辑
写入 :
IPADDR=192.168.80.141
GATEWAY=192.168.80.2
NETMASK=255.255.255.0
DNS1=192.168.80.2
修改:
BOOTPROTO=static
ONBOOT=yes
3.重启网卡
service network restart
4. 检测网络时候接通
ping 8.8.8.8
5.修改 hosts文件(此文件是机器识别的身份证号码)
vi /etc/hosts
在文件内容后添加
IP + 主机名(根据自己的实际情况改)
192.168.178.221 test1
192.168.178.222 test2
192.168.178.223 test3
===========================ssh免密配置================================
1.在每一台进行安装ssh客户端(需要良好的网络环境否则会显示镜像错误)
yum install openssh-clients
·················································································错误解决方法················································································
检查是否能上网:ping www.baidu.com
如果显示没有连接的话,就说明没网,也就无法使用yum 命令安装。
ping通了的话,还是用不了yum命令,大部分原因是yum镜像有问题,下载一个更新。
在安装完CentOS后一般需要修改yum源,这样在安装更新rpm包时速度比较快。国内比较快的有163源、sohu源。以下是以163源为例。
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.backup
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
mv CentOS6-Base-163.repo CentOS-Base.repo
yum clean all
最后在使用yum 就可以了。
·······················································································································································································
2. 生成公钥私钥对(最好在每一台,嫌麻烦可以只在主机配置)
ssh-keygen
3.复制密匙(最好每一台相互设置,嫌麻烦可只在主机设置)
ssh-copy-id 机器名称
==============================时间同步====================================
采用的是同步上海时区的时间
下载时间同步模块
yum -y install ntpdate
连接远程服务器
ntpdate -u time1.aliyun.com
修改文件
ntpdate -u ntp.api.bz
date 查看系统时间
hwclock --show 查看硬件时间
hwclock -w 永久保存
date 查看 成功
==================================防火墙======================================
防火墙关闭: service iptables stop & chkconfig iptables off