通信hadoop平台需要开通的端口
服务 | port | 配置文件 | 端口服务 | 可选 |
---|---|---|---|---|
zookeeper | 2181 | core-site.xml | ha.zookeeper.quorum | Y。 |
hdfs_namenode | 9000 | hdfs-site.xml | dfs.namenode.rpc-address.beh.nn1 | N。namennode通信端口。 |
hdfs | 50070 | hdfs-site.xml | dfs.namenode.http-address.beh.nn1 | N。namenode通信端口,distcp_hftp访问50070端口。 |
hdfs | 8485 | hdfs-site.xml | dfs.namenode.shared.edits.dir | Y。 |
hdfs_datanode | 1027 | hdfs-site.xml | dfs.datanode.data.dir.perm | N。访问datanode。 |
hdfs_datanode | 1026 | hdfs-site.xml | dfs.datanode.http.address | N。访问datanode。 |
hdfs_datanode | 1025 | hdfs-site.xml | dfs.datanode.https.address | N。访问datanode。 |
hdfs_datanode | 50010 | hdfs-site.xml | dfs.datanode.address | Y。 |
hdfs_datanode | 50020 | hdfs-site.xml | dfs.datanode.ipc.address | Y。 |
yarn | 23140 | yarn-site.xml | yarn.resourcemanager.address.rm1 | Y(无提交application动作)。提交application,会访问yarn,必须开通端口。 |
yarn | 23130 | yarn-site.xml | yarn.resourcemanager.scheduler.address.rm1 | Y(无提交application动作)。提交application,会访问yarn,必须开通端口。 |
yarn | 23189 | yarn-site.xml | yarn.resourcemanager.webapp.https.address.rm1 | Y。 |
yarn | 23188 | yarn-site.xml | yarn.resourcemanager.webapp.address.rm1 | Y。 |
yarn | 23125 | yarn-site.xml | yarn.resourcemanager.resource-tracker.address.rm1 | Y(无提交application动作)。提交application,会访问yarn,必须开通端口。 |
yarn | 23141 | yarn-site.xml | yarn.resourcemanager.admin.address.rm1 | Y(无提交application动作)。提交application,会访问yarn,必须开通端口。 |
yarn | 23344 | yarn-site.xml | yarn.nodemanager.localizer.address | Y。 |
yarn | 23999 | yarn-site.xml | yarn.nodemanager.webapp.address | Y。 |
yarn | 23080 | yarn-site.xml | apreduce.shuffle.port | Y。 |
yarn | 8033 | yarn-site.xml | yarn.resourcemanager.admin.address | Y。 |
yarn | 8041 | yarn-site.xml | yarn.nodemanager.address | Y。提交application,会访问yarn。 |
hive | 3306 | hive-site.xml | javax.jdo.option.ConnectionURL | Y。 |
hive | 10000 | hive-site.xml | hiveserver2 | Y。hiveserver2(两个节点) |
mapreduce | 10020 | mapred-site.xml | mapreduce.jobhistory.address | Y(无提交mapreduce)。提交mapreduce,必须开通端口。 |
mapreduce | 19888 | mapred-site.xml | mapreduce.jobhistory.webapp.address |
hadoop客户端
客户端机器
外域机器通信需要用外网ip,未配置hostname访问
会访问异常,namenode return hosts to hadoop client,the hosts is inner ip,outter client can not request by inner ip. so need config **dfs.client.use.datanode.hostname** in otter client.
- 解决方案
服务器客户端,hdfs-site.xml
配置客户端用hostname方式访问集群
<property>
<name>dfs.client.use.datanode.hostname</name>
<value>true</value>
<description>only cofig in clients</description>
</property>
java_api客户端
Configuration conf=new Configuration();
conf.set("dfs.client.use.datanode.hostname", "true");
关于向yarn提交job的问题
1.application一直保持accepted状态,tarck ui是undefined状态
问题分析
查看yarn的application_xxx日志,发现datanode节点同外网客户端访问yarn的方式一样(用外网ip访问),所以可以肯定外网ip是从当前客户端机器获取的,尝试把yarn-site.xml里ResourceManager的ip都更新为hostname。
解决方案
yarn.resourcemanager.hostname,yarn.resourcemanager.address
把yarn-site.xml里的ResourceManager的ip都更新为hostname。