Hadoop2.x的配置
NN和ZKFC配套
DN和DM配套
安装部署hadoop2.x 1、下载64位hadoop2.5 首先我们要下载到64位的Linux的hadoop-2.5的tar包,官网上的是32位的,我们需要的是64位的
详情参考
2、解压tar包
吧1.2删除就可以了
然后我们进行2.5的配置 配置文件在这个目录下
修改我们的配置文件
保存文件
然后我们修改hdfs-site.xml
在这个里面配置一个命名服务
根据我们前面的表格namenode分别是hadoop1和node1
最终改为
>>>dfs.ha.namenodes.cutter_point>>hadoop1:8020>>>dfs.namenode.http-address.cutter_point.nn1>>node1:50070>>>dfs.client.failover.proxy.provider.cutter_point>>dfs.ha.fencing.methods>>/root/.ssh/id_dsa>>>dfs.ha.automatic-failover.enabled></configuration>
然后我们配置core-site.xml文件
下一个是安装zookeeper
我们下载3.4.6稳定版的,然后解压
我们copy一份zoo_sample.cfg 名字叫zoo.cfg
改一下这个文件
在末尾添加
The entries of the form server.X list the servers that make up the ZooKeeper service. When the server starts up, it knows which server it is by looking for the file myid in the data directory. That file has the contains the server number, in ASCII.
后面的开始式我们的主机名
接着我们创建一个文件夹
在zookeeper文件夹里面
我们创建一个文件叫myid
然后我们把zookeeper这个文件夹传输到其他各个节点
修改其他节点的id号
吧zookeeper文件夹传输到其他的两个节点
其他两个节点也设置相应的软链接
长度的配置zookeeper的环境变量
进入到相应的目录,得到相应的路径
修改环境变量
传输到其他的节点上
启动zookeeper
出现QuorumPeerMain说明配置OK
配置slaves,我们的datanode节点
吧tar包传输到其他的节点上
在其他节点上进行如下操作
配置文件传输到其他的节点下面
试运行
在相应的JN上运行,参考最上面的表
在node1,node2,node3上的hadoop-2.5下的sbin下面执行 ./hadoop-daemon.sh start journalnode
If you are setting up a fresh HDFS cluster, you should first run the format command (hdfs namenode -format) on one of NameNodes.
在一个namenode上执行一个相应的格式化命令
./ hdfs namenode -format
格式化成功
启动namenode在刚刚格式化的那个namenode主机上
在没有格式化的主机上执行 unformatted NameNode by running the command “hdfs namenode -bootstrapStandby” on the unformatted NameNode
启动
接下来可以启动两个namenode了
首先我们停止所有的服务
在第一个namenode上
Zookeeper不要关闭,,其他的关闭就可以了
然后我们格式化zkfc
然后我们在吧hdfs启动
成功 启动全部 Start-dfs.sh
**
报错:
**
你说只有有缘人才可以取下,我看着你手中的戒指,想做你的有缘人,