Hadoop的namenode和secondnamenode分开部署在不同服务器
2013-10-14 16:41
225 查看
一、系统环境:
Hadoop 0.20.2、JDK 1.6、Linux操作系统
二、使用背景
网上关于hadoop的集群配置,很多情况下,都是把namenode和secondnamenode部署在同一服务器上。为了降低风险,一个大的集群环境,最好是把这两个配置到不同的服务器上。
三、操作
要达到这要求,需要对conf/master、conf/hdfs-site.xml和conf/core-site.xml这三个配置文件进行设置。
1、conf/master文件:
hadoop的官网和大多网上的安装手册,都要求此文件配置namenode机器的IP或是名称。www.linuxidc.com 其实,master文件不决定哪个是namenode,而决定的是secondarynamenode(决定谁是namenode的关键配置是core-site.xml中的fs.default.name这个参数)。所以,这里直接写上作为secondnamenode的IP或机器名称(可以是集群中任一个datanode节点)就可以了。一行一个(可以配置多个secondnamenode)。
2、hdfs-site.xml:这个配置文件要改1个参数:
<property>
<name>dfs.http.address</name>
<value>hostIP:50070</value>
<description>
The address and the base port where the dfs namenode web ui will listen on.
If the port is 0 then the server will start on a free port.
</description>
</property>
3、core-site.xml:这里有2个参数可配置,但一般来说我们不做修改。
fs.checkpoint.period表示多长时间记录一次hdfs的镜像。www.linuxidc.com 默认是1小时。fs.checkpoint.size表示一次记录多大的size,默认64M。
<property>
<name>fs.checkpoint.period</name>
<value>3600</value>
<description>The number of seconds between two periodic checkpoints.
</description>
</property>
<property>
<name>fs.checkpoint.size</name>
<value>67108864</value>
<description>The size of the current edit log (in bytes) that triggers
a periodic checkpoint even if the fs.checkpoint.period hasn't expired.
</description>
</property>
四、检查结果
配置完成之后,我们需要检查一下是否成功。
1、在运行secondarynamenode的机器上,运行命令jps查看是否存在secondarynamenode进程。如不存在则表示secondarynamenode的启动有异常。
2、如果存在,在查看对应的目录下是否有备份记录。有以下目录结构表示设置成功。
进入hdfs-site.xml文件中配置的fs.checkpoint.dir目录,运行以下命令:
-bash-3.2$ ll namesecondary/
drwxr-xr-x 2 analyzer analyzer 4096 11-03 17:28 current
drwxr-xr-x 2 analyzer analyzer 4096 09-10 01:20 image
-rw-r--r-- 1 analyzer analyzer 0 11-03 16:22 in_use.lock
drwxr-xr-x 2 analyzer analyzer 4096 11-03 16:28 previous.checkpoint
-bash-3.2$ ll namesecondary/current/
-rw-r--r-- 1 analyzer analyzer 4 11-03 17:28 edits
-rw-r--r-- 1 analyzer analyzer 602092 11-03 17:28 fsimage
-rw-r--r-- 1 analyzer analyzer 8 11-03 17:28 fstime
-rw-r--r-- 1 analyzer analyzer 101 11-03 17:28 VERSION
Hadoop 0.20.2、JDK 1.6、Linux操作系统
二、使用背景
网上关于hadoop的集群配置,很多情况下,都是把namenode和secondnamenode部署在同一服务器上。为了降低风险,一个大的集群环境,最好是把这两个配置到不同的服务器上。
三、操作
要达到这要求,需要对conf/master、conf/hdfs-site.xml和conf/core-site.xml这三个配置文件进行设置。
1、conf/master文件:
hadoop的官网和大多网上的安装手册,都要求此文件配置namenode机器的IP或是名称。www.linuxidc.com 其实,master文件不决定哪个是namenode,而决定的是secondarynamenode(决定谁是namenode的关键配置是core-site.xml中的fs.default.name这个参数)。所以,这里直接写上作为secondnamenode的IP或机器名称(可以是集群中任一个datanode节点)就可以了。一行一个(可以配置多个secondnamenode)。
2、hdfs-site.xml:这个配置文件要改1个参数:
<property>
<name>dfs.http.address</name>
<value>hostIP:50070</value>
<description>
The address and the base port where the dfs namenode web ui will listen on.
If the port is 0 then the server will start on a free port.
</description>
</property>
3、core-site.xml:这里有2个参数可配置,但一般来说我们不做修改。
fs.checkpoint.period表示多长时间记录一次hdfs的镜像。www.linuxidc.com 默认是1小时。fs.checkpoint.size表示一次记录多大的size,默认64M。
<property>
<name>fs.checkpoint.period</name>
<value>3600</value>
<description>The number of seconds between two periodic checkpoints.
</description>
</property>
<property>
<name>fs.checkpoint.size</name>
<value>67108864</value>
<description>The size of the current edit log (in bytes) that triggers
a periodic checkpoint even if the fs.checkpoint.period hasn't expired.
</description>
</property>
四、检查结果
配置完成之后,我们需要检查一下是否成功。
1、在运行secondarynamenode的机器上,运行命令jps查看是否存在secondarynamenode进程。如不存在则表示secondarynamenode的启动有异常。
2、如果存在,在查看对应的目录下是否有备份记录。有以下目录结构表示设置成功。
进入hdfs-site.xml文件中配置的fs.checkpoint.dir目录,运行以下命令:
-bash-3.2$ ll namesecondary/
drwxr-xr-x 2 analyzer analyzer 4096 11-03 17:28 current
drwxr-xr-x 2 analyzer analyzer 4096 09-10 01:20 image
-rw-r--r-- 1 analyzer analyzer 0 11-03 16:22 in_use.lock
drwxr-xr-x 2 analyzer analyzer 4096 11-03 16:28 previous.checkpoint
-bash-3.2$ ll namesecondary/current/
-rw-r--r-- 1 analyzer analyzer 4 11-03 17:28 edits
-rw-r--r-- 1 analyzer analyzer 602092 11-03 17:28 fsimage
-rw-r--r-- 1 analyzer analyzer 8 11-03 17:28 fstime
-rw-r--r-- 1 analyzer analyzer 101 11-03 17:28 VERSION
相关文章推荐
- hadoop的namenode和secondnamenode分开部署在不同服务器
- Hadoop的namenode和secondnamenode分开部署在不同服务器
- Hadoop的namenode和secondnamenode分开部署在不同服务器
- Hadoop中如何将namenode和secondary namenode分开在不同服务器上。
- Hadoop中namenode和secondarynamenode分开部署
- 基于hadoop2.2的namenode与SecondaryNameNode分开配置在不同的计算机
- hadoop2.x 将namenode 与 SecondaryNameNode 分开部署
- 阿里云服务器部署分布式hadoop 2.7时,NameNode启动报Problem binding to [master:9000]问题
- 一个tomcat服务器上部署多个项目,不同域名访问
- hadoop2.X如何将namenode与SecondaryNameNode分开配置
- 部署hadoop后,datanode无法连接namenode
- hadoop SecondNamenode
- hadoop2.X如何将namenode与SecondaryNameNode分开配置
- hadoop secondary namenode 部署出错所产生的错误及解决方法
- wcfDualHTTPBinding配置的服务器与客户端部署于不同机器的问题
- Hadoop--SecondNameNode导致服务启动时间超长
- 提高web性能!nginx和php-fpm分别部署在不同服务器;
- hadoop-1.1.0的SecondaryNameNode单独部署
- Apache服务器实现不同域名部署不同SSL证书方法
- 服务器上只安装一份Tomcat,如何部署多个应用,要求每个应用使用不同的端口