hadoop高可用集群搭建
Posted hope123
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hadoop高可用集群搭建相关的知识,希望对你有一定的参考价值。
首先创建4台虚拟机,规划如下
IP地址 | 主机名 | 安装软件 | 运行服务 |
192.168.16.134 | hadoop1 | jdk,hadoop | namenode,Journalnode,ZKFC,Resourcemanager |
192.168.16.135 | hadoop2 | jdk,hadoop,zookeeper | namenode,datanode,Journalnode,ZKFC,Resourcemanager,zookeeper |
192.168.16.136 | hadoop3 | jdk,hadoop,zookeeper | namenode,datanode,Journalnode,zookeeper |
192.168.16.137 | hadoop4 | jdk,hadoop,zookeeper | namenode,datanode,zookeeper |
接下来关闭防火墙和selinux,可以在每台服务器上运行如下命令(操作节点:所有)
sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g‘ /etc/selinux/config systemctl stop firewalld systemctl disable firewalld setenforce 0
更改每台主机主机名,如下命令(操作节点:所有)
hostnamectl set-hostname hadoop1
每台主机上添加hosts解析(操作节点:所有)
echo " 192.168.16.134 hadoop1 192.168.16.135 hadoop2 192.168.16.136 hadoop3 192.168.16.137 hadoop4">>/etc/hosts
所有主机上创建hadoop用户(操作节点:所有)
useradd hadoop passwd hadoop
切换到普通用户,配置免密,(操作节点:hadoop1)
su - hadoop #ssh-keygen,一路回车即可 ssh-keygen #本机也要拷贝一份 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@hadoop1 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@hadoop2 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@hadoop3 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@hadoop4
以上是关于hadoop高可用集群搭建的主要内容,如果未能解决你的问题,请参考以下文章