HDFS双机集群HA-部署

本文详细介绍了如何部署HDFS双机高可用(HA)集群,包括系统环境初始化、Zookeeper安装配置和Hadoop双机HA-namenode的部署。在Zookeeper配置中涉及JDK1.8的安装,以及在多个节点上的操作。Hadoop HA配置涉及到namenode、secondary namenode、journalnode等组件的设置,通过Zookeeper进行故障转移。文章最后还提供了启动和验证集群正常运行的步骤。
摘要由CSDN通过智能技术生成

HDFS双机HA-部署

1.1、系统环境初始化

防火墙关闭

server iptables stop

chkconfig iptables off

selinux关闭

 

用户创建:

vim yonghu.txt

hbase hdfs hive impala Impala kudu Kudu spark wxl zookeeper

 

#!/bin/sh

for i in `cat /root/hadoop-cdh/yonghu.txt`;

do

    echo $i

    useradd $i

done

 

免密码登录:其他用户更改root名称XXX

config-ssh-root.sh

#!/bin/sh

 

expect -c "

spawn ssh-keygen -t rsa

expect {

\".ssh/id_rsa): \" {send \"\r\";exp_continue }

\"Enter passphrase (empty for no passphrase): \" {send \"\r\";exp_continue }

\"Enter same passphrase again: \" {send \"\r\" }

}

expect eof

"

expect -c "

    spawn ssh-copy-id -i /root/.ssh/id_rsa.pub zk-master-la01

    expect {

        yes/no { send \"yes\r\"; exp_continue }

        *assword* { send \"pass@word1\r\" }

    }

    expect {

        *assword* { send \"pass@word1\r\" }

    }

expect eof

"

expect -c "

    spawn ssh-copy-id -i /root/.ssh/id_rsa.pub zk-master-la02

    expect {

        yes/no { send \"yes\r\"; exp_continue }

        *assword* { send \"pass@word1\r\" }

    }

    expect {

        *assword* { send \"pass@word1\r\" }

    }

expect eof

"

expect -c "

spawn ssh-copy-id -i /root/.ssh/id_rsa.pub zk-la03

expect {

yes/no { send \"yes\r\"; exp_continue }

*assword* { send \"pass@word1\r\" }

}

expect {

*assword* { send \"pass@word1\r\" }

}

expect eof

"

expect -c "

spawn ssh-copy-id -i /root/.ssh/id_rsa.pub nagios_server

expect {

yes/no { send \"yes\r\"; exp_continue }

*assword* { send \"pass@word1\r\" }

}

expect {

*assword* { send \"pass@word1\r\" }

}

expect eof

"

for slave in $(</tmp/hadoop-slave

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值