大数据Linux环境准备

it2023-08-23  80

准备环境

2台虚拟机。使用CentOS6.8。网络使用NAT模式。


修改主机名

vi /etc/sysconfig/network

修改HOSTNAME


配置网络

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

ONBOOT=yes

BOOTPROTO=static

IPADDR=192.168.1.101

PREFIX=24

GATEWAY=192.168.1.2

DNS1=192.168.1.2

NAME=eth0

 


vi /etc/udev/rule.d/70-persistent-net.rules

如果有两个eth,删除eth0,把eth1改为eth0


修改主机映射

vi /etc/hosts

末尾增加

192.168.1.101 hadoop01

192.168.1.102 hadoop02

192.168.1.103 hadoop03

Windows在C:\Windows\System32\drivers\etc\hosts下同样配置


关防火墙

service iptables stop

chkconfig iptables off


创建目录用于安装大数据软件

mkdir /opt/module /opt/software


克隆

克隆完后需修改主机名并重配网络。


设置SSH免密登陆

ssh-keygen -t rsa

ssh-copy-id hadoop01

ssh-copy-id hadoop02

ssh-copy-id hadoop03


拷贝命令

rsync -rvl 源文件 root@主机名:/目的文件


设置时间同步

关闭所有节点的ntpd

service ntpd stop

chkconfig ntpd off


时间服务器节点vi /etc/ntp.conf

#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap去掉#

以下内容加上#

#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


时间服务器节点vi /etc/sysconfig/ntpd

SYNC_HWCLOCK=yes


时间服务器节点开启ttp服务

service ntpd start

chkconfig ntpd on


其余从机每10分钟时间同步

crontab -e

*/10 * * * * /usr/sbin/ntpdate hadoop01

 

 

 

 

最新回复(0)