首先创建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 [email protected] ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected] ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected] ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
原文地址:https://www.cnblogs.com/hope123/p/11274172.html
时间: 2024-10-09 17:08:53