部署hadoop集群的之前工作

部署hadoop之前准备的工作
1.将虚拟机集群环境的准备,所有安装好jdk并配置好变量.
2.修改主机名
3.修改主机名与ip映射关系
4.关闭防火墙
5.配置统一时间同步

1.jdk配置变量
vim /etc/profile

export JAVA_HOME=/usr/local/java/jdk1.8.0_144
export PATH= P A T H : PATH: PATH:JAVA_HOME/bin

source /etc/profile

2.修改主机名
vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hadoop01
其中HOSTNAME 就是你想改的主机名.

3.修改主机名与ip映射关系
vim /etc/hosts
000.000.000.000 hadoop01
000.000.000.000 hadoop02
000.000.000.000 hadoop03
其中000.000.000.000 是想要部署的三台机器的ip地址,可以通过 (ifconfig查看)

4.关闭防火墙
1.查看防火墙:server iptables status
2.永久性关闭防火墙:chkconfig iptables off
3.重启防火墙:service iptables restart

5.配置统一时间同步

  1. 查看时间同步状态: service ntpd status

                  ntpd is stopped          
    
  2. ntp配置文件
    vim /etc/ntp.conf
    添加:
    restrict 000.000.000.000 nomodify notrap nopeer noquery
    其中000.000.000.000 为hadoop01的ip地址
    修改:
    restrict 000.000.000.000 mask 255.255.255.0 nomodify notrap
    其中000.000.000.000 为网关 (000.000.000.1)
    注释以下内容:
    #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 127.127.1.0
    fudge 127.127.1.0 stratum 10

  3. 启动NTP服务: service ntpd start

  4. 设置开机启动: chkconfig ntpd on

  5. 时间命令
    查看当前的时间
    date
    Thu Jun 10 10:45:39 EDT 2021
    [root@hadoop03 ~]# service ntpd stop
    [root@hadoop03 ~]# ntpdate hadoop01
    10 Jun 11:23:57 ntpdate[2362]: step time server 192.168.254.101 offset 115685179.275931 sec

  6. 客户端同步配置(hadoop02)
    [root@hadoop02 ~]# vim /etc/ntp.conf
    修改
    #the administrative functions.
    restrict 000.000.000.000 nomodify notrap nopeer noquery
    其中000.000.000.000 为hadoop01的ip地址
    #Hosts on local network are less restricted.
    restrict 000.000.000.000 mask 255.255.255.0 nomodify notrap
    其中000.000.000.000 为网关 (000.000.000.1)
    注释掉:
    #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 000.000.000.000 其中000.000.000.000 为hadoop01的ip地址
    fudge 127.127.0.1 stratum 10

最后测试:
ntpstat

sudo ntpq -p

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值