搭建大数据平台主机环境准备

2 篇文章 0 订阅
1 篇文章 0 订阅

主机名配置

查看主机名:hostname
临时修改:hostname maste1
永久修改

vim /etc/sysconfig/network
HOSTNAME=maste1

配置主机映射
修改/etc/host

vim /etc/hosts
134.32.73.3 maste1
134.32.73.4 maste2
134.32.73.5 slave1
134.32.73.6 slave2
134.32.73.7 slave3

防火墙配置

检查防火墙状态
service iptables stauts
关闭防火墙
service iptables stop
禁止开机启动
chkconfig iptables off

禁用IPV6

查看Ipv6是否开启
ifconfig
临时禁用
sh -c 'echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
永久禁用

# echo "                   " >> /etc/modprobe.d/dist.conf
# echo "alias net-pf-10 off" >> /etc/modprobe.d/dist.conf
# echo "alias ipv6 off"      >> /etc/modprobe.d/dist.conf   

关闭SELINUX

查看状态
/usr/sbin/sestatus -v
关闭
vim /etc/selinux/config
SELINUX=disabled
重启服务器
reboot

创建用户,并进行sudo权限配置

创建组及用户
groupadd hadoop
useradd -mg hadoop hadoop
修改sudoers权限
chmod u+w /etc/sudoers
vim /etc/sudoers
添加下面行:
hadoop ALL=(ALL) ALL

配置SSH免密登录

root用户验证设置
vim /etc/ssh/sshd_config
启用
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
修改完成保存并重启服务
service sshd restart


转到用户的家目录的.ssh目录,并删除所有文件,没有的话自己创建(mkdir .ssh)
cd ~.ssh/
rm -r ./*
生成每台机器的秘钥 3次回车
ssh-keygen -t rsa
发送前需要给用户创建密码,此步使用,发送公钥给每台机器,也要发给自己
cd .ssh/
ssh-copy-id hostname
-》登录验证
ssh master2
exit

NTP时间同步(CentOS)

检查ntp服务是否启动
service ntpd status


修改server配置文件/etc/ntp.conf
》1、配置允许哪些网段的机器可以对我进行同步
# Hosts on local network are less restricted.
restrict 134.32.73.0 mask 255.255.255.0 nomodify notrap
》2、由于是内网环境,就不需要这些服务配置,注释
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org
#server 1.centos.pool.ntp.org
#server 2.centos.pool.ntp.org
》3、如果server匹配不上,默认使用本地时间
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
启动ntp服务
service ntpd start
开机启动
chkconfig ntpd on
查看端口
netstat -tunlp | grep ntp
查看状态
ntpstat
查看可同步的服务
ntpq -p


修改agent配置文件/etc/ntp.conf
》1-同步server的地址
server 134.32.73.3
》2-允许server修改时间的限制条件
restrict 134.32.73.3 nomodify notrap noquery
-》启动ntp服务
service ntpd start
-》手动的同步
ntpdate -u 134.32.73.3
可以进行crontab配置,定时同步
crontab -e
*/10 * * * * /usr/sbin/ntpdate 134.32.73.3

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值